From patchwork Thu Dec 10 18:04:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 555242 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 D28D1140307 for ; Fri, 11 Dec 2015 05:04:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=pv4UH2rG; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=JSF3VGrR60KOb8er6APb5JnFWcPIxU6/9kQ2ewEv2q2eVb cpglb7vUfPwBYm9QalMF8u9gEr8d1sN+TI0ODcECrR/0EasvkctVONViQCv0X2EW BPnrUEQ2xhO6vr8NPGmuNaZmRnOyEOE9DEF+bGG/5qzdqN2xO0+XtjUizJV/E= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=tJWiF2//iNU0QTrDbJr2qfxtey4=; b=pv4UH2rG4KhID8FZvEwj jMlj37YVhz7u6lhrqQltztZP+d2zGqthPFWHoCzcHZZ8gx9usZZ/quJ6urAf+3mP TNDBrO0iknYzGzAejMUuuj6QVg4FqPpUZgermoT3+d3ygZR+/yN9CmIf0xYXmEEj JrEuniZ59ZQDfRtj+N/VEEw= Received: (qmail 97286 invoked by alias); 10 Dec 2015 18:04:14 -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 97257 invoked by uid 89); 10 Dec 2015 18:04:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 10 Dec 2015 18:04:10 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1D4FEC00040E for ; Thu, 10 Dec 2015 18:04:09 +0000 (UTC) Received: from topor.usersys.redhat.com (unused-10-15-17-214.yyz.redhat.com [10.15.17.214]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBAI48v0016019 for ; Thu, 10 Dec 2015 13:04:08 -0500 Message-ID: <5669BE98.10801@redhat.com> Date: Thu, 10 Dec 2015 13:04:08 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: gcc-patches Subject: Patch to fix PR68691 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68691 The patch was bootstrapped and tested on x86/x86-64. Committed as rev. 231538. Index: ChangeLog =================================================================== --- ChangeLog (revision 231537) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2015-12-10 Vladimir Makarov + + PR rtl-optimization/68691 + * lra-spills.c (lra_final_code_change): Check pseudo occurrence + number in non-debug insns and remove debug insns if necessary. + 2015-12-10 Martin Sebor * invoke.texi (Warning Options): Update -Wall options. Clarify Index: lra-spills.c =================================================================== --- lra-spills.c (revision 231423) +++ lra-spills.c (working copy) @@ -708,6 +708,30 @@ lra_final_code_change (void) } lra_insn_recog_data_t id = lra_get_insn_recog_data (insn); + struct lra_insn_reg *reg; + + for (reg = id->regs; reg != NULL; reg = reg->next) + if (reg->regno >= FIRST_PSEUDO_REGISTER + && lra_reg_info [reg->regno].nrefs == 0) + break; + + if (reg != NULL) + { + /* Pseudos still can be in debug insns in some very rare + and complicated cases, e.g. the pseudo was removed by + inheritance and the debug insn is not EBBs where the + inheritance happened. It is difficult and time + consuming to find what hard register corresponds the + pseudo -- so just remove the debug insn. Another + solution could be assigning hard reg/memory but it + would be a misleading info. It is better not to have + info than have it wrong. */ + lra_assert (DEBUG_INSN_P (insn)); + lra_invalidate_insn_data (insn); + delete_insn (insn); + continue; + } + struct lra_static_insn_data *static_id = id->insn_static_data; bool insn_change_p = false; Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 231537) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2015-12-10 Vladimir Makarov + + PR rtl-optimization/68691 + * gcc.target/i386/pr68691.c: New. + 2015-12-10 David Malcolm * lib/multiline.exp (_multiline_expected_outputs): Update comment. Index: testsuite/gcc.target/i386/pr68691.c =================================================================== --- testsuite/gcc.target/i386/pr68691.c (revision 0) +++ testsuite/gcc.target/i386/pr68691.c (working copy) @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -g" } */ + +char a, b, i, j; +int c, d, e, f, g, h, n; + +char +fn1 () +{ + char k, l, m; + int p; + e = g > f; + for (b = 0; b < 2; b++) + { + for (p = 0; p < 3; p++) + { + for (; h < 1; h++) + { + for (; m;) + goto lbl; + e = g; + } + l = a < 0 || a < d; + } + d++; + for (;;) + { + k = g; + n = -k; + j = n; + c = j; + e = 2; + if (l) + break; + return 2; + } + } + for (;;) + ; + lbl: + return i; +}