aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-12-16 13:47:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-12-16 13:47:40 +0100
commitdc01fed16871b371d076f086d087b07ac3ac28cb (patch)
tree5789822efe7fb747e4a9fe7b9270d1ab9afe0c66 /gcc/tree-chrec.c
parent9245e113af292e105fa4448020342c7efe00bbb8 (diff)
downloadgcc-dc01fed16871b371d076f086d087b07ac3ac28cb.zip
gcc-dc01fed16871b371d076f086d087b07ac3ac28cb.tar.gz
gcc-dc01fed16871b371d076f086d087b07ac3ac28cb.tar.bz2
tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to (T2)t +- (T2)x if only integer types are involved.
* tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to (T2)t +- (T2)x if only integer types are involved. * gcc.c-torture/compile/20091215-1.c: New test. From-SVN: r155288
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 9711e20..18ed4ed 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1293,6 +1293,8 @@ keep_cast:
if (use_overflow_semantics
&& (TREE_CODE (chrec) == PLUS_EXPR
|| TREE_CODE (chrec) == MINUS_EXPR)
+ && TREE_CODE (type) == INTEGER_TYPE
+ && TREE_CODE (ct) == INTEGER_TYPE
&& TYPE_PRECISION (type) > TYPE_PRECISION (ct)
&& TYPE_OVERFLOW_UNDEFINED (ct))
res = fold_build2 (TREE_CODE (chrec), type,