From patchwork Thu Nov 29 18:54:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 202814 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 048172C0094 for ; Fri, 30 Nov 2012 06:02:32 +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=1354820553; 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=39Ztxkf yXhdxhU0W13xnplhHCuw=; b=qNaQqBdeCe2ianCjyTnNIploIDxCwI9Q70kwbHe /t4iNGR7UAT8K1s7zeYVXKv3mcz/M/clNrHwifwmCSJFe6lDzEwvE40l7IAO7vnw l1sclTRQpDbcH6kpCKe78yTrQ6QPmVwMUhRoo5v1KDp76K8ARoRzo/qZjyTbRNgT RExk= 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=OuXYwnCMESpHI7sbe9ByN+ldypk9mGCYaBMjMbypIkPq2o3whMidSZLIg8t+W5 HoAfh/tD1ZKOMjPu43uU0DrP2AMRsDJkfWXcixDPZORV4Dz9ul6uCcYFrqbYM9Zu VvQXw/EhICHV64Ok71RTZAMsR2eBgi3jwmICOsBq2J0UU=; Received: (qmail 18832 invoked by alias); 29 Nov 2012 19:02:21 -0000 Received: (qmail 18817 invoked by uid 22791); 29 Nov 2012 19:02:19 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, MAY_BE_FORGED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS 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, 29 Nov 2012 19:01:46 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATJ1jwf001745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Nov 2012 14:01:46 -0500 Received: from toll.usersys.redhat.com (unused [10.15.16.165] (may be forged)) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qATJ1jxh016464 for ; Thu, 29 Nov 2012 14:01:45 -0500 Message-ID: <50B7AF56.3000200@redhat.com> Date: Thu, 29 Nov 2012 13:54:14 -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: gcc-patches Subject: patch to fix PR55456 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 The following patch fixes gcc.gnu.org/bugzilla/show_bug.cgi?id=55456 The patch was successfully bootstrapped and tested on x86/x86-64. Committed as rev. 193948. 2012-11-28 Vladimir Makarov PR middle-end/55456 * lra-int.h (lra_new_regno_start): New external. * lra.c (lra_new_regno_start): New global. (lra): Set up lra_new_regno_start. * lra-constraints.c (match_reload): Sync values only for original pseudos. Index: lra.c =================================================================== --- lra.c (revision 193901) +++ lra.c (working copy) @@ -2151,6 +2151,9 @@ update_inc_notes (void) /* Set to 1 while in lra. */ int lra_in_progress; +/* Start of pseudo regnos before the LRA. */ +int lra_new_regno_start; + /* Start of reload pseudo regnos before the new spill pass. */ int lra_constraint_new_regno_start; @@ -2235,7 +2238,7 @@ lra (FILE *f) so set up lra_constraint_new_regno_start before its call to permit changing reg classes for pseudos created by this simplification. */ - lra_constraint_new_regno_start = max_reg_num (); + lra_constraint_new_regno_start = lra_new_regno_start = max_reg_num (); remove_scratches (); scratch_p = lra_constraint_new_regno_start != max_reg_num (); Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 193901) +++ lra-constraints.c (working copy) @@ -685,8 +685,10 @@ match_reload (signed char out, signed ch else new_out_reg = gen_rtx_SUBREG (outmode, reg, 0); /* If the input reg is dying here, we can use the same hard - register for REG and IN_RTX. */ - if (REG_P (in_rtx) + register for REG and IN_RTX. We do it only for original + pseudos as reload pseudos can die although original + pseudos still live where reload pseudos dies. */ + if (REG_P (in_rtx) && (int) REGNO (in_rtx) < lra_new_regno_start && find_regno_note (curr_insn, REG_DEAD, REGNO (in_rtx))) lra_reg_info[REGNO (reg)].val = lra_reg_info[REGNO (in_rtx)].val; } @@ -712,7 +714,9 @@ match_reload (signed char out, signed ch /* If SUBREG_REG is dying here and sub-registers IN_RTX and NEW_IN_REG are similar, we can use the same hard register for REG and SUBREG_REG. */ - if (REG_P (subreg_reg) && GET_MODE (subreg_reg) == outmode + if (REG_P (subreg_reg) + && (int) REGNO (subreg_reg) < lra_new_regno_start + && GET_MODE (subreg_reg) == outmode && SUBREG_BYTE (in_rtx) == SUBREG_BYTE (new_in_reg) && find_regno_note (curr_insn, REG_DEAD, REGNO (subreg_reg))) lra_reg_info[REGNO (reg)].val Index: lra-int.h =================================================================== --- lra-int.h (revision 193901) +++ lra-int.h (working copy) @@ -295,6 +295,7 @@ extern lra_copy_t lra_get_copy (int); extern bool lra_former_scratch_p (int); extern bool lra_former_scratch_operand_p (rtx, int); +extern int lra_new_regno_start; extern int lra_constraint_new_regno_start; extern bitmap_head lra_inheritance_pseudos; extern bitmap_head lra_split_regs;