From patchwork Fri Nov 28 01:44:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 415769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 635441401AB for ; Fri, 28 Nov 2014 12:47:10 +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 :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=LOG+OcToO0wNd0rwWfx P1Kq0+B5ZSIVf38n4Lh5fMtCNwezPmSgltiOl3lJs2iXPNW4FV2gzINLIQa4KpSA zZKe6KcHrRaIcn1HIAwHDiNv5P1StHwKPJV/Oj8ivjov6paHUPgYCbN1BzdxuQhy USQSCEJvvFwq2CbOyPpLEh/Q= 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 :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=RGECRaqtq19cKQ7Ft2YM4TLKw gk=; b=l06mTWMpa3+LqaPc60IwjNM/SI6vglm7Z2z2/V0T7MDEuQj9nU8FeW1bl jby3vXOkmj7GgNSJFQ2/HcOePr10lh/1q7R2BT1NS1DizDTo5MmFxxoYg5W2j77I hAdbvTtrhVIMVh5RK1ogJbY2xoZsJXiRnGjC3xTcdKmdErea6w= Received: (qmail 1274 invoked by alias); 28 Nov 2014 01:46:52 -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 1167 invoked by uid 89); 28 Nov 2014 01:46:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 28 Nov 2014 01:46:50 +0000 Received: from gcc1-power7.osuosl.org (localhost [127.0.0.1]) by gcc1-power7.osuosl.org (8.14.6/8.14.6) with ESMTP id sAS1klNx015791; Thu, 27 Nov 2014 17:46:47 -0800 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id sAS1kicV015754; Thu, 27 Nov 2014 17:46:44 -0800 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH 5/6] combine: handle REG_UNUSED in reg_dead_at_p (PR59278) Date: Thu, 27 Nov 2014 17:44:35 -0800 Message-Id: <2722d25dd8dd4c358b092a67c28042d3e9d93af5.1417135738.git.segher@kernel.crashing.org> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Currently reg_dead_at_p returns 0 for registers that are set but never used. This patch repairs that oversight. This fixes PR59278. 2014-11-27 Segher Boessenkool gcc/ PR rtl-optimization/59278 combine (reg_dead_at_p): Consider REG_UNUSED notes. --- gcc/combine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/combine.c b/gcc/combine.c index 83a0a10..91ddff4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -12990,6 +12990,9 @@ reg_dead_at_p (rtx reg, rtx_insn *insn) { if (INSN_P (insn)) { + if (find_regno_note (insn, REG_UNUSED, reg_dead_regno)) + return 1; + note_stores (PATTERN (insn), reg_dead_at_p_1, NULL); if (reg_dead_flag) return reg_dead_flag == 1 ? 1 : 0;