OSDN Git Service

* fold-const.c (fold_inf_compare): Avoid creating non-gimple
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jun 2004 03:22:30 +0000 (03:22 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jun 2004 03:22:30 +0000 (03:22 +0000)
        code when we are in gimple form.

        * gcc.c-torture/compile/20040610-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82958 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20040610-1.c [new file with mode: 0644]

index 5c44fc3..ca94a49 100644 (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.
index f5bd659..3a7053e 100644 (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));
index d54502a..fc42f8b 100644 (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.
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 (file)
index 0000000..37fb65c
--- /dev/null
@@ -0,0 +1,5 @@
+int foo (float x)
+{
+        float i = __builtin_inff ();
+        return x != i;
+}