]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
real.c (asctoeg): Handle denormals in hexadecimal notation.
authorJakub Jelinek <jakub@redhat.com>
Tue, 18 Feb 2003 23:43:55 +0000 (00:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 18 Feb 2003 23:43:55 +0000 (00:43 +0100)
* real.c (asctoeg): Handle denormals in hexadecimal notation.

* gcc.dg/20030217-1.c: New test.

From-SVN: r63069

gcc/ChangeLog
gcc/real.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20030217-1.c [new file with mode: 0644]

index 5c68c15405755dbffd71929b2b0a79f479ddee0b..130ed83b3f7c6b941529ff883407f25f5e6ff1ea 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * real.c (asctoeg): Handle denormals in hexadecimal notation.
+
 2003-02-16 Arend Bayer <arend.bayer@web.de>
            Richard Henderson  <rth@redhat.com>
 
index 7b8879b87646c6681b38bbb7e210c634b9c9ad4f..1dcd5492344b069d4dcbf3bdb1a126c8a3e71e6a 100644 (file)
@@ -5417,7 +5417,12 @@ read_expnt:
       if (lexp > 0x7fff)
        goto infinite;
       if (lexp < 0)
-       goto zero;
+       {
+         if (lexp < -NBITS)
+           goto zero;
+         lost |= eshift (yy, lexp);
+         lexp = 0;
+       }
       yy[E] = lexp;
       goto expdon;
     }
index 3ad51e68dede46ad52f55c876a9ae14d23c1b461..50bfe987edf8113d26c32ba38e0b7ee56539833a 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/20030217-1.c: New test.
+
 2003-02-10  Eric Botcazou  <ebotcazou@libertysurf.fr>
             Christian Ehrhardt  <ehrhardt@mathematik.uni-ulm.de>
 
diff --git a/gcc/testsuite/gcc.dg/20030217-1.c b/gcc/testsuite/gcc.dg/20030217-1.c
new file mode 100644 (file)
index 0000000..d0cd913
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test whether denormal floating point constants in hexadecimal notation
+   are parsed correctly.  */
+/* { dg-do run { target i?86-*-linux* x86_64-*-* } } */
+/* { dg-options "-std=c99" } */
+
+long double d = 0x0.0000003ffffffff00000p-16357L;
+long double e = 0x0.0000003ffffffff00000p-16356L;
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+  if (d != e / 2.0)
+    abort ();
+  exit (0);
+}