Bug 41901 - gcj -C -ftarget 1.1 produces bytecode that doesn't work in JDK 1.1
Summary: gcj -C -ftarget 1.1 produces bytecode that doesn't work in JDK 1.1
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2009-11-02 00:54 UTC by Benjamin Schwartz
Modified: 2016-09-30 22:49 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schwartz 2009-11-02 00:54:22 UTC
gcj -C -ftarget 1.1 produces output that doesn't work in Sun JDK 1.1.8, as tested under Wine.  The problem is that the bytecode produced for a synchronized() block is not accepted by the VM.  Upon encountering this bytecode, the VM either (1) prints "nonfatal internal JIT (3.00.078(x)) error 'chgTarg: Conditional' has occurred ... Interpreting method" or (2) fails to synchronize correctly and instead throws java.lang.IllegalMonitorStateException in an infinite loop.

While this is clearly not ideal behavior for the VM, this VM defines the 1.1 target, so -ftarget 1.1 should produce bytecode that actually works.

Sun introduced a similar bug into their javac starting in JDK 1.4, and has failed to fix it, leaving no good way to produce backwards-compatible bytecode. See:

Comment 1 Andrew Pinski 2016-09-30 22:49:51 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.