From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Eli Zaretskii Cc: jimb@cygnus.com, gdb-patches@sources.redhat.com, msnyder@cygnus.com Subject: Re: RFA: don't try to compare IEEE NaN's Date: Wed, 06 Jun 2001 06:54:00 -0000 Message-id: <3B1E3540.F8F5B11A@redhat.com> References: <20010606034145.7D5065E9CB@zwingli.cygnus.com> <200106060615.JAA14470@is.elta.co.il> X-SW-Source: 2001-06/msg00058.html Eli Zaretskii wrote: > > > From: Jim Blandy > > Date: Tue, 5 Jun 2001 22:41:45 -0500 (EST) > > > > ! testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */ > > ! float_resultval = float_func (); > > ! testval.double_testval = 3.14159265358979323846; /* float_checkpoint */ > > ! double_resultval = double_func (); > > I think it is better to initialize the integral members of the union > with an explicit bit pattern, just not a pattern which gets > interpreted as a NaN of an Inf. With initialization such as above, > you risk losing due to subtleties of compile-time conversion of a > literal constant to a floating-point value. This is a GDB test suite, > so we are not interested in testing the compiler. This is a good point. But we will need a different bit pattern for float and double. On the other hand, this way we test that the constants are being converted correctly :-) (yes, I know this is not the objective of the test). Note that we already use constant literals everywhere. A recent patch (well, not so recent) fixed the value of one of those so it would not be truncated (and so result in a different internal value). Anyway, the thing is so broken now that we cannot just leave as it is. Suggestion (with patches) for an improvement to this test are welcome. Cheers, Fernando -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9