diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c36a8ac4d5cf801d1e23ab0de7ece1eef5aa5fa..22079f8e5a91a90972267c3cc73b944885222220 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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. + 2012-03-29 Uros Bizjak <ubizjak@gmail.com> * config/i386/sse.md (avx_h<plusminus_insn>v4df3): Fix results diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index c28006a91320e0807757df627ebeacfff7ea37fa..4e86b8db0c32abc7afabed30f68c62e2d45240b6 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