From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29531 invoked by alias); 31 Jul 2007 16:26:23 -0000 Received: (qmail 29506 invoked by uid 22791); 31 Jul 2007 16:26:17 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Jul 2007 16:26:12 +0000 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.13.7/8.13.7) with ESMTP id l6VGQ9M1000175 for ; Tue, 31 Jul 2007 12:26:09 -0400 (EDT) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.13.7/8.13.7/Submit) id l6VGFesY029802 for gcc-patches@gcc.gnu.org; Tue, 31 Jul 2007 12:15:40 -0400 (EDT) Message-Id: <200707311615.l6VGFesY029802@hiauly1.hia.nrc.ca> Subject: [patch committed] Fix PR target/32847 -- ICE in find_reloads To: gcc-patches@gcc.gnu.org Date: Tue, 31 Jul 2007 16:44:00 -0000 From: "John David Anglin" X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02190.txt.bz2 After the dataflow merge, tmpdir-g++.dg-struct-layout-1/t028 cp_compat_y_tst.o started to fail with an ICE in find_reloads. Using match_scratch resolves this problem. The assembler code should be the same as before except for casesi32p where the constraint register has been been changed from 'a' to 'r' (i.e., any general register). I believe that the 'a' constaint was a remnant of an attempt to place the jump table in readonly data. In any case, this restriction isn't needed for the current assembler code. Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Committed to trunk. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2007-07-31 John David Anglin PR target/32847 * pa.md (casesi32): Use match_scratch. Revise insn condition. (casesi32p, casesi64p): Likewise. (casesi): Adjust for above. Index: config/pa/pa.md =================================================================== --- config/pa/pa.md (revision 127022) +++ config/pa/pa.md (working copy) @@ -7626,27 +7626,11 @@ if (TARGET_BIG_SWITCH) { if (TARGET_64BIT) - { - rtx tmp1 = gen_reg_rtx (DImode); - rtx tmp2 = gen_reg_rtx (DImode); - - emit_jump_insn (gen_casesi64p (operands[0], operands[3], - tmp1, tmp2)); - } + emit_jump_insn (gen_casesi64p (operands[0], operands[3])); + else if (flag_pic) + emit_jump_insn (gen_casesi32p (operands[0], operands[3])); else - { - rtx tmp1 = gen_reg_rtx (SImode); - - if (flag_pic) - { - rtx tmp2 = gen_reg_rtx (SImode); - - emit_jump_insn (gen_casesi32p (operands[0], operands[3], - tmp1, tmp2)); - } - else - emit_jump_insn (gen_casesi32 (operands[0], operands[3], tmp1)); - } + emit_jump_insn (gen_casesi32 (operands[0], operands[3])); } else emit_jump_insn (gen_casesi0 (operands[0], operands[3])); @@ -7673,8 +7657,8 @@ (mult:SI (match_operand:SI 0 "register_operand" "r") (const_int 4)) (label_ref (match_operand 1 "" ""))))) - (clobber (match_operand:SI 2 "register_operand" "=&r"))] - "!TARGET_64BIT && TARGET_BIG_SWITCH" + (clobber (match_scratch:SI 2 "=&r"))] + "!flag_pic" "ldil L'%l1,%2\;ldo R'%l1(%2),%2\;{ldwx|ldw},s %0(%2),%2\;bv,n %%r0(%2)" [(set_attr "type" "multi") (set_attr "length" "16")]) @@ -7685,9 +7669,9 @@ (mult:SI (match_operand:SI 0 "register_operand" "r") (const_int 4)) (label_ref (match_operand 1 "" ""))))) - (clobber (match_operand:SI 2 "register_operand" "=&a")) - (clobber (match_operand:SI 3 "register_operand" "=&r"))] - "!TARGET_64BIT && TARGET_BIG_SWITCH" + (clobber (match_scratch:SI 2 "=&r")) + (clobber (match_scratch:SI 3 "=&r"))] + "flag_pic" "{bl .+8,%2\;depi 0,31,2,%2|mfia %2}\;ldo {16|20}(%2),%2\;\ {ldwx|ldw},s %0(%2),%3\;{addl|add,l} %2,%3,%3\;bv,n %%r0(%3)" [(set_attr "type" "multi") @@ -7703,9 +7687,9 @@ (match_operand:SI 0 "register_operand" "r")) (const_int 8)) (label_ref (match_operand 1 "" ""))))) - (clobber (match_operand:DI 2 "register_operand" "=&r")) - (clobber (match_operand:DI 3 "register_operand" "=&r"))] - "TARGET_64BIT && TARGET_BIG_SWITCH" + (clobber (match_scratch:DI 2 "=&r")) + (clobber (match_scratch:DI 3 "=&r"))] + "" "mfia %2\;ldo 24(%2),%2\;ldw,s %0(%2),%3\;extrd,s %3,63,32,%3\;\ add,l %2,%3,%3\;bv,n %%r0(%3)" [(set_attr "type" "multi")