[Bug tree-optimization/28807] [4.2 Regression] wrong code with may_alias and structs

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 23 08:11:00 GMT 2006



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-08-23 08:11 -------
This patch fixes the problem without causing the missed optimization to
happen:Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c (revision 116342)
+++ tree-ssa-operands.c (working copy)
@@ -1150,7 +1150,8 @@ access_can_touch_variable (tree ref, tre
               || TREE_CODE (TREE_TYPE (base)) != UNION_TYPE)
           && !AGGREGATE_TYPE_P (TREE_TYPE (alias))
           && TREE_CODE (TREE_TYPE (alias)) != COMPLEX_TYPE
-          && !POINTER_TYPE_P (TREE_TYPE (alias)))
+          && !POINTER_TYPE_P (TREE_TYPE (alias))
+          && get_alias_set (base))
     {
 #ifdef ACCESS_DEBUGGING
       fprintf (stderr, "Access to ");


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28807



More information about the Gcc-bugs mailing list