From 4ac297c8a004b2e775503899daa35b4eb729627d Mon Sep 17 00:00:00 2001 From: rth Date: Sat, 10 Jul 2004 02:24:27 +0000 Subject: [PATCH] * 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 --- gcc/ChangeLog | 3 +++ gcc/tree-ssa-ccp.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3fb67e7..47ada40 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,9 @@ * builtins.c (expand_builtin_stpcpy): Don't modify len. + * tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs + with prejudice. + 2004-07-10 Kelley Cook * flags.h: Delete redundant prototypes that are being generated diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index d2c503d..01da8f8 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; } -- 2.7.4