From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 Description of problem: This bug emerged in the R language and environment for statistical computing ( http://www.r-project.org ) when compiled on RH 9. R has uses a special value to denote "missing values" in statistical computations - NA (not available) - which is distinct from NaN. When compiled under Red Hat 9, this distinction is lost. Consequently the build fails to pass "make check-all". The essential code has been abstracted to a small demonstration program which is attached. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: gcc -O1 RNAcheck.c ./a.out Actual Results: Program prints "1" Expected Results: Program prints "0" Additional info: A workaround, which has been incorporated into the upcoming release of R, is to declare ieee_double to be volatile. For some reason, the bug is not triggered when the "-pedantic" flag is used in compilation.
Created attachment 90947 [details] Example C program to reproduce bug.
Well, you could as well use the workaround which is there for gcc 3.x on SPARC, ie. define CONST to nothing. The problem is that all GCCs < 3.3 only handle one default NaN in real.c, so if some optimization decides to make the constant go through real.c routines the exact NaN value is lost. This is fixed in gcc 3.3 and above, as real.c has been rewritten there, but backporting it would be too risky, the changes touched a lot of code.