aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2004-09-22 11:40:12 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2004-09-22 07:40:12 -0400
commit6a97296a060b9e053ae598076ffa14c41a5b6f39 (patch)
tree72b9739f89b8a8c1be1a8932e4dea6cccbb6d17e /gcc/fold-const.c
parent3b620440d3041539ea0150599073d829cea2982d (diff)
downloadgcc-6a97296a060b9e053ae598076ffa14c41a5b6f39.zip
gcc-6a97296a060b9e053ae598076ffa14c41a5b6f39.tar.gz
gcc-6a97296a060b9e053ae598076ffa14c41a5b6f39.tar.bz2
fold-const.c (fold): Avoid non INTEGER_TYPEs when widening operands in an integer comparison.
* 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. From-SVN: r87855
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 25c84a4..c762fad 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)));