summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-09-09 10:06:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-09-09 10:06:54 +0000
commita135b1c41c63e75ad1b8d74345eca520e973e2f9 (patch)
treea02c315a092276000b54f52506607d0102e2325c /gcc/tree-ssa-ccp.c
parent6e548df501d6447f40d294f8fc01b7d8f3b72887 (diff)
downloadgcc-a135b1c41c63e75ad1b8d74345eca520e973e2f9.tar.gz
re PR tree-optimization/37433 (tree check: expected function_decl, have string_cst in ccp_fold, at tree-ssa-ccp.c:1050)
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. From-SVN: r140143
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));