Tom Lane wrote:
> Darcy Buskermolen <darcy@wavefire.com> writes:
>
>>I can confirm this behavior on Solaris 8/sparc 64 as well.
>
>
>>bash-2.03$ gcc -m64 -O2 test.c
>>bash-2.03$ ./a.out
>>x = 12.3
>>y = 2.51673e-42
>>bash-2.03$ gcc -m64 -O3 test.c
>>bash-2.03$ ./a.out
>>x = 12.3
>>y = 12.3
>>bash-2.03$
>
>
> Hmm. I hadn't bothered to try -O3 ... interesting that it works
> correctly again at that level.
-O3 works on my box too
>
> Anyway, this proves that it is an upstream gcc bug and not something
> OpenBSD broke.
I just tried on solaris9 with gcc 3.4.2 - seems the bug is fixed in this version. Unfortunably it is quite problematic
tochange the compiler
at least on OpenBSD gcc 3.3.2 is quite heavily modified on that platform
and switching the base system compiler might screw a boatload of other
tools.
The actual recommendation I got from the OpenBSD-folks was to add
"-mfaster-structs" to the compiler flags with seems to work around the
issue - I'm currently doing a full build to verify that though ...
Stefan