public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/55579] New: SRA doesn't create debug stmts when they would be useful
@ 2012-12-03 20:31 jakub at gcc dot gnu.org
  2012-12-04  9:39 ` [Bug debug/55579] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-03 20:31 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55579
           Summary: SRA doesn't create debug stmts when they would be
                    useful
    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 -g -O2:
struct S { int a; char b; char c; short d; };

int
foo (int x)
{
  struct S s = { x + 1, x + 2, x + 3, x + 4 };
  char *p = &s.c;
  return x;
}
Unfortunately, SRA doesn't add here any debug stmts and everything is DSEd
later on.
*.esra dump says:
Candidate (1722): s
Marking s offset: 0, size: 32  to be replaced with debug statements.
Marking s offset: 32, size: 8  to be replaced with debug statements.
Marking s offset: 40, size: 8  to be replaced with debug statements.
Marking s offset: 48, size: 16  to be replaced with debug statements.
! Disqualifying s - No scalar replacements to be created.

If there are just debug replacements, no normal ones, and the aggregate still
has been candidate for SRA (i.e. no address escape, etc.), it would be nice if
the debug replacements could be emitted anyway.  CDDCE or DSE will then remove
the actual stmts, but debug info will be accurate.


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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 20:31 [Bug debug/55579] New: SRA doesn't create debug stmts when they would be useful jakub at gcc dot gnu.org
2012-12-04  9:39 ` [Bug debug/55579] " rguenth at gcc dot gnu.org
2012-12-06 16:59 ` jamborm at gcc dot gnu.org
2012-12-07 15:00 ` jamborm at gcc dot gnu.org
2012-12-14 11:46 ` jamborm at gcc dot gnu.org
2012-12-21  1:41 ` aoliva at gcc dot gnu.org
2013-01-04 13:02 ` jamborm at gcc dot gnu.org
2013-01-08 14:11 ` jamborm at gcc dot gnu.org
2013-01-08 14:15 ` 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).