From patchwork Thu Mar 31 01:14:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 88998 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 1AD8DB6F12 for ; Thu, 31 Mar 2011 12:10:20 +1100 (EST) Received: (qmail 25652 invoked by alias); 31 Mar 2011 01:10:18 -0000 Received: (qmail 25642 invoked by uid 22791); 31 Mar 2011 01:10:17 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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, 31 Mar 2011 01:10:11 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2V1AAPm028726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 21:10:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2V1AAg0019504 for ; Wed, 30 Mar 2011 21:10:10 -0400 Received: from 1005.home (ovpn-113-38.phx2.redhat.com [10.3.113.38]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p2V1A8Eb024832 for ; Wed, 30 Mar 2011 21:10:09 -0400 Message-ID: <4D93D56E.8060906@redhat.com> Date: Wed, 30 Mar 2011 21:14:22 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 To: gcc-patches Subject: a patch to fix PR 48367 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 solves the problem. The reason for the problem is described on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48367 The patch has been committed as obvious. 2011-03-30 Vladimir Makarov PR middle-end/48367 * ira-costs.c (find_costs_and_classes): Fix a typo in i_mem_cost calculation. Index: ira-costs.c =================================================================== --- ira-costs.c (revision 171649) +++ ira-costs.c (working copy) @@ -1652,7 +1652,7 @@ find_costs_and_classes (FILE *dump_file) i_costs[k] += add_cost; } add_cost = COSTS (costs, a_num)->mem_cost; - if (add_cost && INT_MAX - add_cost < i_mem_cost) + if (add_cost > 0 && INT_MAX - add_cost < i_mem_cost) i_mem_cost = INT_MAX; else i_mem_cost += add_cost; @@ -1887,7 +1887,7 @@ process_bb_node_for_hard_reg_moves (ira_ ALLOCNO_HARD_REG_COSTS (a)[i] -= cost; ALLOCNO_CONFLICT_HARD_REG_COSTS (a)[i] -= cost; ALLOCNO_CLASS_COST (a) = MIN (ALLOCNO_CLASS_COST (a), - ALLOCNO_HARD_REG_COSTS (a)[i]); + ALLOCNO_HARD_REG_COSTS (a)[i]); } }