This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/6898: gcc produces incorrect minimization code
- From: reichelt at igpm dot rwth-aachen dot de
- To: 40189 at bugs dot debian dot org, camm at enhanced dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 22 Nov 2002 16:47:01 -0000
- Subject: Re: c/6898: gcc produces incorrect minimization code
- Reply-to: reichelt at igpm dot rwth-aachen dot de, 40189 at bugs dot debian dot org, camm at enhanced dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: gcc produces incorrect minimization code
State-Changed-From-To: open->closed
State-Changed-By: reichelt
State-Changed-When: Fri Nov 22 08:47:00 2002
State-Changed-Why:
Not a bug.
Whether you get ir=0 or ir=3 is just a matter when rounding will take place.
Since the code is rearranged in optimization steps, you'll get varying
results with different architectures and optimization options. Similar
but not identical code might also lead to different results.
Welcome to the world of floating point arithmetic.
BTW, declaring t and amin as "volatile double" leads to your "expected"
result even for -O0.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6898