real.c (asctoeg): Handle denormals in hexadecimal notation.

* real.c (asctoeg): Handle denormals in hexadecimal notation.

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

From-SVN: r63069
This commit is contained in:
Jakub Jelinek 2003-02-19 00:43:55 +01:00 committed by Jakub Jelinek
parent 7db028d8e1
commit b74899f7f3
4 changed files with 32 additions and 1 deletions

View 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>

View 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;
}

View 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>

View File

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