From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19282 invoked by alias); 2 Jun 2011 15:26:33 -0000 Received: (qmail 19272 invoked by uid 22791); 2 Jun 2011 15:26:32 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Jun 2011 15:26:17 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AB399CB01EA; Thu, 2 Jun 2011 17:26:15 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lIiYVYIhT3Jo; Thu, 2 Jun 2011 17:26:12 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id A13CDCB01BA; Thu, 2 Jun 2011 17:26:12 +0200 (CEST) From: Eric Botcazou To: Alexandre Oliva Subject: Re: fix left-over debug insns in DCE Date: Thu, 02 Jun 2011 15:26:00 -0000 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201106021718.42782.ebotcazou@adacore.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00155.txt.bz2 > One of the issues was that DCE removed an insn that set a REG in a > certain mode, without adjusting a debug use of that REG. This was in > libstdc++, but I failed to take note of the affected file. DF later > attached that debug use to another SET to the same REG in a different, > incompatible mode. When that one was found to be dead by DF, we ended > up ICEing as we attempted to emit the invalid SUBREGs. > > I reused some of the infrastructure to propagate dead DEFs into debug > uses in DF to get DCE to emit debug temps and adjust debug uses as well, > fixing this issue. While at that, I improved the handling of unused > DEFs in DF, that previously resulted in loss of debug information, so as > to retain it as much as possible. Why can't the problem be addressed purely within DF? Starting to spill the DF logic to individual RTL passes doesn't look very appealing to me. > This is the patch I ended up with. Regstrapped on x86_64-linux-gnu and > i686-linux-gnu. Ok to install? OK for the usual debug insn bookkeeping, i.e. * dce.c (reset_unmarked_insns_debug_uses): New. (delete_unmarked_insns): Skip debug insns. (prescan_insns_for_dce): Likewise. (rest_of_handle_ud_dce): Propagate debug uses. * reg-stack.c (subst_stack_regs_in_debug_insn): Signal when no active reg can be found. (subst_all_stack_regs_in_debug_insn): New. Reset debug insn then. (convert_regs_1): Use it. The rest needs further discussing IMO. -- Eric Botcazou