This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7175: Calculation yields different results for versionoptimized with -O2
- From: Michael Veksler <veksler at il dot ibm dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, weber at informatik dot uni-kl dot de
- Date: Sat, 10 Aug 2002 06:29:05 +0300
- Subject: Re: optimization/7175: Calculation yields different results for versionoptimized with -O2
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7175
The moment you will add at the beginning of your main():
fpu_control_t fpu_bits;
_FPU_GETCW(fpu_bits);
fpu_bits &= ~_FPU_EXTENDED;
fpu_bits |= _FPU_DOUBLE;
_FPU_SETCW(fpu_bits);
Assuming you init "res" to zeros, you are goint to get a consistent
result.
This probably means that this PR is basically the same as PR/6914.