This makes merge-blocks fold all statements that have single-arg PHI
arguments propagated into them.  fold_stmt_inplace does not fold
calls, thus the following makes us use fold_stmt instead of
fold_stmt_inplace.

Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu.

Richard.

2011-09-05  Richard Guenther  <rguent...@suse.de>

        * tree-cfg.c (replace_uses_by): Use fold_stmt, not fold_stmt_inplace.

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c      (revision 178523)
+++ gcc/tree-cfg.c      (working copy)
@@ -1566,9 +1570,11 @@ replace_uses_by (tree name, tree val)
 
       if (gimple_code (stmt) != GIMPLE_PHI)
        {
+         gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
          size_t i;
 
-         fold_stmt_inplace (stmt);
+         fold_stmt (&gsi);
+         stmt = gsi_stmt (gsi);
          if (cfgcleanup_altered_bbs && !is_gimple_debug (stmt))
            bitmap_set_bit (cfgcleanup_altered_bbs, gimple_bb (stmt)->index);
 

Reply via email to