Bug 17488

Summary: Binary compatibility: must ensure static method's class remains live
Product: gcc Reporter: Tom Tromey <tromey>
Component: javaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED WONTFIX    
Severity: normal CC: gcc-bugs, java-prs
Priority: P2    
Version: 4.0.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2004-12-14 00:35:34
Bug Depends on:    
Bug Blocks: 12725    

Description Tom Tromey 2004-09-14 22:12:57 UTC
At the moment, a reference to a static method won't cause the
method's class to be considered as live.  This can lead to
incorrect collection of the class.  The fix is to somehow
arrange for this class to be marked.

For static fields this is handled because we emit explicit
_Jv_InitClass calls for the field's class; the class reference
ends up in the constant pool and is marked there.

One potential fix would be to move class initialization calls
for static methods to the caller (they are now in the callee).
This might be difficult (there are many calls from C++, for instance).
Comment 1 Andrew Pinski 2016-09-30 22:50:05 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.