public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/54508] New: Wrong debug information emitted if data members not referenced
@ 2012-09-06 18:55 paul_koning at dell dot com
  2012-09-13 21:22 ` [Bug debug/54508] " paul_koning at dell dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: paul_koning at dell dot com @ 2012-09-06 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54508
           Summary: Wrong debug information emitted if data members not
                    referenced
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: paul_koning@dell.com


Created attachment 28142
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28142
test case file

For the attached test case, GDB shows that the class definition for
CIpcDumpACK_NP is wrong.  Only the method is shows; the base class and data
member are missing.


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
@ 2012-09-13 21:22 ` paul_koning at dell dot com
  2012-09-17 21:31 ` paul_koning at dell dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paul_koning at dell dot com @ 2012-09-13 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Paul Koning <paul_koning at dell dot com> 2012-09-13 21:21:58 UTC ---
I spent some time trying to figure this out.  The offending code seems to be
the prune_unused_types machinery.  

If there is a reference to a static method, but no other references to parts of
the class, then the class is treated as unused.  However, the static method
does cause the class name to be emitted in the dwarf output.  But because of
the fact that it is treated as unused, nothing else about the class is emitted.

This messes up code that consumes the debug data, because it now looks like the
class IS defined there, but most of its substance is missing.

Meanwhile, I noticed a documentation bug: the documentation for
-feliminate-unused-debug-types says that this switch is off by default.  That
is no longer true, it is on by default.  If I turn it off, the
prune_unused_types machinery is suppressed and I get valid debug output. 
Unfortunately, it is also so much larger that my builds run very slowly and
some binaries grow by as much as a factor of 5.


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
  2012-09-13 21:22 ` [Bug debug/54508] " paul_koning at dell dot com
@ 2012-09-17 21:31 ` paul_koning at dell dot com
  2012-09-24 19:32 ` paul_koning at dell dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paul_koning at dell dot com @ 2012-09-17 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paul Koning <paul_koning at dell dot com> 2012-09-17 21:31:29 UTC ---
I just submitted a proposed fix to the gcc-patches list.


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
  2012-09-13 21:22 ` [Bug debug/54508] " paul_koning at dell dot com
  2012-09-17 21:31 ` paul_koning at dell dot com
@ 2012-09-24 19:32 ` paul_koning at dell dot com
  2012-10-23 18:44 ` pkoning at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paul_koning at dell dot com @ 2012-09-24 19:32 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paul Koning <paul_koning at dell dot com> 2012-09-24 19:32:21 UTC ---
Created attachment 28260
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28260
Fix and testcase for this, as submitted to the gcc-bugs list

I'm not sure if the main submission should be here or to gcc-bugs -- I posted a
fix there a week ago.  Attached is what I submitted (including a small
adjustment to the regexp used in the testcase file).


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
                   ` (2 preceding siblings ...)
  2012-09-24 19:32 ` paul_koning at dell dot com
@ 2012-10-23 18:44 ` pkoning at gcc dot gnu.org
  2012-10-23 18:53 ` paul_koning at dell dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pkoning at gcc dot gnu.org @ 2012-10-23 18:44 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from pkoning at gcc dot gnu.org 2012-10-23 18:44:33 UTC ---
Author: pkoning
Date: Tue Oct 23 18:44:27 2012
New Revision: 192739

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192739
Log:
PR debug/54508
* dwarf2out.c (prune_unused_types_prune): If pruning a class and
not all its children were marked, add DW_AT_declaration flag.

* g++.dg/debug/dwarf2/pr54508.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
                   ` (3 preceding siblings ...)
  2012-10-23 18:44 ` pkoning at gcc dot gnu.org
@ 2012-10-23 18:53 ` paul_koning at dell dot com
  2013-01-29 17:50 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paul_koning at dell dot com @ 2012-10-23 18:53 UTC (permalink / raw)
  To: gcc-bugs


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

Paul Koning <paul_koning at dell dot com> changed:

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

--- Comment #5 from Paul Koning <paul_koning at dell dot com> 2012-10-23 18:53:28 UTC ---
Fixed in trunk.


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
                   ` (4 preceding siblings ...)
  2012-10-23 18:53 ` paul_koning at dell dot com
@ 2013-01-29 17:50 ` jason at gcc dot gnu.org
  2013-01-31 18:29 ` jason at gcc dot gnu.org
  2013-01-31 18:30 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2013-01-29 17:50 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
             Blocks|                            |55059

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-29 17:50:20 UTC ---
This patch caused bug 55059; I think we need a different solution.


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
                   ` (5 preceding siblings ...)
  2013-01-29 17:50 ` jason at gcc dot gnu.org
@ 2013-01-31 18:29 ` jason at gcc dot gnu.org
  2013-01-31 18:30 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2013-01-31 18:29 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-31 18:29:24 UTC ---
Author: jason
Date: Thu Jan 31 18:29:15 2013
New Revision: 195622

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195622
Log:
    PR debug/55059
    PR debug/54508
    * dwarf2out.c (prune_unused_types_mark): Mark all of parent's
    children if parent is a class.
    (prune_unused_types_prune): Don't add DW_AT_declaration.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/localclass1.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/localclass2.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C


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

* [Bug debug/54508] Wrong debug information emitted if data members not referenced
  2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
                   ` (6 preceding siblings ...)
  2013-01-31 18:29 ` jason at gcc dot gnu.org
@ 2013-01-31 18:30 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2013-01-31 18:30 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-31 18:30:32 UTC ---
I backed out Paul's later patch in favor of the earlier one from

http://gcc.gnu.org/ml/gcc-patches/2012-10/msg00450.html


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

end of thread, other threads:[~2013-01-31 18:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 18:55 [Bug debug/54508] New: Wrong debug information emitted if data members not referenced paul_koning at dell dot com
2012-09-13 21:22 ` [Bug debug/54508] " paul_koning at dell dot com
2012-09-17 21:31 ` paul_koning at dell dot com
2012-09-24 19:32 ` paul_koning at dell dot com
2012-10-23 18:44 ` pkoning at gcc dot gnu.org
2012-10-23 18:53 ` paul_koning at dell dot com
2013-01-29 17:50 ` jason at gcc dot gnu.org
2013-01-31 18:29 ` jason at gcc dot gnu.org
2013-01-31 18:30 ` jason 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).