From patchwork Fri Sep 9 20:07:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 114127 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 14A57B6FA2 for ; Sat, 10 Sep 2011 06:07:41 +1000 (EST) Received: (qmail 15207 invoked by alias); 9 Sep 2011 20:07:37 -0000 Received: (qmail 15196 invoked by uid 22791); 9 Sep 2011 20:07:34 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, 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; Fri, 09 Sep 2011 20:07:15 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p89K7FGR020705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Sep 2011 16:07:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p89K7FQc000465 for ; Fri, 9 Sep 2011 16:07:15 -0400 Received: from localhost.localdomain (ovpn-113-127.phx2.redhat.com [10.3.113.127]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p89K7DR4006671 for ; Fri, 9 Sep 2011 16:07:14 -0400 Message-ID: <4E6A71EF.1080402@redhat.com> Date: Fri, 09 Sep 2011 16:07:11 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110831 Fedora/3.1.12-2.fc14 Thunderbird/3.1.12 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [lra] Fix ppc64 bootstrap failure 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 compiler crash on stage3 of bootstrap. The patch was successfully bootstrapped on x86/x86-64 and ppc64. 2011-09-09 Vladimir Makarov * lra-constraints.c (equivalence_change_p): Rename to debug_loc_equivalence_change_p. Process subreg of reg whose equivalence mode is unknown. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 178707) +++ lra-constraints.c (working copy) @@ -3113,17 +3113,30 @@ contains_pseudo_p (rtx x, bool spilled_p return false; } -/* Process all regs in *LOC and change them on equivalent - substitution. Return true if any change was done. */ +/* Process all regs in debug location *LOC and change them on + equivalent substitution. Return true if any change was done. */ static bool -equivalence_change_p (rtx *loc) +debug_loc_equivalence_change_p (rtx *loc) { - rtx subst, x = *loc; + rtx subst, reg, x = *loc; bool result = false; enum rtx_code code = GET_CODE (x); const char *fmt; int i, j; + if (code == SUBREG) + { + reg = SUBREG_REG (x); + if ((subst = get_equiv_substitution (reg)) != reg + && GET_MODE (subst) == VOIDmode) + { + /* We cannot reload debug location. Simplify subreg here + while we know the inner mode. */ + *loc = simplify_gen_subreg (GET_MODE (x), subst, + GET_MODE (reg), SUBREG_BYTE (x)); + return true; + } + } if (code == REG && (subst = get_equiv_substitution (x)) != x) { *loc = subst; @@ -3135,10 +3148,11 @@ equivalence_change_p (rtx *loc) for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') - result = equivalence_change_p (&XEXP (x, i)) || result; + result = debug_loc_equivalence_change_p (&XEXP (x, i)) || result; else if (fmt[i] == 'E') for (j = XVECLEN (x, i) - 1; j >= 0; j--) - result = equivalence_change_p (&XVECEXP (x, i, j)) || result; + result + = debug_loc_equivalence_change_p (&XVECEXP (x, i, j)) || result; } return result; } @@ -3237,7 +3251,7 @@ lra_constraints (bool first_p) /* We need to check equivalence in debug insn and change pseudo to the equivalent value if necessary. */ curr_id = lra_get_insn_recog_data (curr_insn); - if (equivalence_change_p (curr_id->operand_loc[0])) + if (debug_loc_equivalence_change_p (curr_id->operand_loc[0])) changed_p = true; } else if (INSN_P (curr_insn))