[Bug java/15576] New: Class initialization optimization is disabled

mckinlay at redhat dot com gcc-bugzilla@gcc.gnu.org
Fri May 21 21:13:00 GMT 2004


gcj used to perform an optimization which eliminated redundant class
initialization calls. For example, given the following example,
_Jv_InitClass(Foo) is called twice from Init.a() when it is only needed once:

class Foo 
{
  static int a;
  static int b;
}

public class Init
{
  int a()
  { 
    return Foo.a + Foo.b;
  }
}

This was done in expr.c build_class_init(), look for
LOCAL_CLASS_INITIALIZATION_FLAG. The optimization was turned off in tree-ssa
branch and needs to be updated to work with the gimplifier.

-- 
           Summary: Class initialization optimization is disabled
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576



More information about the Java-prs mailing list