public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/26475]  New: tree-ssa loses line numbers for initializations
@ 2006-02-26 21:02 drow at gcc dot gnu dot org
  2006-02-27 21:13 ` [Bug debug/26475] " drow at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: drow at gcc dot gnu dot org @ 2006-02-26 21:02 UTC (permalink / raw)
  To: gcc-bugs

Here's a simple testcase.  Compile with -O2 and look at the
-fdump-tree-all-lineno dumps:

int foo (int);
int bar (int a)
{
  int ndir = 0;
  int b;

  b = foo (a);
  while (b--)
    ndir = foo (ndir);
}

Early on, the ndir = 0 assignment is marked for line 4.  Then the 0 gets
propogated into a phi without a line number, which ends up associated with the
while loop (in a larger testcase, with the end of the instruction before the
loop instead of the start of the loop - not sure why a difference).  The
original assignment is DCE'd.

Then an exactly identical initialization is rematerialized (not surprising),
and the closest line number we could find was the line number of the statement
before the phi.

Obviously stepping over this in GDB looks unnecessarily strange.

Perhaps some PHI arguments could have line number information to be used on
edges when coming out of SSA?

FYI, original testcase comes from GDB's selftest.exp; we get a very surprising
line number associated with the first real instruction.


-- 
           Summary: tree-ssa loses line numbers for initializations
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drow at gcc dot gnu dot org
  GCC host triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26475


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-30 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-26 21:02 [Bug debug/26475] New: tree-ssa loses line numbers for initializations drow at gcc dot gnu dot org
2006-02-27 21:13 ` [Bug debug/26475] " drow at gcc dot gnu dot org
2008-02-10 14:51 ` [Bug debug/26475] tree-ssa loses line numbers for initializations (constants for PHIs) manu at gcc dot gnu dot org
2009-07-24 23:40 ` manu at gcc dot gnu dot org
2009-07-25  9:50 ` rguenth at gcc dot gnu dot org
2009-07-30 18:40 ` amacleod at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).