Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: gcc HEAD moves line number directives -- gcc bug?
Date: Tue, 02 Sep 2003 00:39:00 -0000	[thread overview]
Message-ID: <20030902003953.GA14529@nevyn.them.org> (raw)
In-Reply-To: <200309011713.h81HDtHx003770@duracef.shout.net>

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


  reply	other threads:[~2003-09-02  0:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-01 17:13 Michael Elizabeth Chastain
2003-09-02  0:39 ` Daniel Jacobowitz [this message]
2003-09-02  3:28 Michael Elizabeth Chastain
2003-09-03 20:49 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030902003953.GA14529@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox