From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90480 invoked by alias); 5 Apr 2017 15:25:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 90318 invoked by uid 89); 5 Apr 2017 15:25:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:92d87dc, H*MI:sk:92d87dc, H*i:sk:92d87dc X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Apr 2017 15:25:07 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7859A70AAD for ; Wed, 5 Apr 2017 15:25:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7859A70AAD Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7859A70AAD Received: from tucnak.zalov.cz (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F56E86878; Wed, 5 Apr 2017 15:25:05 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v35FP3YX002648; Wed, 5 Apr 2017 17:25:03 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v35FP09T002646; Wed, 5 Apr 2017 17:25:00 +0200 Date: Wed, 05 Apr 2017 15:25:00 -0000 From: Jakub Jelinek To: Vladimir Makarov Cc: "gcc-patches@gcc.gnu.org" Subject: Re: patch to fix PR70703 Message-ID: <20170405152500.GT17461@tucnak> Reply-To: Jakub Jelinek References: <92d87dc9-0d07-4540-55cd-eca8177ae533@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92d87dc9-0d07-4540-55cd-eca8177ae533@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00229.txt.bz2 On Wed, Apr 05, 2017 at 11:11:54AM -0400, Vladimir Makarov wrote: > --- ira-color.c (revision 246536) > +++ ira-color.c (working copy) > @@ -1367,6 +1367,16 @@ update_costs_from_allocno (ira_allocno_t > || ALLOCNO_ASSIGNED_P (another_allocno)) > continue; > > + if (GET_MODE_SIZE (ALLOCNO_MODE (cp->second)) < GET_MODE_SIZE (mode)) > + /* If we have different modes use the smallest one. It is > + a sub-register move. It is hard to predict what LRA > + will reload (the pseudo or its sub-register) but LRA > + will try to minimize the data movement. Also for some > + register classes bigger modes might be invalid, > + e.g. DImode for AREG on x86. For such cases the > + register move cost will be maximal. */ > + mode = ALLOCNO_MODE (cp->second); > + > cost = (cp->second == allocno > ? ira_register_move_cost[mode][rclass][aclass] > : ira_register_move_cost[mode][aclass][rclass]); > @@ -1512,7 +1522,7 @@ update_conflict_hard_regno_costs (int *c > index = ira_class_hard_reg_index[aclass][hard_regno]; > if (index < 0) > continue; > - cost = (int) ((unsigned) conflict_costs [i] * mult) / div; > + cost = (int) (((long) conflict_costs [i] * mult) / div); If you want something wider than unsigned, wouldn't it be better to use HOST_WIDE_INT then? Otherwise it will work differently between 32-bit and 64-bit hosts. Can any of those 3 values be negative? If not, perhaps unsigned HOST_WIDE_INT? Jakub