diff mbox

Fix PR tree-optimization/44885

Message ID 201007281153.26503.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou July 28, 2010, 9:53 a.m. UTC
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  <ebotcazou@adacore.com>

	PR tree-optimization/44885
	* tree-sra.c (find_param_candidates): Skip pointer types to arrays
	with non-aliased component.

Comments

Richard Biener July 28, 2010, 9:56 a.m. UTC | #1
On Wed, Jul 28, 2010 at 11:53 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> 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?

Ok.

Thanks,
Richard.

>
> 2010-07-28  Eric Botcazou  <ebotcazou@adacore.com>
>
>        PR tree-optimization/44885
>        * tree-sra.c (find_param_candidates): Skip pointer types to arrays
>        with non-aliased component.
>
>
> --
> Eric Botcazou
>
diff mbox

Patch

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))