From patchwork Fri Jan 19 22:20:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 863838 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-471703-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="L1az7J5/"; 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 3zNZyv3TKFz9s7M for ; Sat, 20 Jan 2018 09:20:39 +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:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=ntB2YG/FPNAx5YL4IamrO/FAu+/KhPQCAjfJKOn0CtEeuW7kIGsDt 2p4fi2vgqi8wWJfqS13LGbwKBBLPgDs9qSBhshFu3zYj+iUUKz0ESkQ8VAkw8vjR JiAeKvgJ2r/zWaCAveM3uZe7rm5YhGHEooqk6EbJwoX4c5MjVjm75Q= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=8i7lQ1bR0QHRURxh0o8p+a9/FAY=; b=L1az7J5/G4RhWlDW8LX3 eHOjrRgMNryW1DbCSnMpD9QzE6jcS+kEOdsZwjuOHXVbwi253yVTB+BUK3VJN5JK uzvXco1fnChFlg6q5FvUaxn3cji4gp9W+1oNxrRN1TUOZjrvvLoNVMxKgN2HuEQs dcrJkWFBdiICPVVhiIfoXiA= Received: (qmail 109301 invoked by alias); 19 Jan 2018 22:20:32 -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 109284 invoked by uid 89); 19 Jan 2018 22:20:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, T_RP_MATCHES_RCVD, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1534 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, 19 Jan 2018 22:20:30 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55AB54E90F for ; Fri, 19 Jan 2018 22:20:29 +0000 (UTC) Received: from [10.10.120.42] (ovpn-120-42.rdu2.redhat.com [10.10.120.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1650D60BE7 for ; Fri, 19 Jan 2018 22:20:28 +0000 (UTC) From: Vladimir Makarov Subject: patch to fix PR83147 To: "gcc-patches@gcc.gnu.org" Message-ID: <8ce4cea0-5f29-908e-e030-ef428c136449@redhat.com> Date: Fri, 19 Jan 2018 17:20:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83147 The patch was successfully boostrapped and tested on x86_64. There is no test for the patch because a test from the PR does not reproduce the bug anymore. Committed as rev. 256902. Index: ChangeLog =================================================================== --- ChangeLog (revision 256901) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2018-01-19 Andreas Krebbel + + PR rtl-optimization/83147 + * lra-constraints.c (remove_inheritance_pseudos): Use + lra_substitute_pseudo_within_insn. + 2018-01-19 Tom de Vries Cesar Philippidis Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 256891) +++ lra-constraints.c (working copy) @@ -6719,10 +6719,12 @@ remove_inheritance_pseudos (bitmap remov { lra_assert (GET_MODE (SET_SRC (prev_set)) == GET_MODE (regno_reg_rtx[sregno])); - if (GET_CODE (SET_SRC (set)) == SUBREG) - SUBREG_REG (SET_SRC (set)) = SET_SRC (prev_set); - else - SET_SRC (set) = SET_SRC (prev_set); + /* Although we have a single set, the insn can + contain more one sregno register occurrence + as a source. Change all occurrences. */ + lra_substitute_pseudo_within_insn (curr_insn, sregno, + SET_SRC (prev_set), + false); /* As we are finishing with processing the insn here, check the destination too as it might inheritance pseudo for another pseudo. */