From patchwork Fri Mar 22 17:03:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1061416 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-498319-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="n9aXvpRp"; 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 44Qqjy2hZ4z9sRf for ; Sat, 23 Mar 2019 04:03:31 +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=MTDSWGqbP9ozvrLvqE++d40biyhU3/4Jr0F2ahL75j178K5Cvh r83IzalaeCS0exDP00JeJTFVJ/PHcSuRRiEnez7l17kjZNRFMjFSqJVUx7v99a7S djSwXJ/k356Zo52TRLOu7wPtyiVrozm/xJAfCLNu1sSi1woXaQ5Bn2WiY= 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=OspHR11nswYCsOx6gKLySq+gtdM=; b=n9aXvpRpRyN9i4WlsdRS YKgwEhGtcXfhwXthD8f3HORTy3lVnm8YloXyMlyP+7hfTAzd2IlXDTHPpLfOSj1e qQZNr/P+Y4L1xcF84tutguIDQH/uS8y1OzjORFyIga8oAglEowkzDsDU//QrNxeO jnqoRsZq3y394sztFzb/Rok= Received: (qmail 44067 invoked by alias); 22 Mar 2019 17:03:22 -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 44052 invoked by uid 89); 22 Mar 2019 17:03:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=SUBREG 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, 22 Mar 2019 17:03:20 +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 000B53082B6A for ; Fri, 22 Mar 2019 17:03:18 +0000 (UTC) Received: from [10.10.120.90] (ovpn-120-90.rdu2.redhat.com [10.10.120.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4A4D5D9D2 for ; Fri, 22 Mar 2019 17:03:18 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: Patch to fix PR89676 Message-ID: Date: Fri, 22 Mar 2019 13:03:18 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89676   The patch was successfully bootstrapped and tested on x86-64.   Committed as rev. 269878. Index: ChangeLog =================================================================== --- ChangeLog (revision 269876) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2019-03-22 Vladimir Makarov + + PR rtl-optimization/89676 + * lra-constraints.c (curr_insn_transform): Do match reload for + early clobbers even if the match was successful. + 2019-03-22 Jakub Jelinek PR c++/87481 Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 269876) +++ lra-constraints.c (working copy) @@ -4256,6 +4256,20 @@ curr_insn_transform (bool check_only_p) || MEM_P (SET_DEST (curr_insn_set)) || GET_CODE (SET_DEST (curr_insn_set)) == SUBREG)))) optional_p = true; + else if (goal_alt_matched[i][0] != -1 + && curr_static_id->operand[i].type == OP_OUT + && (curr_static_id->operand_alternative + [goal_alt_number * n_operands + i].earlyclobber)) + { + /* Generate reloads for output and matched inputs. This + is the easiest way to avoid creation of non-existing + conflicts in lra-lives.c. */ + match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before, + &after, TRUE); + outputs[n_outputs++] = i; + outputs[n_outputs] = -1; + continue; + } else continue; } Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 269876) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2019-03-22 Vladimir Makarov + + PR rtl-optimization/89676 + * gcc.target/i386/pr89676.c: New. + 2019-03-22 Jakub Jelinek PR c++/60702 Index: testsuite/gcc.target/i386/pr89676.c =================================================================== --- testsuite/gcc.target/i386/pr89676.c (nonexistent) +++ testsuite/gcc.target/i386/pr89676.c (working copy) @@ -0,0 +1,10 @@ +/* PR rtl-optimization/89676 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -m32 -march=i686" } */ +unsigned long long +foo (unsigned long long i) +{ + return i << 3; +} + +/* { dg-final { scan-assembler-times "movl" 2 } } */