From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30242 invoked by alias); 26 May 2002 17:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30203 invoked by uid 71); 26 May 2002 17:16:01 -0000 Resent-Date: 26 May 2002 17:16:01 -0000 Resent-Message-ID: <20020526171601.30202.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Oskar Liljeblad Received:(qmail 27620 invoked by uid 61); 26 May 2002 17:07:46 -0000 Message-Id:<20020526170746.27618.qmail@sources.redhat.com> Date: Sun, 26 May 2002 11:26:00 -0000 From: Oskar Liljeblad Reply-To: Oskar Liljeblad To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: java/6820: miscompilation of (a,++a) as arguments to final method X-SW-Source: 2002-05/txt/msg00836.txt.bz2 List-Id: >Number: 6820 >Category: java >Synopsis: miscompilation of (a,++a) as arguments to final method >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun May 26 10:16:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Oskar Liljeblad >Release: 3.1 >Organization: >Environment: Linux/x86 >Description: (Let's hope this is not a dupe...) See the code below. With Demo compiled with gcj from source to x86 machine code, the output is "a=11 b=11". The output is correctly "a=10 b=11" when: * compiling and running with Sun JDK 1.4 javac. * compiling from source to .class and interpreting with gij. * compiling from source to .class, and .class to machine code with gcj. Note that this bug only happens when calling methods that are final (or in final classes). Oskar Liljeblad (oskar@osk.mine.nu) >How-To-Repeat: class Demo { public static void main(String[] args) { Dummy d = new Dummy(); int a = 10; d.m(a,++a); } } final class Dummy { public void m(int a, int b) { System.out.println("a="+a+" b="+b); } } >Fix: >Release-Note: >Audit-Trail: >Unformatted: