From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30842 invoked by alias); 14 Oct 2002 06:36: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 30812 invoked by uid 71); 14 Oct 2002 06:36:02 -0000 Resent-Date: 14 Oct 2002 06:36:02 -0000 Resent-Message-ID: <20021014063602.30811.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) 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, green@redhat.com Received: (qmail 27811 invoked from network); 14 Oct 2002 06:27:28 -0000 Received: from unknown (HELO mx2.redhat.com) (12.150.115.133) by sources.redhat.com with SMTP; 14 Oct 2002 06:27:28 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.11.6/8.11.6) with ESMTP id g9E6Qps03874 for ; Mon, 14 Oct 2002 02:26:51 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9E6RRl01297 for ; Mon, 14 Oct 2002 02:27:28 -0400 Received: from louie.sfbay.redhat.com (louie.sfbay.redhat.com [192.168.28.4]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g9E6RRv15981 for ; Sun, 13 Oct 2002 23:27:27 -0700 Received: (green@localhost) by louie.sfbay.redhat.com (8.11.6/8.6.4) id g9E6RMM03375; Sun, 13 Oct 2002 23:27:22 -0700 Message-Id: <200210140627.g9E6RMM03375@louie.sfbay.redhat.com> Date: Sun, 13 Oct 2002 23:36:00 -0000 From: green@redhat.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: java/8219: gcj order of argument evaluation problem X-SW-Source: 2002-10/txt/msg00536.txt.bz2 List-Id: >Number: 8219 >Category: java >Synopsis: gcj order of argument evaluation problem >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Oct 13 23:36:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: >Release: 3.3 20021005 (experimental) >Organization: >Environment: System: Linux louie 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /home/green/FSF/GCC/HEAD/gcc/configure --prefix=/louie/green/latest/i --enable-languages=c,c++,java : (reconfigured) >Description: Here's a bug in how gcj evaluates method arguments.... public class bug { private static int first (int x, int y) { return x; } public static void main (String[] args) { int l = args.length; /* This should print: 0 0 1 */ System.out.println (l); System.out.println (first (l, ++l)); System.out.println (l); } } This is correct output... [green@build green]$ gcj -o bug --main=bug bug.java -O0 [green@build green]$ ./bug 0 0 1 This is bad output... [green@build green]$ gcj -o bug --main=bug bug.java -O2 [green@build green]$ ./bug 0 1 1 Is looks as though the rtl we're generating is bad from the start - so it's unlikely to be a problem with any on the rtl-based optimizations. >How-To-Repeat: See above. >Fix: >Release-Note: >Audit-Trail: >Unformatted: