OSDN Git Service

PR tree-optimization/49539
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Jun 2011 16:02:56 +0000 (16:02 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Jun 2011 16:02:56 +0000 (16:02 +0000)
* tree-ssa-forwprop.c (can_propagate_from): Check for abnormal SSA
names by means of stmt_references_abnormal_ssa_name.
(associate_plusminus): Call can_propagate_from before propagating
from definition statements.
(ssa_forward_propagate_and_combine): Remove superfluous newline.

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

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

index 0a63995..e37d823 100644 (file)
@@ -1,3 +1,12 @@
+2011-06-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR tree-optimization/49539
+       * tree-ssa-forwprop.c (can_propagate_from): Check for abnormal SSA
+       names by means of stmt_references_abnormal_ssa_name.
+       (associate_plusminus): Call can_propagate_from before propagating
+       from definition statements.
+       (ssa_forward_propagate_and_combine): Remove superfluous newline.
+
 2011-06-29  Richard Guenther  <rguenther@suse.de>
 
        * doc/invoke.texi: Document -scev dump modifier.
 
 2011-06-20  Changpeng Fang  <changpeng.fang@amd.com>
 
-       PR i386/49089
+       PR target/49089
        * config/i386/i386.c (avx256_split_unaligned_load): New definition.
        (avx256_split_unaligned_store): New definition.
        (ix86_option_override_internal): Enable avx256 unaligned load/store
index 27453dd..e93acdf 100644 (file)
@@ -260,9 +260,6 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
 static bool
 can_propagate_from (gimple def_stmt)
 {
-  use_operand_p use_p;
-  ssa_op_iter iter;
-
   gcc_assert (is_gimple_assign (def_stmt));
 
   /* If the rhs has side-effects we cannot propagate from it.  */
@@ -280,9 +277,8 @@ can_propagate_from (gimple def_stmt)
     return true;
 
   /* We cannot propagate ssa names that occur in abnormal phi nodes.  */
-  FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_USE)
-    if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (USE_FROM_PTR (use_p)))
-      return false;
+  if (stmt_references_abnormal_ssa_name (def_stmt))
+    return false;
 
   /* If the definition is a conversion of a pointer to a function type,
      then we can not apply optimizations as some targets require
@@ -1803,7 +1799,8 @@ associate_plusminus (gimple stmt)
        {
          gimple def_stmt = SSA_NAME_DEF_STMT (rhs2);
          if (is_gimple_assign (def_stmt)
-             && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR)
+             && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR
+             && can_propagate_from (def_stmt))
            {
              code = (code == MINUS_EXPR) ? PLUS_EXPR : MINUS_EXPR;
              gimple_assign_set_rhs_code (stmt, code);
@@ -1820,7 +1817,8 @@ associate_plusminus (gimple stmt)
        {
          gimple def_stmt = SSA_NAME_DEF_STMT (rhs1);
          if (is_gimple_assign (def_stmt)
-             && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR)
+             && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR
+             && can_propagate_from (def_stmt))
            {
              code = MINUS_EXPR;
              gimple_assign_set_rhs_code (stmt, code);
@@ -1863,7 +1861,7 @@ associate_plusminus (gimple stmt)
   if (TREE_CODE (rhs1) == SSA_NAME)
     {
       gimple def_stmt = SSA_NAME_DEF_STMT (rhs1);
-      if (is_gimple_assign (def_stmt))
+      if (is_gimple_assign (def_stmt) && can_propagate_from (def_stmt))
        {
          enum tree_code def_code = gimple_assign_rhs_code (def_stmt);
          if (def_code == PLUS_EXPR
@@ -1963,7 +1961,7 @@ associate_plusminus (gimple stmt)
   if (rhs2 && TREE_CODE (rhs2) == SSA_NAME)
     {
       gimple def_stmt = SSA_NAME_DEF_STMT (rhs2);
-      if (is_gimple_assign (def_stmt))
+      if (is_gimple_assign (def_stmt) && can_propagate_from (def_stmt))
        {
          enum tree_code def_code = gimple_assign_rhs_code (def_stmt);
          if (def_code == PLUS_EXPR
@@ -2285,8 +2283,7 @@ ssa_forward_propagate_and_combine (void)
              else
                gsi_next (&gsi);
            }
-         else if (code == POINTER_PLUS_EXPR
-                  && can_propagate_from (stmt))
+         else if (code == POINTER_PLUS_EXPR && can_propagate_from (stmt))
            {
              if (TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
                  /* ???  Better adjust the interface to that function