PATCH: HUGE_VAL should be Infinity

John David Anglin
Tue Oct 17 21:19:00 GMT 2000

>   > After thinking about this overnight, I beieve the hugeval.c test should be
>   > changed because the second half is not a compiler test.  It checks whether
>   > the definition of HUGE_VAL is +Infinity.  The linux math.h header states
>   > that HUGE_VAL is +Infinity on all IEEE754 machines.  However, this appears
>   > not to be the case.  In any case, systems predating the standard or without
>   > ieee floating point will fail the hugeval test.  Since I don't think
>   > compiler tests should fail when there is nothing wrong with the compiler,
>   > I will try to come up with a test fix.
> Another option (if fixing hugeval.c is a pain) is to move hugeval.c into the
> ieee directory which makes it clearer that it depends on ieee754 arithmetic.
> jeff

That's where it is already.  I spent time on it because hppa hardware
nominally has an ieee compatible floating unit.  Previously, most of the
ieee tests failed under hpux 10.20.  The unordered compare patch that I
sent the other day fixes the compare tests.  The mzero2 tests fail because
negation of +0. yields +0.  This apparently violates the above ieee standard.
However, it could be a difference in opinion between HP and Intel on the
standard as even relatively recent HP gear still exhibits the same problem.

Take a look at the patch for hugeval.c which I sent.  It still does the same
tests on ieee754 machines and doesn't fail under hpux 10.20.

It would be nice if the ieee tests didn't run on non ieee machines.

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

More information about the Gcc-patches mailing list