This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR tree-optimization/44885


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.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]