OSDN Git Service

2006-12-05 Daniel Berlin <dberlin@dberlin.org>
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Dec 2006 23:46:28 +0000 (23:46 +0000)
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Dec 2006 23:46:28 +0000 (23:46 +0000)
* tree-ssa-structalias.c (set_used_smts): Re-fix pr29156.
Optimize to avoid marking more SMT's as used when they aren't.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119562 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 3f098bf..cba8137 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-05  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree-ssa-structalias.c (set_used_smts): Re-fix pr29156.
+       Optimize to avoid marking more SMT's as used when they aren't.
+
 2006-12-05  Eric Christopher  <echristo@apple.com>
 
        * config/i386/i386.c (x86_output_aligned_bss): Move out
index 99deb41..6bd5d6f 100644 (file)
@@ -3894,15 +3894,21 @@ set_used_smts (void)
       unsigned int j;
       var_ann_t va;
       struct ptr_info_def *pi = NULL;
-
-      if (TREE_CODE (vi->decl) == SSA_NAME)
+      
+      /* For parm decls, the pointer info may be under the default
+        def.  */
+      if (TREE_CODE (vi->decl) == PARM_DECL
+         && gimple_default_def (cfun, var))
+       pi = SSA_NAME_PTR_INFO (gimple_default_def (cfun, var));
+      else if (TREE_CODE (var) == SSA_NAME)
        pi = SSA_NAME_PTR_INFO (var);
 
       /* Skip the special variables and those without their own
         solution set.  */
       if (vi->is_special_var || vi->node != vi->id || !SSA_VAR_P (var)
          || (pi && !pi->is_dereferenced) 
-         || (DECL_P (var) && !may_be_aliased (var)))
+         || (TREE_CODE (var) == VAR_DECL && !may_be_aliased (var))
+         || !POINTER_TYPE_P (TREE_TYPE (var)))
        continue;
 
       if (TREE_CODE (var) == SSA_NAME)
@@ -3913,17 +3919,8 @@ set_used_smts (void)
        continue;
 
       smt = va->symbol_mem_tag;
-      if (smt)
-       {
-         EXECUTE_IF_SET_IN_BITMAP (vi->solution, 0, j, bi)
-           {
-             if (get_varinfo (j)->is_artificial_var)
-               {
-                 bitmap_set_bit (used_smts, DECL_UID (smt));
-                 break;
-               }
-           }
-       }
+      if (smt && bitmap_bit_p (vi->solution, anything_id))
+       bitmap_set_bit (used_smts, DECL_UID (smt));
     }
 }