tree-ssa-propagate.c (replace_phi_args_in): Return whether we propagated anything.
authorRichard Biener <rguenther@suse.de>
Wed, 18 Jun 2014 07:58:36 +0000 (07:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 18 Jun 2014 07:58:36 +0000 (07:58 +0000)
2014-06-18  Richard Biener  <rguenther@suse.de>

* tree-ssa-propagate.c (replace_phi_args_in): Return whether
we propagated anything.
(substitute_and_fold_dom_walker::before_dom_children): Something
changed if we propagated into PHI arguments.
* tree-ssa-pre.c (eliminate): Always schedule cfg-cleanup if
we removed a stmt.

From-SVN: r211770

gcc/ChangeLog
gcc/tree-ssa-pre.c
gcc/tree-ssa-propagate.c

index 93955b3..5eb312b 100644 (file)
@@ -1,3 +1,12 @@
+2014-06-18  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-propagate.c (replace_phi_args_in): Return whether
+       we propagated anything.
+       (substitute_and_fold_dom_walker::before_dom_children): Something
+       changed if we propagated into PHI arguments.
+       * tree-ssa-pre.c (eliminate): Always schedule cfg-cleanup if
+       we removed a stmt.
+
 2014-06-18  Evgeny Stupachenko  <evstupac@gmail.com>
 
        * config/i386/i386.c (ix86_reassociation_width): Add alternative for
index bca95dd..686f107 100644 (file)
@@ -4521,11 +4521,7 @@ eliminate (bool do_pre)
 
       gsi = gsi_for_stmt (stmt);
       if (gimple_code (stmt) == GIMPLE_PHI)
-       {
-         remove_phi_node (&gsi, true);
-         /* Removing a PHI node in a block may expose a forwarder block.  */
-         el_todo |= TODO_cleanup_cfg;
-       }
+       remove_phi_node (&gsi, true);
       else
        {
          basic_block bb = gimple_bb (stmt);
@@ -4534,6 +4530,9 @@ eliminate (bool do_pre)
            bitmap_set_bit (need_eh_cleanup, bb->index);
          release_defs (stmt);
        }
+
+      /* Removing a stmt may expose a forwarder block.  */
+      el_todo |= TODO_cleanup_cfg;
     }
   el_to_remove.release ();
 
index cdc9f6a..eb65b18 100644 (file)
@@ -964,7 +964,7 @@ replace_uses_in (gimple stmt, ssa_prop_get_value_fn get_value)
 /* Replace propagated values into all the arguments for PHI using the
    values from PROP_VALUE.  */
 
-static void
+static bool
 replace_phi_args_in (gimple phi, ssa_prop_get_value_fn get_value)
 {
   size_t i;
@@ -1015,6 +1015,8 @@ replace_phi_args_in (gimple phi, ssa_prop_get_value_fn get_value)
          fprintf (dump_file, "\n");
        }
     }
+
+  return replaced;
 }
 
 
@@ -1066,7 +1068,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
              continue;
            }
        }
-      replace_phi_args_in (phi, get_value_fn);
+      something_changed |= replace_phi_args_in (phi, get_value_fn);
     }
 
   /* Propagate known values into stmts.  In some case it exposes