This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/6673: gcc-3.1 produces wrong assembly code
- From: jakub at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, namsh at kldp dot org, nobody at gcc dot gnu dot org
- Date: 16 May 2002 13:40:14 -0000
- Subject: Re: optimization/6673: gcc-3.1 produces wrong assembly code
- Reply-to: jakub at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, namsh at kldp dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: gcc-3.1 produces wrong assembly code
State-Changed-From-To: open->feedback
State-Changed-By: jakub
State-Changed-When: Thu May 16 06:40:11 2002
State-Changed-Why:
Why do you think this is wrong?
If there is no volatile, there is nothing which prevents
gcc e.g. with ++a; ++a; ++a to do all the additions at
once and store just the final result. Similarly with your
testcase, gcc does all additions together and stores the
end result after all infinity iterations. Since the loop
will never finish, gcc can as well optimize the final
store out.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6673