public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/55346] New: var-tracking generates incomplete/inaccurate debug info
@ 2012-11-15 19:53 eager at eagercon dot com
  2012-11-15 19:54 ` [Bug rtl-optimization/55346] " eager at eagercon dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: eager at eagercon dot com @ 2012-11-15 19:53 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55346
           Summary: var-tracking generates incomplete/inaccurate debug
                    info
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eager@eagercon.com


Created attachment 28703
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28703
Test program

Var-tracking is does not record the lifetime of variables allocated to
registers correctly, resulting in gdb displaying the variable as "optimized
out" when it is live.  I've confirmed this problem on x86 and arm.  

The test case is a loop which parses command line options, indexed by integer
variable argno.  When compiled with "-g -O2", argno is allocated to rbx, which
is never reused.  The DWARF location list which is generated from
NOTE_INSN_VAR_LOCATION insns, shows disjoint allocations for argno, omitting PC
ranges where the variable is live in rbx.

The DWARF location list has argno as literal 1 beyond the instruction where it
is allocated to rbx.  Argno is defined as rbx starts several instructions after
it is allocated and ends premature.

Var-tracking inserts a NOTE_INSN_VAR_LOCATION for argno as const int 1 at the
start of the BB #2, but one is not inserted when argno is allocated to rbx
later in BB #2.  One is generated later, in BB #5.

Var-tracking inserts a (nil) NOTE_INSN_VAR_LOCATION for argno after BB #3
(branch to epilogue), although argno is live and is used in BB #4, immediately
following BB #3.  Either this should not be generated or another
NOTE_INSN_VAR_LOCATION for argno should be generated at the start of BB #4.


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

end of thread, other threads:[~2012-11-19 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 19:53 [Bug rtl-optimization/55346] New: var-tracking generates incomplete/inaccurate debug info eager at eagercon dot com
2012-11-15 19:54 ` [Bug rtl-optimization/55346] " eager at eagercon dot com
2012-11-15 21:42 ` jakub at gcc dot gnu.org
2012-11-15 22:37 ` eager at eagercon dot com
2012-11-19 22:00 ` eager at eagercon dot com
2012-11-19 22:31 ` jakub at gcc dot gnu.org

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).