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
Status: RESOLVED WONTFIX
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
URL:
Keywords:
Depends on:
Blocks:
 
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:


Attachments

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:

http://forums.sun.com/thread.jspa?threadID=196703&forumID=37
http://lists.apple.com/archives/Java-dev/2002/Jun/msg00977.html
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4017866
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.