From patchwork Wed Jul 28 09:53:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR tree-optimization/44885 Date: Tue, 27 Jul 2010 23:53:26 -0000 From: Eric Botcazou X-Patchwork-Id: 60129 Message-Id: <201007281153.26503.ebotcazou@adacore.com> To: gcc-patches@gcc.gnu.org Hi, this is the failure of gnat.dg/aliasing3.adb on 32-bit platforms exposed by the mem-ref2 merge. But the root cause is a latent problem in IPA-SRA: the pass takes the address of a component of a TYPE_NONALIASED_COMPONENT array. Proposed fix attached, tested on x86-64-suse-linux, OK for mainline? 2010-07-28 Eric Botcazou PR tree-optimization/44885 * tree-sra.c (find_param_candidates): Skip pointer types to arrays with non-aliased component. Index: tree-sra.c =================================================================== --- tree-sra.c (revision 162618) +++ tree-sra.c (working copy) @@ -3147,6 +3147,8 @@ find_param_candidates (void) if (TREE_CODE (type) == FUNCTION_TYPE || TYPE_VOLATILE (type) + || (TREE_CODE (type) == ARRAY_TYPE + && TYPE_NONALIASED_COMPONENT (type)) || !is_gimple_reg (parm) || is_va_list_type (type) || ptr_parm_has_direct_uses (parm))