summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-16 12:47:40 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-16 12:47:40 +0000
commit04bdcc7637d265d029ca16b825e6c8845e045537 (patch)
tree5789822efe7fb747e4a9fe7b9270d1ab9afe0c66 /gcc/tree-chrec.c
parentb3f6f6371579def7ebf78376c7e96dd4f7ddc406 (diff)
downloadgcc-04bdcc7637d265d029ca16b825e6c8845e045537.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155288 138bc75d-0d04-0410-961f-82ee72b054a4
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 9711e20b5be..18ed4ed2a38 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,