aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-03-11 15:24:00 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2009-03-11 15:24:00 +0000
commitdc215785635e91c391118cf773f5ba1f6d26acb1 (patch)
treee99dab3450b2f3d8752625e45a2e5345cd593a8c /gcc/fold-const.c
parent32fdf2f406a4db93a66ec808812c5843c601e9b4 (diff)
downloadgcc-dc215785635e91c391118cf773f5ba1f6d26acb1.zip
gcc-dc215785635e91c391118cf773f5ba1f6d26acb1.tar.gz
gcc-dc215785635e91c391118cf773f5ba1f6d26acb1.tar.bz2
fold-const.c (fold_comparison): Only call fold_inf_compare if the mode supports infinities.
ChangeLog: * fold-const.c (fold_comparison): Only call fold_inf_compare if the mode supports infinities. testsuite/ChangeLog: * gcc.c-torture/execute/ieee/inf-3.c: New test. * gcc.c-torture/execute/ieee/inf-2.c: Fix typo. From-SVN: r144779
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 97331f3..e38850f 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -9292,7 +9292,8 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
}
/* Fold comparisons against infinity. */
- if (REAL_VALUE_ISINF (cst))
+ if (REAL_VALUE_ISINF (cst)
+ && MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg1))))
{
tem = fold_inf_compare (code, type, arg0, arg1);
if (tem != NULL_TREE)