From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1199 invoked by alias); 18 Dec 2007 04:29:54 -0000 Received: (qmail 1141 invoked by uid 22791); 18 Dec 2007 04:29:53 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Dec 2007 04:29:47 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id lBI4RMTX027094; Mon, 17 Dec 2007 23:27:22 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lBI4RMAR028637; Mon, 17 Dec 2007 23:27:22 -0500 Received: from livre.oliva.athome.lsd.ic.unicamp.br (vpn-15-63.rdu.redhat.com [10.11.15.63]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lBI4RK16014957; Mon, 17 Dec 2007 23:27:21 -0500 Received: from livre.oliva.athome.lsd.ic.unicamp.br (localhost.localdomain [127.0.0.1]) by livre.oliva.athome.lsd.ic.unicamp.br (8.14.2/8.14.1) with ESMTP id lBI4RJPI027985; Tue, 18 Dec 2007 02:27:19 -0200 Received: (from aoliva@localhost) by livre.oliva.athome.lsd.ic.unicamp.br (8.14.2/8.14.1/Submit) id lBI4RGrT027984; Tue, 18 Dec 2007 02:27:16 -0200 To: Joe Buck Cc: Geert Bosch , Daniel Berlin , Diego Novillo , Mark Mitchell , Robert Dewar , Ian Lance Taylor , Richard Guenther , gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Subject: Re: Designs for better debug info in GCC References: <4749DE66.1090602@codesourcery.com> <4756B02D.9010302@google.com> <4aca3dc20712151903r46c9eceane35edb92d08240ac@mail.gmail.com> <4aca3dc20712161712w1133fb96qd66be0e9a0bb1716@mail.gmail.com> <20071217012735.GA9275@synopsys.com> <8DF14649-456C-40D6-94C5-DC3285EFD7C2@adacore.com> <20071218012438.GD2908@synopsys.com> From: Alexandre Oliva Errors-To: aoliva@oliva.athome.lsd.ic.unicamp.br Date: Tue, 18 Dec 2007 04:40:00 -0000 In-Reply-To: <20071218012438.GD2908@synopsys.com> (Joe Buck's message of "Mon\, 17 Dec 2007 17\:24\:38 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00506.txt.bz2 On Dec 17, 2007, Joe Buck wrote: > On Mon, Dec 17, 2007 at 11:11:46PM -0200, Alexandre Oliva wrote: >> Line number information has a well-defined meaning: it ought to >> represent the source code line that best represents the source-code >> construct that ended up implemented using that instruction. > You implicitly assume that souch a source code line exists. Actually, no. I'm not sure where you got that impression, and how you came to the conclusion that I'd assign line numbers the way you have. To me, when you hoist something that is present in both blocks of a conditional, it probably makes more sense to give it the line number of the conditional, rather than that of either block. But I won't pretend to have thought very hard about this particular issue. For the time being, I'm focusing my efforts on local variable locations. Anyhow, very clearly you don't want to mark such hoisted-out computation as is_stmt. This should eliminate at least the solvable problem you're worried about. > out = a + b; > if (!cond) > out += c; > return out; > Furthermore, there isn't a place to put a breakpoint that will > trigger only for the case where cond is true, as you can on > unoptimized code. Yep. Sometimes code just is optimized away. Can't stop that without harming optimizations. If dwarf line number programs were smarter, we could perhaps encode multiple lines for the same instruction, along with conditions to tell when the instruction applies to such or such lines, and even more fancy stuff like that. But line number programs don't let us express this in Dwarf3. -- Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/ FSF Latin America Board Member http://www.fsfla.org/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}