Hello
Great oops for me: I just found out, that GCJ (3.4.0), using
with "-O" optimizes away something like
...
public synchronized void increment() {
value++;
}
I assume the optimizer thinks "value++" is just an unused value
and does not respect that this also changes the value of value.
If I add a System.out after value++ like
public ...
{
value++;
System.out( "value of value: " + value );
}
or change value++ into value = value + 1 everything wroks well.
I was kind of surprised :-)
Am I expecting something totally silly, shouldn't one ever use
optimization? What is your experience with GCJ and optimization?
Best regards,
Tom