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
This commit is contained in:
Jeff Law 2004-06-10 21:22:30 -06:00 committed by Jeff Law
parent da291c8763
commit 3100d64725
4 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-06-10 Jeff Law <law@redhat.com>
* fold-const.c (fold_inf_compare): Avoid creating non-gimple
code when we are in gimple form.
2004-06-10 Diego Novillo <dnovillo@redhat.com>
* Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H.

View File

@ -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));

View File

@ -1,3 +1,7 @@
2004-06-10 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/20040610-1.c: New test.
2004-06-11 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* g++.old-deja/g++.robertl/eb4.C: Adjust error markers.

View File

@ -0,0 +1,5 @@
int foo (float x)
{
float i = __builtin_inff ();
return x != i;
}