summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 10:06:54 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 10:06:54 +0000
commit8ef4f12460a6eea74ed3f8bc49276e46f081b039 (patch)
treea02c315a092276000b54f52506607d0102e2325c /gcc/tree-ssa-ccp.c
parent2a8d660dd8949db0a6aeaf121cbe5b31a05e1eea (diff)
downloadgcc-8ef4f12460a6eea74ed3f8bc49276e46f081b039.tar.gz
2008-09-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37433 * tree-ssa-ccp.c (ccp_fold): Properly guard folding of function calls. * gcc.c-torture/compile/pr37433.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140143 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 8f700c47be2..22626a53840 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1047,6 +1047,7 @@ ccp_fold (gimple stmt)
fn = val->value;
}
if (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (fn, 0)))
{
tree *args = XALLOCAVEC (tree, gimple_call_num_args (stmt));