Bug 53118 - [9/10/11/12 regression] -feliminate-dwarf2-dups is broken for C++
Summary: [9/10/11/12 regression] -feliminate-dwarf2-dups is broken for C++
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.7.0
: P4 normal
Target Milestone: 9.5
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks: 46102 47361
  Show dependency treegraph
 
Reported: 2012-04-25 15:20 UTC by Jason Merrill
Modified: 2021-08-25 19:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.7.4
Last reconfirmed: 2014-06-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Merrill 2012-04-25 15:20:19 UTC
As noted in http://gcc.gnu.org/ml/gcc-help/2010-09/msg00081.html , -feliminate-dwarf2-dups has been broken for C++ ever since GCC 4.0; the front end now tokenizes the entire input before doing any parsing, so the calls to dwarf2out_{start,end}_source_file are all clustered at the beginning rather than properly wrapping the contents of headers.

Testcase from that message:

------ source file bar.c: --------
#include "foo.h"
#include "bar.h"

struct Foo myfoo;
struct Bar mybar;
----------------------------------

------ header file foo.h: --------
struct Foo {
    double d_foo;
    int i_foo;
};
----------------------------------

------ header file bar.h: --------
struct Bar {
    double d_bar;
    int i_bar;
    char c_bar;
};
----------------------------------
Comment 1 Richard Biener 2012-07-02 12:15:03 UTC
The 4.5 branch is being closed, adjusting target milestone.
Comment 2 Jakub Jelinek 2013-04-12 15:16:31 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 3 Richard Biener 2014-06-12 13:07:15 UTC
Assuming fixed in 4.8.0.
Comment 4 Jason Merrill 2014-06-12 13:39:07 UTC
Not fixed.
Comment 5 Aldy Hernandez 2015-02-26 15:54:04 UTC
-feliminate-dwarf2-dups has been disabled for C++ (see PR46102).  However, as noted by Ian in the thread in #c1, there are better ways of removing duplicates in dwarf4.  Consequently, I don't believe this should be in the "serious regression" category.  Downgrading.
Comment 6 Jason Merrill 2015-03-02 21:05:05 UTC
(In reply to Aldy Hernandez from comment #5)
> -feliminate-dwarf2-dups has been disabled for C++ (see PR46102).  However,
> as noted by Ian in the thread in #c1, there are better ways of removing
> duplicates in dwarf4.

FWIW I don't know if I agree that .debug_types is "better"; there's currently no way to refer to children of the type, so we end up creating "skeleton" DIEs in the main CU anyway.
Comment 7 Jakub Jelinek 2016-04-27 10:57:40 UTC
GCC 6.1 has been released.
Comment 8 Jakub Jelinek 2018-10-26 10:20:59 UTC
GCC 6 branch is being closed
Comment 9 Richard Biener 2019-11-14 07:56:34 UTC
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
Comment 10 Jakub Jelinek 2020-03-04 09:50:34 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 11 Jakub Jelinek 2021-05-14 09:46:39 UTC
GCC 8 branch is being closed.
Comment 12 Richard Biener 2021-06-01 08:05:36 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 13 Andrew Pinski 2021-08-25 19:52:34 UTC
-feliminate-dwarf2-dups was removed in GCC 8 by r8-2622 so closing as won't fix.