aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-06-10 21:22:30 -0600
committerJeff Law <law@gcc.gnu.org>2004-06-10 21:22:30 -0600
commit3100d647250b4209a601763e7887936d25899f3f (patch)
tree1f7da268e22cc234d32ba6f2a4c85f419a465a4d /gcc/fold-const.c
parentda291c876347aad7c585d2a7fe8a463af74dd422 (diff)
downloadgcc-3100d647250b4209a601763e7887936d25899f3f.zip
gcc-3100d647250b4209a601763e7887936d25899f3f.tar.gz
gcc-3100d647250b4209a601763e7887936d25899f3f.tar.bz2
fold-const.c (fold_inf_compare): Avoid creating non-gimple code when we are in gimple form.
* fold-const.c (fold_inf_compare): Avoid creating non-gimple code when we are in gimple form. * gcc.c-torture/compile/20040610-1.c: New test. From-SVN: r82958
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f5bd659..3a7053e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5214,6 +5214,12 @@ fold_inf_compare (enum tree_code code, tree type, tree arg0, tree arg1)
if (! HONOR_NANS (mode))
return fold (build2 (neg ? GE_EXPR : LE_EXPR, type,
arg0, build_real (TREE_TYPE (arg0), max)));
+
+ /* The transformation below creates non-gimple code and thus is
+ not appropriate if we are in gimple form. */
+ if (in_gimple_form)
+ return NULL_TREE;
+
temp = fold (build2 (neg ? LT_EXPR : GT_EXPR, type,
arg0, build_real (TREE_TYPE (arg0), max)));
return fold (build1 (TRUTH_NOT_EXPR, type, temp));