optimization/6673: gcc-3.1 produces wrong assembly code

jakub@gcc.gnu.org jakub@gcc.gnu.org
Thu May 16 06:40:00 GMT 2002


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



More information about the Gcc-bugs mailing list