This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/55579] New: SRA doesn't create debug stmts when they would be useful
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Dec 2012 20:30:39 +0000
- Subject: [Bug debug/55579] New: SRA doesn't create debug stmts when they would be useful
- Auto-submitted: auto-generated
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.