From: Jeff Law Date: Fri, 11 Jun 2004 03:22:30 +0000 (-0600) Subject: fold-const.c (fold_inf_compare): Avoid creating non-gimple code when we are in gimple... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3100d647250b4209a601763e7887936d25899f3f;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c44fc3a50d..ca94a49eb60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-06-10 Jeff Law + + * fold-const.c (fold_inf_compare): Avoid creating non-gimple + code when we are in gimple form. + 2004-06-10 Diego Novillo * Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index f5bd659fa34..3a7053e802e 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)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d54502a9aad..fc42f8b144d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-06-10 Jeff Law + + * gcc.c-torture/compile/20040610-1.c: New test. + 2004-06-11 Giovanni Bajo * g++.old-deja/g++.robertl/eb4.C: Adjust error markers. diff --git a/gcc/testsuite/gcc.c-torture/compile/20040610-1.c b/gcc/testsuite/gcc.c-torture/compile/20040610-1.c new file mode 100644 index 00000000000..37fb65ca2c1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20040610-1.c @@ -0,0 +1,5 @@ +int foo (float x) +{ + float i = __builtin_inff (); + return x != i; +}