From patchwork Thu Dec 6 21:20:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 204325 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 E5BEC2C00D8 for ; Fri, 7 Dec 2012 08:28:33 +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=1355434114; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=RSs3lgdE7H/vhMkiTJlmvQOTSak=; b=QHeGbx2MGwDWPBT 3bgTllMQqwwIAHHPOUhYzhDKCX2E9wj8MeT0Ob4ZqvJmIok/KugXLUDZzyS8HpwB 3pPvHxRiHRToqMYEOpadVxDpIUn47tXON6h6a3xCB2bh4+mCMYW6SFTzv9AGouPc 8I2RIE70gIKqseitmLdMkWgxFmZw= 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:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=GnwJEmrC3AsLaahAI5aEsqNfFPrOjyG7x2L4r4q3LNvs9wdw2jWC8n7v2zUPQp 1TVa6bl3YO6FBJ7orBPZY3tveyVEZ69YcuhChJXLi3YY39vdFP/3Po1iTv79OAyL j4+D/EDUqNctto3d8OquqElXExSpq1zmdEmyH5xjLYMiU=; Received: (qmail 3192 invoked by alias); 6 Dec 2012 21:28:30 -0000 Received: (qmail 3184 invoked by uid 22791); 6 Dec 2012 21:28:29 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, KHOP_THREADED, MAY_BE_FORGED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_DF 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; Thu, 06 Dec 2012 21:28:22 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB6LSLgo005135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Dec 2012 16:28:22 -0500 Received: from toll.usersys.redhat.com (unused [10.15.16.165] (may be forged)) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB6LSLEb023597; Thu, 6 Dec 2012 16:28:21 -0500 Message-ID: <50C10C2E.4010909@redhat.com> Date: Thu, 06 Dec 2012 16:20:46 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Michael Meissner , GCC Patches Subject: Re: [lra] a patch to fix ppc bootstrap failure References: <50BEDD3C.1050306@redhat.com> <20121205225106.GA31820@ibm-tiger.the-meissners.org> <50C01184.8070306@redhat.com> In-Reply-To: <50C01184.8070306@redhat.com> 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 On 12/05/2012 10:31 PM, Vladimir Makarov wrote: > On 12-12-05 5:51 PM, Michael Meissner wrote: >> This is the file that causes the boostrap to fail if >> --enable-decimal-float is >> used as a configuration option on the LRA branch. You need to >> compile this in >> 32-bit mode with either -mcpu=power7, -mcpu=power6, or -mhard-dfp to >> enable the >> decimal instructions. I used -m32 -O2 -O3 -mcpu=power6. > I managed to reproduce it. I'll look at this tomorrow. > Thanks, Mike. >> The error message is: >> >> /home/meissner/fsf-src/lra/libgcc/dfp-bit.c:248:1: error: >> unrecognizable insn: >> } >> ^ >> (insn 291 25 289 2 (set (reg:DD 199) >> (subreg:DD (reg:SD 33 1 [ arg_a ]) 0)) >> /home/meissner/fsf-src/lra/libgcc/dfp-bit.c:104 -1 >> (expr_list:REG_DEAD (reg:DI 33 1) >> (nil))) >> > LRA should have change spilled pseudo 199 to memory. LRA did not do that because the insn is in list of insns used by pseudo 199. This might happen only when the insn is not recognized. The following patch fixes the bug. Committed as rev. 194270. 2012-12-06 Vladimir Makarov * rtl.h (SUBREG_MATCH_RELOAD_P): Rename to LRA_SUBREG_P. * recog.c (register_operand): Check LRA_SUBREG_P. * lra-constraints.c (match_reload, simplify_operand_subreg): Use LRA_SUBREG_P. (emit_spill_move): Set up LRA_SUBREG_P. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 194263) +++ lra-constraints.c (working copy) @@ -685,7 +685,7 @@ match_reload (signed char out, signed ch new_out_reg = gen_lowpart_SUBREG (outmode, reg); else new_out_reg = gen_rtx_SUBREG (outmode, reg, 0); - SUBREG_MATCH_RELOAD_P (new_out_reg) = 1; + LRA_SUBREG_P (new_out_reg) = 1; /* If the input reg is dying here, we can use the same hard register for REG and IN_RTX. We do it only for original pseudos as reload pseudos can die although original @@ -709,7 +709,7 @@ match_reload (signed char out, signed ch it at the end of LRA work. */ clobber = emit_clobber (new_out_reg); LRA_TEMP_CLOBBER_P (PATTERN (clobber)) = 1; - SUBREG_MATCH_RELOAD_P (new_in_reg) = 1; + LRA_SUBREG_P (new_in_reg) = 1; if (GET_CODE (in_rtx) == SUBREG) { rtx subreg_reg = SUBREG_REG (in_rtx); @@ -842,12 +842,15 @@ static rtx emit_spill_move (bool to_p, rtx mem_pseudo, rtx val) { if (GET_MODE (mem_pseudo) != GET_MODE (val)) - val = gen_rtx_SUBREG (GET_MODE (mem_pseudo), - GET_CODE (val) == SUBREG ? SUBREG_REG (val) : val, - 0); + { + val = gen_rtx_SUBREG (GET_MODE (mem_pseudo), + GET_CODE (val) == SUBREG ? SUBREG_REG (val) : val, + 0); + LRA_SUBREG_P (val) = 1; + } return (to_p - ? gen_move_insn (mem_pseudo, val) - : gen_move_insn (val, mem_pseudo)); + ? gen_move_insn (mem_pseudo, val) + : gen_move_insn (val, mem_pseudo)); } /* Process a special case insn (register move), return true if we @@ -1193,7 +1196,7 @@ simplify_operand_subreg (int nop, enum m SUBREG_BYTE (operand), mode) < 0 /* Don't reload subreg for matching reload. It is actually valid subreg in LRA. */ - && ! SUBREG_MATCH_RELOAD_P (operand)) + && ! LRA_SUBREG_P (operand)) || CONSTANT_P (reg) || GET_CODE (reg) == PLUS || MEM_P (reg)) { enum op_type type = curr_static_id->operand[nop].type; Index: recog.c =================================================================== --- recog.c (revision 194263) +++ recog.c (working copy) @@ -1067,7 +1067,8 @@ register_operand (rtx op, enum machine_m && REGNO (sub) < FIRST_PSEUDO_REGISTER && REG_CANNOT_CHANGE_MODE_P (REGNO (sub), GET_MODE (sub), mode) && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_INT - && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT) + && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT + && ! LRA_SUBREG_P (op)) return 0; #endif Index: rtl.h =================================================================== --- rtl.h (revision 194263) +++ rtl.h (working copy) @@ -268,7 +268,7 @@ struct GTY((chain_next ("RTX_NEXT (&%h)" In a CODE_LABEL, part of the two-bit alternate entry field. 1 in a CONCAT is VAL_EXPR_IS_COPIED in var-tracking.c. 1 in a VALUE is SP_BASED_VALUE_P in cselib.c. - 1 in a SUBREG generated by LRA for matching reload. */ + 1 in a SUBREG generated by LRA for reload insns. */ unsigned int jump : 1; /* In a CODE_LABEL, part of the two-bit alternate entry field. 1 in a MEM if it cannot trap. @@ -1416,10 +1416,10 @@ do { \ ((RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \ ? -1 : (int) (RTX)->unchanging) -/* True if the subreg was generated by LRA for matching reload. Such +/* True if the subreg was generated by LRA for reload insns. Such subregs are valid only during LRA. */ -#define SUBREG_MATCH_RELOAD_P(RTX) \ - (RTL_FLAG_CHECK1("SUBREG_MATCH_RELOAD_P", (RTX), SUBREG)->jump) +#define LRA_SUBREG_P(RTX) \ + (RTL_FLAG_CHECK1("LRA_SUBREG_P", (RTX), SUBREG)->jump) /* Access various components of an ASM_OPERANDS rtx. */