This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/11533] New: Inlining drops static initialization of inner class
- From: "jsturm at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2003 23:47:22 -0000
- Subject: [Bug java/11533] New: Inlining drops static initialization of inner class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11533
Summary: Inlining drops static initialization of inner class
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jsturm at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
Compile/run the following with -O3. Note this is broken in 3.3 also; I haven't
tested earlier versions.
public class Log {
private static class Singleton {static final Log __instance = new Log();}
public static Log instance() {
return Singleton.__instance;
}
public String toString() {
return "Log";
}
public static void main(String[] args) {
System.out.println(Log.instance());
}
}