+2005-07-29 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/21720
+ * real.c (real_from_string): Set last bit if there is a nonzero
+ hex digit beyond GCC's internal precision.
+
2005-07-28 Richard Henderson <rth@redhat.com>
PR rtl-opt/22619
|= (unsigned long) d << (pos % HOST_BITS_PER_LONG);
pos -= 4;
}
+ else if (d)
+ /* Ensure correct rounding by setting last bit if there is
+ a subsequent nonzero digit. */
+ r->sig[0] |= 1;
exp += 4;
str++;
}
+2005-07-29 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/21720
+ * gcc.dg/hex-round-1.c: New test.
+
2005-07-28 Jan Hubicka <jh@suse.cz>
* inliner-1.c: Do not dump everything.
--- /dev/null
+/* Test for hexadecimal float rounding: bug 21720. */
+/* { dg-do link } */
+/* { dg-options "-O -std=gnu99" } */
+
+#include <float.h>
+
+extern void link_failure (void);
+
+int
+main (void)
+{
+#if FLT_RADIX == 2 && FLT_MANT_DIG == 24
+ if (0x1.000001000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+#endif
+ return 0;
+}