From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13424 invoked by alias); 5 Mar 2002 19:36:01 -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 13402 invoked by uid 71); 5 Mar 2002 19:36:01 -0000 Date: Tue, 05 Mar 2002 11:36:00 -0000 Message-ID: <20020305193601.13401.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Per Bothner Subject: Re: java/5812: GCJ 3.0.2 segfaults on class file from Sun JDK 1.3 compiler Reply-To: Per Bothner X-SW-Source: 2002-03/txt/msg00164.txt.bz2 List-Id: The following reply was made to PR java/5812; it has been noted by GNATS. From: Per Bothner To: tromey@redhat.com Cc: adam@medovina.org, gcc-gnats@gcc.gnu.org Subject: Re: java/5812: GCJ 3.0.2 segfaults on class file from Sun JDK 1.3 compiler Date: Tue, 05 Mar 2002 11:34:36 -0800 This is a multi-part message in MIME format. --------------090401000906060607030103 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit With this patch I get the expected output: eureka<3517>/home/bothner/GNU/linux-gcc/gcc/jc1 Bug.class -o Bug.s -quiet Bug.java: In class `Bug': Bug.java: In method `Bug.invoke()': Bug.java:4: warning: unreachable bytecode from 3 to before 6 Bug.java:7: warning: unreachable bytecode from 10 to before 12 Bug.java:9: warning: unreachable bytecode from 15 to the end of the method -- --Per Bothner per@bothner.com http://www.bothner.com/per/ --------------090401000906060607030103 Content-Type: text/plain; name="expr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="expr.patch" Index: expr.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v retrieving revision 1.134 diff -u -p -r1.134 expr.c --- expr.c 2002/02/28 23:27:09 1.134 +++ expr.c 2002/03/05 19:32:15 @@ -48,7 +48,7 @@ static tree pop_value PARAMS ((tree)); static void java_stack_swap PARAMS ((void)); static void java_stack_dup PARAMS ((int, int)); static void build_java_athrow PARAMS ((tree)); -static void build_java_jsr PARAMS ((tree, tree)); +static void build_java_jsr PARAMS ((int, int)); static void build_java_ret PARAMS ((tree)); static void expand_java_multianewarray PARAMS ((tree, int)); static void expand_java_arraystore PARAMS ((tree)); @@ -607,15 +607,18 @@ build_java_athrow (node) /* Implementation for jsr/ret */ static void -build_java_jsr (where, ret) - tree where; - tree ret; +build_java_jsr (target_pc, return_pc) + int target_pc, return_pc; { + tree where = lookup_label (target_pc); + tree ret = lookup_label (return_pc); tree ret_label = fold (build1 (ADDR_EXPR, return_address_type_node, ret)); push_value (ret_label); flush_quick_stack (); emit_jump (label_rtx (where)); expand_label (ret); + if (instruction_bits [return_pc] & BCODE_VERIFIED) + load_type_state (ret); } static void @@ -2972,13 +2975,8 @@ process_jvm_instruction (PC, byte_ops, l build_java_ret (find_local_variable (index, ptr_type_node, oldpc)); \ } -#define JSR(OPERAND_TYPE, OPERAND_VALUE) \ - { \ - tree where = lookup_label (oldpc+OPERAND_VALUE); \ - tree ret = lookup_label (PC); \ - build_java_jsr (where, ret); \ - load_type_state (ret); \ - } +#define JSR(OPERAND_TYPE, OPERAND_VALUE) \ + build_java_jsr (oldpc+OPERAND_VALUE, PC); /* Push a constant onto the stack. */ #define PUSHC(OPERAND_TYPE, OPERAND_VALUE) \ --------------090401000906060607030103--