From patchwork Fri Nov 23 22:04:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1002527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490808-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="YLEWnkv9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431r2v3nnYz9s0n for ; Sat, 24 Nov 2018 09:05:09 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QbOSLubZxaMHQ+oHIpvvA/pDUrTHlwnvVbGfLI3Lw1KOFjjS2b /F+SzRcs6dI22CBzAMThnD/q+cpSdvKYD9Nc1pv2+g460BrEfxb0QtKP75puK/W/ qfXVAH5hkKhRjdvvWy7TBB0uHEpYB931+1AdhPgZvX/yokYOUlpg7VPjo= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=sTrM2M17bqgRkTYg2Sp+oNqP+LQ=; b=YLEWnkv93AapKmvKRUA3 jNzfg+WRwuMWvwfs48tu6JH1Q2WlVMnwBOLoohJhNmsrUmjhmuYZdSLpvD/aBu0y enQDOpq59BRHyUj8SY6MBTpGXksz/k2CJxHP/A3t7koJDAENrVf775/sw5IXxivi XxK5OSN09HFSFyPBQ3uXYRM= Received: (qmail 106414 invoked by alias); 23 Nov 2018 22:05:03 -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 106404 invoked by uid 89); 23 Nov 2018 22:05:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*UA:52.6.0, H*u:52.6.0 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; Fri, 23 Nov 2018 22:05:01 +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 5183F4E33B for ; Fri, 23 Nov 2018 22:05:00 +0000 (UTC) Received: from [10.10.120.178] (ovpn-120-178.rdu2.redhat.com [10.10.120.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F2471902E for ; Fri, 23 Nov 2018 22:04:59 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: patch to fix PR88157 Message-ID: Date: Fri, 23 Nov 2018 17:04:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88157   The patch was successfully bootstrapped on x86 and x86-64 with GO and D.   Committed as rev. 266422. Index: ChangeLog =================================================================== --- ChangeLog (revision 266421) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2018-11-23 Vladimir Makarov + + PR bootstrap/88157 + * ira-costs.c (record_operand_costs): Use bigger hard reg class if + its mode does not fit to the original class. + 2018-11-23 Martin Sebor PR tree-optimization/87756 Index: ira-costs.c =================================================================== --- ira-costs.c (revision 266385) +++ ira-costs.c (working copy) @@ -1319,6 +1319,13 @@ record_operand_costs (rtx_insn *insn, en bool dead_p = find_regno_note (insn, REG_DEAD, REGNO (src)); hard_reg_class = REGNO_REG_CLASS (other_regno); + /* Target code may return any cost for mode which does not + fit the the hard reg class (e.g. DImode for AREG on + i386). Check this and use a bigger class to get the + right cost. */ + if (! ira_hard_reg_in_set_p (other_regno, mode, + reg_class_contents[hard_reg_class])) + hard_reg_class = ira_pressure_class_translate[hard_reg_class]; i = regno == (int) REGNO (src) ? 1 : 0; for (k = cost_classes_ptr->num - 1; k >= 0; k--) {