From patchwork Thu May 3 22:46:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 156782 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]) by ozlabs.org (Postfix) with SMTP id C82FAB6FD0 for ; Fri, 4 May 2012 08:47:00 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1336690022; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:From:To:Cc:Cc:Subject:References:Date: In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=uNBsyGcCGq/QN+O71pTf TNJ6HoA=; b=O0U5l5V++Php92plEV4SxpCVmdaCcu9jqTQAnwQ7tsIsVc2agWSg 1lxEOY61tfi6FkO6dD4QeofU7KTXeQHrE02dN+2r5/3XI8HDqa/Hn4DFUUpTb05X 2rn0M6mnl4xJomqowk543HwDDyFVgabmSz4bV7gWW/a37F7GPhQgANw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:From:To:Cc:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=u3FDwnzlV/5ORFux86f7PaO4PEHyBWhoOzewmMr3WrigwIDY6wpcnvQzydcJXi BLzXKOMFOYclcY7k9nnLtyf6MO3wws7izM3kgCuqoPw8sjStOl9SZLPU/4ekaZCy U9Mg1lK905oB7tVKVx9jutPYsKXa28+X1X473j7r1XYbo=; Received: (qmail 16100 invoked by alias); 3 May 2012 22:46:54 -0000 Received: (qmail 16085 invoked by uid 22791); 3 May 2012 22:46:52 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 22:46:39 +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 (8.14.4/8.14.4) with ESMTP id q43MkQYO007145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 May 2012 18:46:26 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q43MkNCX028109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 May 2012 18:46:25 -0400 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.5/8.14.5) with ESMTP id q43MkKrj031929; Thu, 3 May 2012 19:46:20 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q43MkJHt014132; Thu, 3 May 2012 19:46:19 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q43MkHoF014130; Thu, 3 May 2012 19:46:17 -0300 From: Alexandre Oliva To: jakub@redhat.com Cc: gcc-patches@gcc.gnu.org, Eric Botcazou Cc: Paolo Bonzini Subject: Re: [PR52983, PR48866] eliminate autoinc from debug_insn locs References: <201204091541.27484.ebotcazou@adacore.com> <4F885824.7090405@gnu.org> Date: Thu, 03 May 2012 19:46:17 -0300 In-Reply-To: (Alexandre Oliva's message of "Thu, 03 May 2012 15:26:40 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 On May 3, 2012, Alexandre Oliva wrote: > My recent patch for PR48866 ... had some inconsistency in behavior between dce and word_dce, as you pointed out. I couldn't find any reason for that, so I made them the same. Regstrapped on x86_64-linux-gnu and i686-linux-gnu, no regressions detected by the testsuite, but I'm concerned about potential debug info regressions, which I'm yet to test. Once I'm convinced it doesn't regress debug info, is this ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/52983 PR debug/48866 * dce.c (word_dce_process_block): Insert debug temps only if the insn is not marked. (dce_process_block): Likewise, and if debug.used is not empty, and only after iterating over all DEFs that might mark the insn. Index: gcc/dce.c =================================================================== --- gcc/dce.c.orig 2012-05-03 15:49:35.324670988 -0300 +++ gcc/dce.c 2012-05-03 15:57:33.000000000 -0300 @@ -858,8 +858,9 @@ word_dce_process_block (basic_block bb, anything in local_live. */ if (marked_insn_p (insn)) df_word_lr_simulate_uses (insn, local_live); - - if (debug.used && !bitmap_empty_p (debug.used)) + /* Insert debug temps for dead REGs used in subsequent debug + insns. */ + else if (debug.used && !bitmap_empty_p (debug.used)) { df_ref *def_rec; @@ -940,18 +941,13 @@ dce_process_block (basic_block bb, bool /* The insn is needed if there is someone who uses the output. */ if (!needed) for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) - { - dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn, - DEBUG_TEMP_BEFORE_WITH_VALUE); - - if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec)) - || bitmap_bit_p (au, DF_REF_REGNO (*def_rec))) - { - needed = true; - mark_insn (insn, true); - break; - } - } + if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec)) + || bitmap_bit_p (au, DF_REF_REGNO (*def_rec))) + { + needed = true; + mark_insn (insn, true); + break; + } /* No matter if the instruction is needed or not, we remove any regno in the defs from the live set. */ @@ -961,6 +957,12 @@ dce_process_block (basic_block bb, bool anything in local_live. */ if (needed) df_simulate_uses (insn, local_live); + /* Insert debug temps for dead REGs used in subsequent debug + insns. */ + else if (debug.used && !bitmap_empty_p (debug.used)) + for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) + dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn, + DEBUG_TEMP_BEFORE_WITH_VALUE); } dead_debug_finish (&debug, NULL);