public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/54971] New: SRA pessimizes debug info by not creating debug stmts for fields without replacements
Date: Thu, 18 Oct 2012 09:48:00 -0000	[thread overview]
Message-ID: <bug-54971-4@http.gcc.gnu.org/bugzilla/> (raw)


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 ?


             reply	other threads:[~2012-10-18  9:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  9:48 jakub at gcc dot gnu.org [this message]
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

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=bug-54971-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).