This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java/6820: miscompilation of (a,++a) as arguments to final method


The following reply was made to PR java/6820; it has been noted by GNATS.

From: Bryce McKinlay <bryce@waitaki.otago.ac.nz>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: java/6820: miscompilation of (a,++a) as arguments to final method
Date: Mon, 27 May 2002 17:53:33 +1200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6820
 
 I checked in a similar test case to the testsuite:
 
 public class PR6820
 {
   static void m(int a, int b) {
     System.out.println("a="+a+" b="+b);
   }
 
   static int a = 10;
 
   public static void main(String[] args) {
     int b = 10;
     m(a,++a);
     m(b,++b);
   }
 }
 
 This appears to be a problem with the (deprecated) RTL inliner which is 
 still used by gcj. When a call is inlined, the Java evalutation order 
 for the arguments (set by force_evaluation_order() in java/expr.c) seems 
 to get lost.
 
 Workaround is to compile with -O2 -fno-inline
 
 Solution may be to switch gcj to use the AST inliner.
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]