Article View: gnu.gcc.help
Article #41540Re: gcc fails Paranoia (numeric) test under Linux
From: carlos fonseca
Date: Tue, 19 Mar 1996 00:00
Date: Tue, 19 Mar 1996 00:00
47 lines
2612 bytes
2612 bytes
Dean Schulze (schulze@lpl.arizona.edu) wrote:
: The evidence against gcc 2.7.2 under Linux continues to mount. I would
: appreciate it if some of you can try this test on your Linux machines.
: I compiled the paranoia test program (netlib.att.com, netlib/paranoia)
: both with and without optimization using gcc 2.7.2 on Linux 1.2.13.
: With optimization off paranoia detected a flaw in the arithmetic
: rounding mode (perhaps controlled by a compiler switch). This is not
: considered a serious flaw, and paranoia pronounced the arithmetic to
: be OK. However, when I compiled with -O2 paranoia found some serious
: flaws and hung before completing the test.
Linux defaults to use "extended" precision, which is better than "double",
but paranoia doesn't seem to know about this. You can set the rounding
mode to double with a function whose prototype is defined in fpu_control.h
No flaw anymore.
As for the optimization switch, from the gcc manpage
-ffloat-store
Do not store floating point variables in registers.
This prevents undesirable excess precision on machines
such as the 68000 where the floating registers (of the
68881) keep more precision than a double is supposed to
have.
For most programs, the excess precision does only good,
but a few programs rely on the precise definition of
IEEE floating point. Use `-ffloat-store' for such pro-
grams.
Paranoia seems to be one of those programs.
: I compiled paranoia on the same machine using Visual C++ under
: Windows 95 both with and without optimization and in both cases
: paranoia found no problems and pronounced the arithmetic to be perfect.
: This doesn't prove that my hardware works correctly in all cases, but
: it does show that gcc's optimization is seriously flawed.
See above.
Carlos
--
Carlos Fonseca
C.Fonseca@shef.ac.uk
Technical Details
Message-ID:
<4im1dh$quf@bignews.shef.ac.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4hn916$ejs@news.ccit.arizona.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,fbe8ee8d82a9766b X-Google-Attributes: gid11318c,public X-Google-Thread: 1103af,fbe8ee8d82a9766b X-Google-Attributes: gid1103af,public From: fonseca@acse.shef.ac.uk (carlos fonseca) Subject: Re: gcc fails Paranoia (numeric) test under Linux Date: 1996/03/19 Message-ID: <4im1dh$quf@bignews.shef.ac.uk> X-Deja-AN: 143105747 distribution: world references: <4hn916$ejs@news.ccit.arizona.edu> followup-to: gnu.gcc.help,comp.os.linux.misc organization: University of Sheffield, UK reply-to: C.Fonseca@shef.ac.uk newsgroups: gnu.gcc.help,comp.os.linux.misc