From patchwork Tue Feb 28 18:41:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 143531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AE51EB6EF1 for ; Wed, 29 Feb 2012 05:42:13 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331059334; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=s6jwh5z Z1Qe+a7fHimd+oe69VkA=; b=tc4zCtXl/BUhqc/bPm8IVrOdpaIzkCI60IdtrJE TYHlnLMiWTLm5y1B3kbqZzc6lpBxcTh0UCcjLKG66gr/cEGRFBs95FezN7XWF4L9 tuKNyi1JF6U3cktm6yILXaFuOaV/qX4HUeBa0mWhoOE0+Lzj6iT89O7XXOkhRqAH 15uk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=mvZ8uaHowlKyeJNXqvx8r6IrCft4NUKN87swJ5uGCx2I9YwK0anIHENYCRnZ3t d9nCJl/qki0ERrWtKX60x5+ytaFh4u9MUskWD0ranJ+y3HYggqKDab3eogkB01cR NmL7RKl0MK7aq7+oJi5lpcFPTE5qXSxAmXxZqfxTPFwts=; Received: (qmail 22008 invoked by alias); 28 Feb 2012 18:42:09 -0000 Received: (qmail 22000 invoked by uid 22791); 28 Feb 2012 18:42:07 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Feb 2012 18:41:47 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1SIfkuk026717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 Feb 2012 13:41:46 -0500 Received: from toll.yyz.redhat.com (unused [10.15.16.165] (may be forged)) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1SIfkq7018860 for ; Tue, 28 Feb 2012 13:41:46 -0500 Message-ID: <4F4D1FE9.20405@redhat.com> Date: Tue, 28 Feb 2012 13:41:45 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: gcc-patches Subject: [lra] patch to fix arm bootstrap. X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org After a few recent changes, I found that arm bootstrap broken again. I found a latent bug whose occurrence is triggered by recent changes. The following patch mostly fixes the bug. The patch was successfully bootstrapped on x86/x86-64 (arm bootstrap result will be available only this night). Committed as rev. 184637. 2012-02-28 Vladimir Makarov * lra-constraints.c (get_op_mode): Use mode from the machine description first. (match_reload, process_addr_reg, simplify_operand_subreg) (curr_insn_transform): Put after-reloads before already existing ones. (process_address): Use find_regno_note instead find_reg_note. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 184631) +++ lra-constraints.c (working copy) @@ -796,14 +796,16 @@ find_mode (rtx *where, enum machine_mode static inline enum machine_mode get_op_mode (int nop) { - rtx *loc = curr_id->operand_loc[nop]; - enum machine_mode mode = GET_MODE (*loc); + rtx *loc; + enum machine_mode mode = curr_static_id->operand[nop].mode; - /* Take mode from the operand first. */ + /* Take mode from the machine description first. */ if (mode != VOIDmode) return mode; - /* Take mode from the machine description second. */ - if ((mode = curr_static_id->operand[nop].mode) != VOIDmode) + loc = curr_id->operand_loc[nop]; + /* Take mode from the operand second. */ + mode = GET_MODE (*loc); + if (mode != VOIDmode) return mode; /* Here is a very rare case. Take mode from the context. */ return find_mode (&PATTERN (curr_insn), VOIDmode, loc); @@ -900,8 +902,9 @@ match_reload (signed char out, signed ch lra_update_dups (curr_id, ins); if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX) { - push_to_sequence (*after); + start_sequence (); lra_emit_move (out_rtx, new_out_reg); + emit_insn (*after); *after = get_insns (); end_sequence (); } @@ -1250,8 +1253,9 @@ process_addr_reg (rtx *loc, rtx *before, *loc = new_reg; if (after != NULL) { - push_to_sequence (*after); + start_sequence (); lra_emit_move (reg, new_reg); + emit_insn (*after); *after = get_insns (); end_sequence (); } @@ -1297,8 +1301,9 @@ process_addr_reg (rtx *loc, rtx *before, *loc = new_reg; if (after != NULL) { - push_to_sequence (*after); + start_sequence (); lra_emit_move (reg, new_reg); + emit_insn (*after); *after = get_insns (); end_sequence (); } @@ -1374,8 +1379,9 @@ simplify_operand_subreg (int nop, enum m } if (type != OP_IN) { - push_to_sequence (after); + start_sequence (); lra_emit_move (reg, new_reg); + emit_insn (after); after = get_insns (); end_sequence (); } @@ -2508,13 +2514,13 @@ process_address (int nop, rtx *before, r change_p = equiv_address_substitution (&ad, addr_loc, mode, as, code); if (ad.base_reg_loc != NULL) { - if (process_addr_reg (ad.base_reg_loc, before, - (ad.base_modify_p - && find_reg_note (curr_insn, REG_DEAD, - *ad.base_reg_loc) == NULL - ? after : NULL), - base_reg_class (mode, as, ad.base_outer_code, - ad.index_code))) + if (process_addr_reg + (ad.base_reg_loc, before, + (ad.base_modify_p && REG_P (*ad.base_reg_loc) + && find_regno_note (curr_insn, REG_DEAD, + REGNO (*ad.base_reg_loc)) == NULL + ? after : NULL), + base_reg_class (mode, as, ad.base_outer_code, ad.index_code))) change_p = true; if (ad.base_reg_loc2 != NULL) *ad.base_reg_loc2 = *ad.base_reg_loc; @@ -3248,8 +3254,9 @@ curr_insn_transform (void) { if (find_reg_note (curr_insn, REG_UNUSED, old) == NULL_RTX) { - push_to_sequence (after); + start_sequence (); lra_emit_move (old, new_reg); + emit_insn (after); after = get_insns (); end_sequence (); }