From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27799 invoked by alias); 9 Feb 2005 03:20:58 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 27779 invoked by uid 48); 9 Feb 2005 03:20:57 -0000 Date: Wed, 09 Feb 2005 07:20:00 -0000 From: "mckinlay at redhat dot com" To: java-prs@gcc.gnu.org Message-ID: <20050209032054.19834.mckinlay@redhat.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/19834] New: Eclipse bytecode miscompiled with -O --indirect-dispatch X-Bugzilla-Reason: CC X-SW-Source: 2005-q1/txt/msg00289.txt.bz2 List-Id: The following test case gets miscompiled from bytecode with "-O --indirect-dispatch". It doesn't appear to matter which compiler produced the bytecode - the same error occurs with all of them. import java.util.*; public class Test { static int i = 0; static int get() { return i++; } public static void main(String[] args) throws Exception { ArrayList headerElements = new ArrayList(); while (true) { headerElements.add(""); if (get() == 13) break; } int size = headerElements.size(); if (size == 0) return; System.out.println(size); System.out.println(headerElements.size()); } } $ gcj Test.java -O --indirect-dispatch --main=Test $ ./a.out 14 14 $ gcj -C Test.java; gcj Test.class -O --indirect-dispatch --main=Test $ ./a.out 1 14 -- Summary: Eclipse bytecode miscompiled with -O --indirect-dispatch Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: wrong-code 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=19834