gcse.c (simple_mem): Return false for floating-point accesses if flag_float_store...
authorRichard Sandiford <rsandifo@redhat.com>
Mon, 31 Mar 2003 06:28:56 +0000 (06:28 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 31 Mar 2003 06:28:56 +0000 (06:28 +0000)
* gcse.c (simple_mem): Return false for floating-point accesses
if flag_float_store is true.

From-SVN: r65076

gcc/ChangeLog
gcc/gcse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/20030331-1.c [new file with mode: 0644]

index 266e9c750ef032e67389f7a198456f5fb7c04e4c..ebb5b7ef41a5a49659908db1c40fcc56d83e649e 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-31  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcse.c (simple_mem): Return false for floating-point accesses
+       if flag_float_store is true.
+
 2003-03-30  Roger Sayle  <roger@eyesopen.com>
 
        * gcse.c (gcse_constant_p): New function to identify constants
index d41a11757bd681713e40d053c39e9918eac57e80..ae9d720c9c1d13a3447cc16836a0556321be7102 100644 (file)
@@ -6657,6 +6657,9 @@ simple_mem (x)
   if (GET_MODE (x) == BLKmode)
     return 0;
 
+  if (flag_float_store && FLOAT_MODE_P (GET_MODE (x)))
+    return 0;
+
   if (!rtx_varies_p (XEXP (x, 0), 0))
     return 1;
 
index 1eb28366e537b987f1f5728f9406f609c932f796..2469ea4ed73e9cd3f6b123b6fb721f860877155a 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-31  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.c-torture/execute/ieee/20030331-1.c: New test.
+
 2003-03-30  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/7647
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20030331-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/20030331-1.c
new file mode 100644 (file)
index 0000000..64d87e1
--- /dev/null
@@ -0,0 +1,32 @@
+extern void exit (int);
+extern void abort (void);
+float x = -1.5f;
+
+float
+rintf ()
+{
+  static const float TWO23 = 8388608.0;
+
+  if (__builtin_fabs (x) < TWO23)
+    {
+      if (x > 0.0)
+        {
+          x += TWO23;
+          x -= TWO23;
+        }
+      else if (x < 0.0)
+        {
+          x = TWO23 - x;
+          x = -(x - TWO23);
+        }
+    }
+
+  return x;
+}
+
+int main (void)
+{
+  if (rintf () != -2.0)
+    abort ();
+  exit (0);
+}