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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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 ` rguenth at gcc dot gnu.org
  2012-12-06 16:59 ` jamborm at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-04  9:39 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-04
     Ever Confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-04 09:38:41 UTC ---
Confirmed.


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2012-12-06 16:59 UTC (permalink / raw)
  To: gcc-bugs


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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jamborm at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-12-06 16:58:58 UTC ---
Mine.


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2012-12-07 15:00 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-12-07 14:59:43 UTC ---
Created attachment 28896
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28896
Untested patch

I'm bootstrapping and testing this patch.


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2012-12-14 11:46 UTC (permalink / raw)
  To: gcc-bugs


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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28896|0                           |1
        is obsolete|                            |

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-12-14 11:46:16 UTC ---
Created attachment 28954
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28954
Another untested fix

Unfortunately, the previous patch had problems with debug comparisons.
At the moment I'm bootstrapping the new attached variant which
hopefully does not have this problem and which I'd like to then
submit for 4.8.

In the next stage1 I'd like to go a step further and not mark all
variables as disqualified candidates when analyze_access_trees decides
there are not replacements to be made for them which should make
access structures available to the function modification phase which
then can remove s few more assignments (e.g. to variables or parts of
variables which are never read).  But I'm still only experimenting
with that.


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2012-12-21  1:41 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2012-12-21 01:41:18 UTC ---
FWIW, the patch in comment 4 makes sense to me.  Thanks!


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-01-04 13:02 UTC (permalink / raw)
  To: gcc-bugs


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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2013-01/msg00180.htm
                   |                            |l

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-01-04 13:02:25 UTC ---
Patch posted to the mailing list:
http://gcc.gnu.org/ml/gcc-patches/2013-01/msg00180.html


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-01-08 14:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-01-08 14:10:52 UTC ---
Author: jamborm
Date: Tue Jan  8 14:10:44 2013
New Revision: 195015

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195015
Log:
2013-01-08  Martin Jambor  <mjambor@suse.cz>

    PR debug/55579
    * tree-sra.c (analyze_access_subtree): Return true also after
    potentially creating a debug-only replacement.

testsuite/
    * gcc.dg/tree-ssa/pr55579.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr55579.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c


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

* [Bug debug/55579] SRA doesn't create debug stmts when they would be useful
  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
                   ` (6 preceding siblings ...)
  2013-01-08 14:11 ` jamborm at gcc dot gnu.org
@ 2013-01-08 14:15 ` jamborm at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-01-08 14:15 UTC (permalink / raw)
  To: gcc-bugs


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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-01-08 14:14:49 UTC ---
Patch committed


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