From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20579 invoked by alias); 15 Jul 2004 06:05:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20510 invoked by uid 48); 15 Jul 2004 06:05:48 -0000 Date: Thu, 15 Jul 2004 06:05:00 -0000 Message-ID: <20040715060548.20509.qmail@sourceware.org> From: "rmathew at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20020130042601.5537.daniel.bonniot@inria.fr> References: <20020130042601.5537.daniel.bonniot@inria.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/5537] Error compiling simple bytecode with jsr X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg01824.txt.bz2 List-Id: ------- Additional Comments From rmathew at gcc dot gnu dot org 2004-07-15 06:05 ------- The problem is that for the instruction following a jsr, we need to merge the type state just before the jsr with the modified type state from the ret of the subroutine that the jsr calls - we were not keeping track of the type state before the jsr at all, leading to this bug. I have a very simple patch that fixes this bug, but it unfortunately reveals other problems in the verifier, some of which cause libjava testsuite failures. I'll submit a full patch if I'm able to resolve these. Here is the simple patch that cures the bug exposed by this PR as against the current mainline: Index: verify.c =================================================================== --- verify.c 2004-07-15 11:19:53.000000000 +0530 +++ verify.c 2004-07-15 11:21:41.000000000 +0530 @@ -1346,6 +1346,10 @@ verify_jvm_instructions (JCF* jcf, const { tree target = lookup_label (oldpc + IMMEDIATE_s2); tree return_label = lookup_label (PC); + if (LABEL_TYPE_STATE (return_label) == NULL_TREE) + { + merge_type_state (return_label); + } PUSH_TYPE (return_address_type_node); /* The return label chain will be null if this is the first time we've seen this jsr target. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5537