From patchwork Fri Feb 22 16:33:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 222554 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 760D32C02A0 for ; Sat, 23 Feb 2013 03:34:02 +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=1362155642; 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=jrDimFj WdEgJrpIv/0xDGUg9xxs=; b=tuJCsX3o9K3l/1bunQxEa7agQeo6HrAZ+BvYcNd Bq/vhJKxnZmiBmZqpKDYsIs9DjfEoQJ+XUsHbJWF9aHycjqJToqrfFhFovLNQrob s0pXWq7zzzZEDfLL17Lf+54dyIXRRoiYNi9l0mjT4gta/RjypbuDKZXQv81ws/aM Vsfs= 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=q0EGkOtR4wiiXu40kx2in6BEE9arccQwoYgUTuE6pGeDVBLsm/R+p3Ytq1R3f2 Dq7rFh0sS3oQvvEZOPy5cYQ4XA0ha4DbTpkPzuFneVu9Ma+CERbt49/IwL6gfsR9 JRQvkYB1xo+uJKCUXHA+rYwM2xHVDTbDHZ530Iz0UiNYc=; Received: (qmail 26516 invoked by alias); 22 Feb 2013 16:33:55 -0000 Received: (qmail 26506 invoked by uid 22791); 22 Feb 2013 16:33:55 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, 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; Fri, 22 Feb 2013 16:33:48 +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 r1MGXmFh013038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Feb 2013 11:33:48 -0500 Received: from Mair.local (vpn-53-21.rdu2.redhat.com [10.10.53.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1MGXlQ2016708 for ; Fri, 22 Feb 2013 11:33:47 -0500 Message-ID: <51279DEB.8020903@redhat.com> Date: Fri, 22 Feb 2013 11:33:47 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: GCC Patches Subject: patch for PR56148 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 ppc64/ia64 bootstrap problem occurred after submitting patch for PR56148. The problem might occur for x86/x86-64 therefore I am submitting this patch for trunk too. The patch was successfully bootstrapped on x86/x86-64, ppc64, ia64. Committed as rev. 196223. 2013-02-22 Vladimir Makarov PR inline-asm/56148 * lra-constraints.c (process_alt_operands): Reload operand conflicting with earlier clobber only if no more other conflicting operands. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 196081) +++ lra-constraints.c (working copy) @@ -2052,7 +2052,7 @@ process_alt_operands (int only_alternati curr_alt_dont_inherit_ops_num = 0; for (nop = 0; nop < early_clobbered_regs_num; nop++) { - int i, j, clobbered_hard_regno; + int i, j, clobbered_hard_regno, first_conflict_j, last_conflict_j; HARD_REG_SET temp_set; i = early_clobbered_nops[nop]; @@ -2063,6 +2063,7 @@ process_alt_operands (int only_alternati clobbered_hard_regno = hard_regno[i]; CLEAR_HARD_REG_SET (temp_set); add_to_hard_reg_set (&temp_set, biggest_mode[i], clobbered_hard_regno); + first_conflict_j = last_conflict_j = -1; for (j = 0; j < n_operands; j++) if (j == i /* We don't want process insides of match_operator and @@ -2077,19 +2078,26 @@ process_alt_operands (int only_alternati /* If we don't reload j-th operand, check conflicts. */ else if ((curr_alt_win[j] || curr_alt_match_win[j]) && uses_hard_regs_p (*curr_id->operand_loc[j], temp_set)) - break; - if (j >= n_operands) + { + if (first_conflict_j < 0) + first_conflict_j = j; + last_conflict_j = j; + } + if (last_conflict_j < 0) continue; /* If earlyclobber operand conflicts with another non-matching operand which is actually the same register as the earlyclobber operand, it is better to reload the another operand as an operand matching the earlyclobber operand can be also the same. */ - if (operand_reg[j] != NULL_RTX && ! curr_alt_match_win[j] - && REGNO (operand_reg[i]) == REGNO (operand_reg[j])) + if (first_conflict_j == last_conflict_j + && operand_reg[last_conflict_j] + != NULL_RTX && ! curr_alt_match_win[last_conflict_j] + && REGNO (operand_reg[i]) == REGNO (operand_reg[last_conflict_j])) { - curr_alt_win[j] = false; - curr_alt_dont_inherit_ops[curr_alt_dont_inherit_ops_num++] = j; + curr_alt_win[last_conflict_j] = false; + curr_alt_dont_inherit_ops[curr_alt_dont_inherit_ops_num++] + = last_conflict_j; losers++; overall += LRA_LOSER_COST_FACTOR; }