diff options
author | Martin Jambor <mjambor@suse.cz> | 2012-03-30 00:29:10 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2012-03-30 00:29:10 +0200 |
commit | b9bebd7f03e0117bf488ed687ff752f8a0595b8e (patch) | |
tree | 45e0a1ca27d731cded69c274303601e4f1f6ac30 /gcc/tree-ssa-ccp.c | |
parent | a15d0d03ae76176f7f4195abb2b9d1058d81599a (diff) | |
download | gcc-b9bebd7f03e0117bf488ed687ff752f8a0595b8e.zip gcc-b9bebd7f03e0117bf488ed687ff752f8a0595b8e.tar.gz gcc-b9bebd7f03e0117bf488ed687ff752f8a0595b8e.tar.bz2 |
tree-ssa-ccp.c (insert_clobbers_for_var): Do not assert that there is a builtin_stack_save in a dominating BB.
2012-03-30 Martin Jambor <mjambor@suse.cz>
* tree-ssa-ccp.c (insert_clobbers_for_var): Do not assert that there
is a builtin_stack_save in a dominating BB.
From-SVN: r185982
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index c28006a..4e86b8db 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1764,23 +1764,25 @@ gsi_prev_dom_bb_nondebug (gimple_stmt_iterator *i) } /* Find a BUILT_IN_STACK_SAVE dominating gsi_stmt (I), and insert - a clobber of VAR before each matching BUILT_IN_STACK_RESTORE. */ + a clobber of VAR before each matching BUILT_IN_STACK_RESTORE. + + It is possible that BUILT_IN_STACK_SAVE cannot be find in a dominator when a + previous pass (such as DOM) duplicated it along multiple paths to a BB. In + that case the function gives up without inserting the clobbers. */ static void insert_clobbers_for_var (gimple_stmt_iterator i, tree var) { - bool save_found; gimple stmt; tree saved_val; htab_t visited = NULL; - for (save_found = false; !gsi_end_p (i); gsi_prev_dom_bb_nondebug (&i)) + for (; !gsi_end_p (i); gsi_prev_dom_bb_nondebug (&i)) { stmt = gsi_stmt (i); if (!gimple_call_builtin_p (stmt, BUILT_IN_STACK_SAVE)) continue; - save_found = true; saved_val = gimple_call_lhs (stmt); if (saved_val == NULL_TREE) @@ -1792,7 +1794,6 @@ insert_clobbers_for_var (gimple_stmt_iterator i, tree var) if (visited != NULL) htab_delete (visited); - gcc_assert (save_found); } /* Detects a __builtin_alloca_with_align with constant size argument. Declares |