summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-21 13:14:02 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-21 13:14:02 +0000
commitad78532f86b1d897c3e91695947d105bb6bc45ab (patch)
tree9be13a35411c4736c5d5aaa5999fe92678e322c0 /gcc/tree-ssa-ccp.c
parentea110a711159abb56b8f4906870cf674f4dde82b (diff)
downloadgcc-ad78532f86b1d897c3e91695947d105bb6bc45ab.tar.gz
PR tree-optimization/24653
* tree-ssa-ccp.c (ccp_fold): Strip down useless conversions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107304 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index cd446ee63e0..a838ce925cd 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -879,6 +879,10 @@ ccp_fold (tree stmt)
op0 = get_value (op0, true)->value;
}
+ if ((code == NOP_EXPR || code == CONVERT_EXPR)
+ && tree_ssa_useless_type_conversion_1 (TREE_TYPE (rhs),
+ TREE_TYPE (op0)))
+ return op0;
return fold_unary (code, TREE_TYPE (rhs), op0);
}