Make merge-blocks fold all statements propagated into

Submitted by Richard Guenther on Sept. 5, 2011, 9:10 a.m.


Message ID alpine.LNX.2.00.1109051109080.2130@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Guenther Sept. 5, 2011, 9:10 a.m.
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

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


2011-09-05  Richard Guenther  <>

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

Patch hide | download patch | download mbox

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);