This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- From: Richard Henderson <rth at redhat dot com>
- To: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- Cc: Fergus Henderson <fjh at cs dot mu dot oz dot au>, Manfred Hollstein <manfredh at redhat dot com>, Richard dot Earnshaw at arm dot com, gcc-patches at gcc dot gnu dot org, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Mon, 23 Sep 2002 17:23:07 -0400
- Subject: Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- References: <E04CF3F88ACBD5119EFE00508BBB2121048C4F87@exch-01.noida.hcltech.com>
On Mon, Sep 23, 2002 at 07:48:00PM +0530, D.Venkatasubramanian, Noida wrote:
> The other solution,
> if (sizeof(long double) <= 4 && ((unsigned char)-1) == 255)
> exit (0);
>
> would again make it specific, something we are trying to avoid, isn't it ;-)
The correct solution is
#include <float.h>
if (LDBL_EPSILON > 0x1p-31L)
return 0;
since we look at 32 bits of the significand.
r~