This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Make merge-blocks fold all statements propagated into
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Sep 2011 11:10:50 +0200 (CEST)
- Subject: [PATCH] Make merge-blocks fold all statements propagated into
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.
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);