From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2636 invoked by alias); 2 Mar 2002 18:46:05 -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 2602 invoked by uid 71); 2 Mar 2002 18:46:04 -0000 Date: Sat, 02 Mar 2002 10:46:00 -0000 Message-ID: <20020302184604.2601.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: Re: java/5812: GCJ 3.0.2 segfaults on class file from Sun JDK 1.3 compiler Reply-To: Tom Tromey X-SW-Source: 2002-03/txt/msg00034.txt.bz2 List-Id: The following reply was made to PR java/5812; it has been noted by GNATS. From: Tom Tromey To: adam@medovina.org Cc: gcc-gnats@gcc.gnu.org, Per Bothner Subject: Re: java/5812: GCJ 3.0.2 segfaults on class file from Sun JDK 1.3 compiler Date: 02 Mar 2002 12:10:11 -0700 >>>>> "Adam" == Adam Dingle writes: Adam> When I compile the class definition below with the Sun JDK 1.3 Adam> compiler and then feed the class file to GCJ 3.0.2, GCJ Adam> segfaults. I've included the .class file as an attachment. First, I agree that gcj should not crash. That is a bug. However, this is unusual bytecode. Here it is: 0: jsr 12 3: goto 15 6: astore_1 7: jsr 12 10: aload_1 11: athrow 12: astore_2 13: iconst_1 14: ireturn 15: return It isn't clear to me whether this should verify. The `return' at PC=15 is invalid, since the method signature is ()I. Ordinarily this would be a verification error. However, given that Sun's compiler generated this, perhaps they intend that we only verify reachable code. In this case, the `return' is not reachable since there is no `ret' corresponding to the `jsr'. Per, what do you think about this? I do think it is bogus that Sun's compiler does this. For this source we generate the aesthetically pleasing: 0: iconst_1 1: ireturn Tom