From patchwork Mon Oct 8 22:23:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameera Deshpande X-Patchwork-Id: 980840 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-487168-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QDJLovg5"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="S88/Rizo"; 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 42TZft3lGdz9sB7 for ; Tue, 9 Oct 2018 09:24:52 +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 :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=lwPHHe5GcdDuNBr3ao1iBvBENqlaWalaLwR7IZxLZ1x LM/npwxp0HwwuhGfdRaENeMCFUkqm2BMttXYM6FWyneG723ns7TAMqF9OMKGgA2D a8hLKI7+Si5W8N2rwzNLDK+IhDcCJpxmdHncbXil2qHIL8ASN0Gplma4Nv/kkEug = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=B+eOFCOtkW0JQPeCiEsXn2r9f4M=; b=QDJLovg5r6RUnU2D7 +whTsyhunhMui/BeWr3k/3XLQ0PBjgY+U7nOol1IRhBFZIwVGmWldITuRvceFXBH O1bTD/ShtCYHp2s3RGcq+wxzh+P0AST/oh7CCVVtvz5qUpXRZEzIcVM8/Af2ovhQ EPPsN7zdoPjXlBv4pdl3o/8S+0= Received: (qmail 115574 invoked by alias); 8 Oct 2018 22:24:36 -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 114988 invoked by uid 89); 8 Oct 2018 22:24:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1887, HTo:U*vmakarov X-HELO: mail-ot1-f54.google.com Received: from mail-ot1-f54.google.com (HELO mail-ot1-f54.google.com) (209.85.210.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Oct 2018 22:24:03 +0000 Received: by mail-ot1-f54.google.com with SMTP id l1so8194311otj.5 for ; Mon, 08 Oct 2018 15:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=rQ3ZHfRUlaqnB90OLISldc4dKn6Cq90BXzdMSgfkJLQ=; b=S88/RizoITJpOJzu3n+p5WQA5kusDhCcEgiDD3FKkO8GlrX6nnnEr7/FFYApWC5jZu sa6QVVbSUd1Z1OTaTn+9mhLCOdwsHHe8W4Tl+GMC3V38mQoXAWQlm4YDbHa5b56XteU4 Wu3ZFx7QbKsqhdAJcBxbawLvCm2v50g0nfijM= MIME-Version: 1.0 From: Sameera Deshpande Date: Tue, 9 Oct 2018 03:53:50 +0530 Message-ID: Subject: [Patch, regrename] Fix PR87330 : ICE in scan_rtx_reg, at regrename.c To: vmakarov@redhat.com, bergner@vnet.ibm.com, zadeck@naturalbridge.com, seongbae.park@gmail.com Cc: gcc-patches X-IsSubscribed: yes Hi! Please find attached the patch fixing the issue PR87330 : ICE in scan_rtx_reg, at regrename.c:1097. The regrename pass does not rename the registers which are in notes, because of which the REG_DEAD note had previous register names, which caused conflicting liveness information generated for tag collision pass. It is better to do it in regrename_do_replace instead while regrename_analyze, because the note information does not really contribute into the regrename analysis, hence need not be added in the def-use chains that are computed. regrename_do_replace is where the decision to finally rename the register is made - where the note can be altered with new regname. Other notes need not be changed, as they don't hold renamed register information. Ok for trunk? Changelog: 2018-10-09 Sameera Deshpande loc); struct reg_attrs *attr = REG_ATTRS (*chain->loc); int reg_ptr = REG_POINTER (*chain->loc); + rtx note; if (DEBUG_INSN_P (chain->insn) && REGNO (*chain->loc) != base_regno) validate_change (chain->insn, &(INSN_VAR_LOCATION_LOC (chain->insn)), @@ -986,6 +987,11 @@ regrename_do_replace (struct du_head *head, int reg) last_reg = *chain->loc; } validate_change (chain->insn, chain->loc, last_repl, true); + note = find_regno_note (chain->insn, REG_DEAD, base_regno); + if (note != 0) + { + validate_change (chain->insn, &XEXP (note, 0), last_repl, true); + } } }