summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-01 16:57:02 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-01 16:57:02 +0000
commitc40a6f906600da14fa8a9d5846f4478da8ddebc4 (patch)
treedce5f3e5cbf410a30b6490696932190d8e2cdfe1 /gcc/tree-ssa-ccp.c
parent4847708aa3b5f0e9611dc2c914233db9bc1555d2 (diff)
downloadgcc-c40a6f906600da14fa8a9d5846f4478da8ddebc4.tar.gz
2010-03-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43220 * tree-ssa-ccp.c (optimize_stack_restore): Do not optimize BUILT_IN_STACK_{SAVE,RESTORE} around alloca. * gcc.c-torture/execute/pr43220.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157149 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index a4869d287ac..03c35001718 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -3203,7 +3203,10 @@ optimize_stack_restore (gimple_stmt_iterator i)
continue;
callee = gimple_call_fndecl (stmt);
- if (!callee || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
+ if (!callee
+ || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
+ /* All regular builtins are ok, just obviously not alloca. */
+ || DECL_FUNCTION_CODE (callee) == BUILT_IN_ALLOCA)
return NULL_TREE;
if (DECL_FUNCTION_CODE (callee) == BUILT_IN_STACK_RESTORE)