re PR tree-optimization/36339 (not call clobbering variable for non common offset)
authorRichard Guenther <rguenther@suse.de>
Wed, 28 May 2008 14:45:57 +0000 (14:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 28 May 2008 14:45:57 +0000 (14:45 +0000)
2008-05-28  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/36339
* tree-ssa-alias.c (set_initial_properties): Move pt_anything
and clobbering code out of the loop.

From-SVN: r136100

gcc/ChangeLog
gcc/tree-ssa-alias.c

index a64b0b0..43e61a6 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-28  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/36339
+       * tree-ssa-alias.c (set_initial_properties): Move pt_anything
+       and clobbering code out of the loop.
+
 2008-05-28  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * config/s390/constraints.md ('b', 'C', 'D', 'e'): New constraint
index 983e321..4f66154 100644 (file)
@@ -521,6 +521,8 @@ set_initial_properties (struct alias_info *ai)
   referenced_var_iterator rvi;
   tree var;
   tree ptr;
+  bool any_pt_anything = false;
+  enum escape_type pt_anything_mask = 0;
 
   FOR_EACH_REFERENCED_VAR (var, rvi)
     {
@@ -573,19 +575,8 @@ set_initial_properties (struct alias_info *ai)
            }
          else if (pi->pt_anything)
            {
-             bitmap_iterator bi;
-             unsigned int j;
-
-             /* If we do not have the points-to set filled out we
-                still need to honor that this escaped pointer points
-                to anything.  */
-             EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun),
-                                       0, j, bi)
-               {
-                 tree var = referenced_var (j);
-                 if (!unmodifiable_var_p (var))
-                   mark_call_clobbered (var, pi->escape_mask);
-               }
+             any_pt_anything = true;
+             pt_anything_mask |= pi->escape_mask;
            }
        }
 
@@ -619,6 +610,21 @@ set_initial_properties (struct alias_info *ai)
          MTAG_GLOBAL (tag) = true;
        }
     }
+
+  /* If a pt_anything pointer escaped we need to mark all addressable
+     variables call clobbered.  */
+  if (any_pt_anything)
+    {
+      bitmap_iterator bi;
+      unsigned int j;
+
+      EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, j, bi)
+       {
+         tree var = referenced_var (j);
+         if (!unmodifiable_var_p (var))
+           mark_call_clobbered (var, pt_anything_mask);
+       }
+    }
 }
 
 /* Compute which variables need to be marked call clobbered because