[BUG][GCC] *Serious* optimization bug: Any gcc specialists out there?

Stephan Rudlof sr at evolgo.de
Fri Aug 4 14:31:32 UTC 2000


Dear Squeakers,

please compile

/* -------------------------------------------- */
#include <stdio.h>
#include <math.h>

testDoubles () {
  double arg1 = 1.0e20;
  printf("\nsin(arg1): %e", sin(arg1));
}

int main() { testDoubles(); return 0; }
/* -------------------------------------------- */

with
	gcc -O testDoubles.c -lm
and without optimization:
	gcc testDoubles.c -lm
;
the result strongly differs! (the optimized version gives the *wrong*
result)

At least for:
sr at Klaus:~/tmp > gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
.

This problem *seriously* affects Squeak, because this problem arises in
interp.c (e.g. in primitiveSine()) and gcc is widely used.
This makes me *really* nervous! (therefore so much CCs)


Is there anyone who follows the corresponding gcc mailing lists or
newsgroups and has some comments?
Or could post a bug report (after confirmation of this bug)?
Or has a newer gcc without this problem?


Greetings,

Stephan

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list