This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/11533] New: Inlining drops static initialization of inner class


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());
  }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]