public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/54971] New: SRA pessimizes debug info by not creating debug stmts for fields without replacements
@ 2012-10-18  9:48 jakub at gcc dot gnu.org
  2012-10-18 13:35 ` [Bug debug/54971] " jakub at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-18  9:48 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54971
           Summary: SRA pessimizes debug info by not creating debug stmts
                    for fields without replacements
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: jamborm@gcc.gnu.org


Consider the testcase in PR54970, or the following one.

int
main ()
{
  int a[] = { 1, 2, 3 };
  int *p = a + 2;
  int *q = a + 1;
  asm volatile ("nop");
  *p += 10;
  asm volatile ("nop");
  *q += 10;
  asm volatile ("nop");
  __builtin_memcpy (&a, (int [3]) { 4, 5, 6 }, sizeof (a));
  asm volatile ("nop");
  *p += 10;
  asm volatile ("nop");
  *q += 10;
  asm volatile ("nop");
  return 0;
}

For a[1] and a[2] replacements are created and we eventually get corret debug
info, tracking the value changes of those array elements.
But for a[0] SRA decides not to create a replacement, as it seems to be only
assigned and never read (in PR54970 testcase just once, in the above testcase
twice).
Would it be possible for MAY_HAVE_DEBUG_STMTS to create also replacements for
those fields/elements that are only ever assigned, and at the places they used
to be assigned instead of setting the replacement to the value it should have
create a debug bind stmt?  In the above testcase that would be at the place
of former a[0] = 1; add DEBUG a$0 => 1 stmt (where a$0's DECL_DEBUG_EXPR would
be a[0]), and at the point of the MEM[&a, 0] = MEM[something, 0] assignment
DEBUG a$0 => 4 ?


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

end of thread, other threads:[~2013-01-04 14:41 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18  9:48 [Bug debug/54971] New: SRA pessimizes debug info by not creating debug stmts for fields without replacements jakub at gcc dot gnu.org
2012-10-18 13:35 ` [Bug debug/54971] " jakub at gcc dot gnu.org
2012-10-18 17:37 ` jamborm at gcc dot gnu.org
2012-10-19 16:01 ` jamborm at gcc dot gnu.org
2012-10-22 14:56 ` jamborm at gcc dot gnu.org
2012-10-22 15:09 ` jakub at gcc dot gnu.org
2012-10-22 15:14 ` jamborm at gcc dot gnu.org
2012-10-22 16:19 ` jakub at gcc dot gnu.org
2012-10-22 20:00 ` jakub at gcc dot gnu.org
2012-10-26  9:33 ` jamborm at gcc dot gnu.org
2012-10-26 16:13 ` jamborm at gcc dot gnu.org
2012-10-26 19:20 ` jakub at gcc dot gnu.org
2012-10-27 17:30 ` jakub at gcc dot gnu.org
2012-10-29  8:36 ` jakub at gcc dot gnu.org
2012-10-29 15:20 ` rguenth at gcc dot gnu.org
2012-10-29 15:26 ` jakub at gcc dot gnu.org
2012-11-05 14:37 ` jakub at gcc dot gnu.org
2013-01-04 14:41 ` jamborm 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).