From patchwork Thu May 2 18:56:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 241055 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 09EA02C00A1 for ; Fri, 3 May 2013 05:09:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; q=dns; s=default; b=y2ue7COxa/HnHb1H NoNQjmFtKNJXyhRWXWMkLFqgRREX25UM2v8Z9gtZF3wJ0TTbhIw3tJ5d/XG/7Jod rE2jwKIrfTUG/U4UF9JYjRanlqTz0iZ5XoNIiMr97wSO1pS474iZ275tfx0cDLFu h88KGFnoshWUwKSG9s/SBX6HcSQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; s=default; bh=0SVIbPTH0XXTIJ9yG178rP 8FnjU=; b=l0itx/z+W/wh+B9WNp93sCLO/5Dp6+ZjePT7ZBxgLb5/OwJ1PzgZgF FxGHGb4MYrEdXSxQb175mvNqATinucIHtkwGPDM1x+mghm3ft6EHygaN0dV20pgF jJpVUuEkQVg0kdJyopuL1t6qqnoKFaPygW8gOxc6TJ1CLn+Dorq0U= Received: (qmail 28437 invoked by alias); 2 May 2013 19:09:06 -0000 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 Received: (qmail 28426 invoked by uid 89); 2 May 2013 19:09:05 -0000 X-Spam-SWARE-Status: No, score=-7.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 02 May 2013 19:09:05 +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 r42J936G002378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 May 2013 15:09:03 -0400 Received: from toll.usersys.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r42J928Q018251 for ; Thu, 2 May 2013 15:09:03 -0400 Message-ID: <5182B6E9.30802@redhat.com> Date: Thu, 02 May 2013 14:56:41 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: gcc-patches Subject: patch to add one more criterium for choosing alternatives in LRA The following patch fixes two GCC testsuite failures on i686 after submitting patch to fix PR57091. The first alternative is always preferable then subsequent ones when all costs are the same. That is how reload works. This checks needs when we have commutative operator in an insn. Committed as rev. 198558. 2013-05-02 Vladimir Makarov * lra-constraints.c (process_alt_operands): Add checking alt number to choose the best alternative. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 198503) +++ lra-constraints.c (working copy) @@ -2197,7 +2197,9 @@ process_alt_operands (int only_alternati number of reload regs. */ && (reload_nregs < best_reload_nregs || (reload_nregs == best_reload_nregs - && best_reload_sum < reload_sum)))))) + && (best_reload_sum < reload_sum + || (best_reload_sum == reload_sum + && nalt < goal_alt_number)))))))) { for (nop = 0; nop < n_operands; nop++) {