[Bug java/16930] New: array store is optimized away

fw at deneb dot enyo dot de gcc-bugzilla@gcc.gnu.org
Mon Aug 9 10:00:00 GMT 2004


The following code prints "not okay" at optimization level -O1 and above:

public class ArrayReturnBug {
    static String[] createArray() {
        return new String[] { "Hi!" };
    }

    public static void main (String[] argv) {
        String[] array = createArray();
        if (array[0] != null) {
            System.out.println("okay");
        } else {
            System.out.println("not okay");
        }
    }
}

The array store is removed during the cddce pass.

-- 
           Summary: array store is optimized away
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fw at deneb dot enyo dot de
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



More information about the Java-prs mailing list