This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: java/8204: gcj -O2 to native reorders certain instructions improperly.
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, java-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rsdio at metastatic dot org
- Date: 22 Mar 2003 18:09:52 -0000
- Subject: Re: java/8204: gcj -O2 to native reorders certain instructions improperly.
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, java-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rsdio at metastatic dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: gcj -O2 to native reorders certain instructions improperly.
State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Sat Mar 22 18:09:51 2003
State-Changed-Why:
In your code, you are modifying i twice in the same line:
(f(s.charAt(i++)) << 4) | (f(s.charAt(i++))))
I don't know enough about Java, but in C/C++ this will invoke
undefined behavior, since the standard doesn't prescribe
which of the two function calls happen first, and with
which value of i. Is this different in Java, i.e. does
the Java standard give guarantees as to the order in which
the sub-statements are executed?
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8204