On 02/25/2015 07:59 AM, Jason Merrill wrote:
On 02/19/2015 11:50 AM, Jakub Jelinek wrote:
Wouldn't it be better to disable PCH reading if -feliminate-dwarf2-dups
is used?

In the abstract, perhaps, but given

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53118

I'd prefer to disable the useless thing.  :)

Patch attached.


We might actually disable -feliminate-dwarf2-dups entirely until that
bug is fixed.

Well technically, this bug is a subset of 53118. I would like to mark it as a duplicate, and can tackle it as part of my early debug work. After all, we're going to get a lot more DIEs that will get streamed early on, which PCH will have to deal with. So, this will all get fixed.

Also, can we downgrade 53118, perhaps to a P4?  As Ian mentions here:

https://gcc.gnu.org/ml/gcc-help/2010-09/msg00083.html

There are better ways of optimizing this at link time for dwarf4, and the fact that this has been broken since GCC 4.0 would hint that this may not be of P2 importance?

OK for mainline pending tests?
commit 512b997ad55f45898fce2704c0289d472d08cab1
Author: Aldy Hernandez <al...@redhat.com>
Date:   Wed Feb 25 08:49:59 2015 -0800

        PR debug/46102
        * dwarf2out.c (dwarf2out_init): Disable -feliminate-dwarf2-dups.

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ebf41c8..3f2837b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -22621,6 +22621,13 @@ output_macinfo (void)
 static void
 dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
 {
+  /* This option is currently broken, see (PR53118 and PR46102).  */
+  if (flag_eliminate_dwarf2_dups)
+    {
+      warning (0, "ignoring unimplemented option -feliminate-dwarf2-dups");
+      flag_eliminate_dwarf2_dups = 0;
+    }
+
   /* Allocate the file_table.  */
   file_table = hash_table<dwarf_file_hasher>::create_ggc (50);
 
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2-1.C 
b/gcc/testsuite/g++.dg/debug/dwarf2-1.C
index e90d510..913bfe5 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2-1.C
@@ -20,3 +20,5 @@ namespace N
 }
 
 N::Derived thing;
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2-2.C 
b/gcc/testsuite/g++.dg/debug/dwarf2-2.C
index 9e6dbd2..214bbb1 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2-2.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2-2.C
@@ -15,3 +15,5 @@ void A::foo ()
 {
   using namespace N;
 }
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C 
b/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
index d9d058c..17ffafa 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
@@ -8,3 +8,5 @@ typedef struct
 } A;
 
 A a;
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */
diff --git a/gcc/testsuite/g++.dg/debug/pr46123.C 
b/gcc/testsuite/g++.dg/debug/pr46123.C
index 9e115cd..f5e5f9f 100644
--- a/gcc/testsuite/g++.dg/debug/pr46123.C
+++ b/gcc/testsuite/g++.dg/debug/pr46123.C
@@ -45,3 +45,5 @@ int main ()
     return 1;
   return 0;
 }
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c 
b/gcc/testsuite/gcc.dg/debug/dwarf2-3.c
index f0c129c..e649dfa 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2-3.c
@@ -11,3 +11,5 @@ int main()
   p.x = 0;
   p.y = 0;
 }
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c 
b/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
index d9c01d0..4d3a9e8 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
@@ -1,8 +1,10 @@
 /* Test that these two options can work together.  */
 /* { dg-options "-gdwarf-4 -dA -feliminate-dwarf2-dups -fdebug-types-section" 
} */
-/* { dg-final { scan-assembler "DW.dups_types\.h\[^)\]*. DW_TAG_typedef" } } */
+/* { dg-final { scan-assembler "DW.dups_types\.h\[^)\]*. DW_TAG_typedef" { 
xfail *-*-* } } } */
 /* { dg-final { scan-assembler "DW_TAG_type_unit" } } */
 
 #include "dups-types.h"
 
 A2 a;
+
+/* { dg-bogus "ignoring unimplemented option -feliminate-dwarf2-dups" 
"unimplemented" { xfail *-*-* } 1 } */

Reply via email to