This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: java/8204: gcj -O2 to native reorders certain instructions improperly.
- From: Tom Tromey <tromey at redhat dot com>
- To: bangerth at dealii dot org
- Cc: 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
- Date: 25 Mar 2003 15:36:42 -0700
- Subject: Re: java/8204: gcj -O2 to native reorders certain instructions improperly.
- References: <20030322180952.12405.qmail@sources.redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> ">" == bangerth <bangerth at dealii dot org> writes:
>> (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?
Yes, Java specifies left-to-right evaluation in this situation.
Chances are that this bug is fixed, but I haven't tried it.
Tom