From patchwork Fri Dec 7 16:12:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1009536 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-491905-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="kXy6p48J"; 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 43BHYX6jHHz9s0n for ; Sat, 8 Dec 2018 03:12:32 +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=dXjOEZ7VsQ0vRxQTPmMjpy+fKYEair/vtn/Sfb6qhFm890Hvz4 +aVDSbSbkLLLe7D5dWbi94dt/6tAYrIuJbZ3htTj3QtHInnCFYJyAnatiZ6D6ne0 nhZKG/ASjKYggQcyIGQ8FpHkdbGDRdl5IZ5HzRWXnaghwlDmOTtKhHmI0= 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=MWyJ5Cl7Ept6PStbwAxZuf/Nn60=; b=kXy6p48J39WkXn0UZ7EF A6DcJhFVV65sg5+Fydj0gyTUrbTRYOazM9z7RZMND9fTzkqrok/Vqgv2t03/fD10 wKnlVbN5BrhBMfM6hO2OGNM6RBspQOvq5nZNeQuQfFdUSsDQEqJB1Ij3mGNPnuzU qKjoDVieaQGNIK9m0oRuRiI= Received: (qmail 83216 invoked by alias); 7 Dec 2018 16:12:17 -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 83049 invoked by uid 89); 7 Dec 2018 16:12:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=DImode, AREG, hard_reg_class, areg 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, 07 Dec 2018 16:12:14 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 437E286674 for ; Fri, 7 Dec 2018 16:12:13 +0000 (UTC) Received: from [10.3.117.225] (ovpn-117-225.phx2.redhat.com [10.3.117.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9390747A2 for ; Fri, 7 Dec 2018 16:12:12 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: patch for PR88349 Message-ID: Date: Fri, 7 Dec 2018 11:12:11 -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=88349 The patch is simple and therefore I checked it only on x86-64. Committed as rev. 226894. Index: ChangeLog =================================================================== --- ChangeLog (revision 266893) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2018-12-07 Vladimir Makarov + + PR rtl-optimization/88349 + * ira-costs.c (record_operand_costs): Check bigger reg class on + NO_REGS. + 2018-12-07 Richard Sandiford * config/aarch64/aarch64-sve.md (*mul3, *v3): Index: ira-costs.c =================================================================== --- ira-costs.c (revision 266862) +++ ira-costs.c (working copy) @@ -1327,8 +1327,9 @@ record_operand_costs (rtx_insn *insn, en 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])) + if (bigger_hard_reg_class != NO_REGS + && ! ira_hard_reg_in_set_p (other_regno, mode, + reg_class_contents[hard_reg_class])) hard_reg_class = bigger_hard_reg_class; i = regno == (int) REGNO (src) ? 1 : 0; for (k = cost_classes_ptr->num - 1; k >= 0; k--) Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 266893) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2018-12-07 Vladimir Makarov + + PR rtl-optimization/88349 + * gcc.target/mips/pr88349.c: New. + 2018-12-07 Jakub Jelinek PR c++/86669 Index: testsuite/gcc.target/mips/pr88349.c =================================================================== --- testsuite/gcc.target/mips/pr88349.c (nonexistent) +++ testsuite/gcc.target/mips/pr88349.c (working copy) @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-mel -mabi=32 -march=mips64r2 -fexpensive-optimizations" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ + +typedef int DI __attribute__((mode(DI))); +typedef int SI __attribute__((mode(SI))); + +__attribute__((mips16)) SI +f (SI x, SI y) +{ + return ((DI) x * y) >> 32; +} + +/* { dg-final { scan-assembler-not "\tsw\t" } } */