From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25322 invoked by alias); 9 Nov 2007 11:28:02 -0000 Received: (qmail 25196 invoked by uid 22791); 9 Nov 2007 11:28:01 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Nov 2007 11:27:54 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4A7D727B2C; Fri, 9 Nov 2007 12:27:51 +0100 (CET) Date: Fri, 09 Nov 2007 14:23:00 -0000 From: Michael Matz To: Alexandre Oliva Cc: Robert Dewar , Richard Guenther , gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Subject: Re: Designs for better debug info in GCC In-Reply-To: Message-ID: References: <84fc9c000711050327x74845c78ya18a3329fcf9e4d2@mail.gmail.com> <47331636.9010308@adacore.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes 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-11/txt/msg00272.txt.bz2 Hi, On Thu, 8 Nov 2007, Alexandre Oliva wrote: > > If you want to be really sure no arguments disappear (necessary for > > instance for meaningful use of systemtap) you also need to inhibit > > some transformations, > > I'm not aware of any situations in which we must force an argument not > to disappear. All of the problems I'm aware of are those in which the > argument is there, we're just missing debug information for it. If you > have information about needs for preserving arguments that are actually > dead, please send it my way. ------------------------------------ static inline int foo(int i) { return i-1; } int foobar(int j) { return foo(j+2); } int main(int argc, char **argv) { return foobar(argc); } ------------------------------------ And similar examples. Depending on circumstances the formal argument 'i' of "foo" might be optimized away. If you want to use systemtap to show the actual arguments for all calls to foo, even the inlined ones, then you somehow have to make sure that the value of 'i' itself is not optimized away. Again, in this specific case, due to the simplicity of the involved expression, it would theoretically be possible to express this with just DWARF expressions (relating to the formal argument 'j' of foobar). In more complicated situtation that's not possible anymore, at which point you have to force the value of 'i' being live, if you want to be sure that systemtap works in all cases. > > during the next months, i.e. improve code quality at -O0 at least to a > > point it was in the 3.x line of GCC. > > Aah, I guess the problem here is all the gimple-introduced temps, > right? That our current -O0 is more like -O-1? :-) Indeed :) Perhaps also doing a simple DCE and local regalloc, none of which inhibits debugging. Ciao, Michael.