summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-10 02:24:27 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-10 02:24:27 +0000
commit4ac297c8a004b2e775503899daa35b4eb729627d (patch)
tree51f4ee95f722240f3d4dc04e828383dded783010 /gcc/tree-ssa-ccp.c
parent7d70572731950bf0ddb0f642e0a801d1b5b94cbc (diff)
downloadgcc-4ac297c8a004b2e775503899daa35b4eb729627d.tar.gz
* tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs
with prejudice. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84436 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index d2c503d6ceb..01da8f88e07 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2405,7 +2405,16 @@ ccp_fold_builtin (tree stmt, tree fn)
}
if (result && ignore)
- STRIP_NOPS (result);
+ {
+ /* STRIP_NOPS isn't strong enough -- it'll stop when we change modes,
+ but given that we're ignoring the result, we don't care what type
+ is being returned by the transformed function. */
+ while (TREE_CODE (result) == NOP_EXPR
+ || TREE_CODE (result) == CONVERT_EXPR
+ || TREE_CODE (result) == NON_LVALUE_EXPR)
+ result = TREE_OPERAND (result, 0);
+ }
+
return result;
}