summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@gcc.gnu.org>2014-06-24 06:33:58 +0000
committerChung-Lin Tang <cltang@gcc.gnu.org>2014-06-24 06:33:58 +0000
commit335123531f234436288975eb80d3655756878d29 (patch)
tree38ca9da17cc881a1bc24ece1cc2a23834dea889c /gcc/tree-ssa-propagate.c
parent0967188e42115c36e063bc76dab4e82d0bdf7738 (diff)
downloadgcc-335123531f234436288975eb80d3655756878d29.tar.gz
[multiple changes]
2014-06-24 Chung-Lin Tang <cltang@codesourcery.com> PR tree-optimization/61554 * tree-ssa-propagate.c: Include "bitmap.h". (substitute_and_fold_dom_walker): Add 'bitmap need_eh_cleanup' member, properly update constructor/destructor. (substitute_and_fold_dom_walker::before_dom_children): Remove call to gimple_purge_dead_eh_edges, add bb->index to need_eh_cleaup instead. (substitute_and_fold): Call gimple_purge_all_dead_eh_edges on need_eh_cleanup. testsuite/ 2014-06-24 Markus Trippelsdorf <markus@trippelsdorf.de> PR tree-optimization/61554 * g++.dg/torture/pr61554.C: New testcase. From-SVN: r211928
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r--gcc/tree-ssa-propagate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index eb65b18ce85..2e337e428c6 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -29,6 +29,7 @@
#include "function.h"
#include "gimple-pretty-print.h"
#include "dumpfile.h"
+#include "bitmap.h"
#include "sbitmap.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
@@ -1031,8 +1032,13 @@ public:
fold_fn (fold_fn_), do_dce (do_dce_), something_changed (false)
{
stmts_to_remove.create (0);
+ need_eh_cleanup = BITMAP_ALLOC (NULL);
+ }
+ ~substitute_and_fold_dom_walker ()
+ {
+ stmts_to_remove.release ();
+ BITMAP_FREE (need_eh_cleanup);
}
- ~substitute_and_fold_dom_walker () { stmts_to_remove.release (); }
virtual void before_dom_children (basic_block);
virtual void after_dom_children (basic_block) {}
@@ -1042,6 +1048,7 @@ public:
bool do_dce;
bool something_changed;
vec<gimple> stmts_to_remove;
+ bitmap need_eh_cleanup;
};
void
@@ -1144,7 +1151,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
/* If we cleaned up EH information from the statement,
remove EH edges. */
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
- gimple_purge_dead_eh_edges (bb);
+ bitmap_set_bit (need_eh_cleanup, bb->index);
if (is_gimple_assign (stmt)
&& (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
@@ -1235,6 +1242,9 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
}
}
+ if (!bitmap_empty_p (walker.need_eh_cleanup))
+ gimple_purge_all_dead_eh_edges (walker.need_eh_cleanup);
+
statistics_counter_event (cfun, "Constants propagated",
prop_stats.num_const_prop);
statistics_counter_event (cfun, "Copies propagated",