summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-29 22:29:10 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-29 22:29:10 +0000
commit1543f7208f8414fb70d55d95ae1f40d2ad0fc2ca (patch)
tree45e0a1ca27d731cded69c274303601e4f1f6ac30 /gcc/tree-ssa-ccp.c
parent80f058cdd7bffcefbb17d099f222be85d7777e69 (diff)
downloadgcc-1543f7208f8414fb70d55d95ae1f40d2ad0fc2ca.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185982 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index c28006a9132..4e86b8db0c3 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