summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-22 11:40:12 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-22 11:40:12 +0000
commitb2cc1a5ae9135d78535fb92368d97f00d96d9a74 (patch)
tree72b9739f89b8a8c1be1a8932e4dea6cccbb6d17e /gcc/fold-const.c
parent524a54cf87441bb4ba6676aff72494c0c1ceb7eb (diff)
downloadgcc-b2cc1a5ae9135d78535fb92368d97f00d96d9a74.tar.gz
* fold-const.c (fold): Avoid non INTEGER_TYPEs when widening
operands in an integer comparison. * tree-cfg.c (find_taken_edge): Call fold() to determine whether the predicate is known. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87855 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 25c84a45914..c762fada3fe 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8290,6 +8290,7 @@ fold (tree expr)
&& (t1 = get_unwidened (arg1, TREE_TYPE (tem))) != 0
&& (TREE_TYPE (t1) == TREE_TYPE (tem)
|| (TREE_CODE (t1) == INTEGER_CST
+ && TREE_CODE (TREE_TYPE (tem)) == INTEGER_TYPE
&& int_fits_type_p (t1, TREE_TYPE (tem)))))
return fold (build2 (code, type, tem,
fold_convert (TREE_TYPE (tem), t1)));