From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27303 invoked by alias); 2 Sep 2003 00:39:55 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27296 invoked from network); 2 Sep 2003 00:39:54 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 2 Sep 2003 00:39:54 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 19tzD7-0003mz-Vs for ; Mon, 01 Sep 2003 20:39:53 -0400 Date: Tue, 02 Sep 2003 00:39:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: gcc HEAD moves line number directives -- gcc bug? Message-ID: <20030902003953.GA14529@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <200309011713.h81HDtHx003770@duracef.shout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309011713.h81HDtHx003770@duracef.shout.net> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-09/txt/msg00005.txt.bz2 On Mon, Sep 01, 2003 at 01:13:55PM -0400, Michael Elizabeth Chastain wrote: > Look at the code near 'call foo'. In gcc 3.3.1, the .loc lines > match the source code. In gcc HEAD, the .loc line for line 24 > has migrated. > > Source code: > > /* 23 */ foo (); > /* 24 */ a += 2; > > gcc 3.3.1 output: > > .loc 1 23 0 > call foo > .loc 1 24 0 > leal -4(%ebp), %eax > addl $2, (%eax) > > gcc HEAD output: > > .loc 1 23 0 > call foo > leal -4(%ebp), %eax // this insn is part of line 24 > .loc 1 24 0 // this moved! > addl $2, (%eax) > > This happens with explicit "-O0" in the command line. > > This causes some mild confusion with gdb. Specifically, an 'until' > command on foo returns and says it is on line 24 with gcc 3.3.1, > but on line 23 with gcc HEAD. > > I isolated the patch that caused this: > > http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00430.html > Jan Hubicka - Line number handling in RTL reorganization > > Do you think this is a bug in gcc? I do, but I need to check here > before filing a bug report with gcc. Maybe, maybe not... our testsuite certainly must accept returning to both line 23 and 24. There are a number of architecures where a function call includes instructions after the return (stack adjustment, $gp reload...). Line 24 is the addl. The leal is generated probably in reload; it's not really part of any line, even though it was generated for line 24. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer