On 14 Mar 2003 at 9:03, Jan Kardell wrote:
I've run into a code generation bug with GPC 2.1. When I use optimization -O2, a calculation uses an uninitialized register. With -O1 the generated code looks very different, and it works.
Compiler: Binary distribution of gpc 2.1....
With this compiler (i486-pc-mingw32):
gpc version 20021128, based on gcc-3.2.1 (MinGW special 20021202-2)
I get:
$99: agc= 3.999 (this value should be 3.999) $00: agc= 9.998 (this value should be 9.998) $FF: agc= 0.000 (this value should be 0.000)
...with either -O0, -O1, or -O2. This is from a newer GPC, a different platform, and probably a newer version of GCC. Still, for this combination, your program works.
-- Dave