Patchwork Make merge-blocks fold all statements propagated into

login
register
mail settings
Submitter Richard Guenther
Date Sept. 5, 2011, 9:10 a.m.
Message ID <alpine.LNX.2.00.1109051109080.2130@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/113328/
State New
Headers show

Comments

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
fold_stmt_inplace.

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

Richard.

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

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

Patch

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