From b33da0c754077df1c40bdf929eb8c9ebc9e4de2b Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 26 Feb 2015 15:31:52 +0000 Subject: [PATCH] re PR debug/46102 (ICE: SIGSEGV in dwarf2out_finish (dwarf2out.c:8490) with -feliminate-dwarf2-dups when using precompiled headers) PR debug/46102 * dwarf2out.c (dwarf2out_init): Disable -feliminate-dwarf2-dups. testsuite/ PR debug/46102 * g++.dg/debug/dwarf2-1.C: XFAIL and move... * g++.dg/debug/dwarf2/dwarf2-1.C: ...here. * g++.dg/debug/dwarf2-2.C: XFAIL and move... * g++.dg/debug/dwarf2/dwarf2-2.C: ...here. * g++.dg/debug/dwarf2/typedef5.C: XFAIL. * g++.dg/debug/pr46123.C: XFAIL and move... * g++.dg/debug/dwarf2/pr46123-2.C: ...here. * gcc.dg/debug/dwarf2-3.c: Move... * gcc.dg/debug/dwarf2/dwarf2-3.c: ...here. From-SVN: r221016 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 8 ++++++++ gcc/testsuite/ChangeLog | 13 +++++++++++++ gcc/testsuite/g++.dg/debug/dwarf2-2.C | 17 ----------------- .../g++.dg/debug/{ => dwarf2}/dwarf2-1.C | 4 +++- gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C | 19 +++++++++++++++++++ .../debug/{pr46123.C => dwarf2/pr46123-2.C} | 2 ++ gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C | 2 ++ .../gcc.dg/debug/{ => dwarf2}/dwarf2-3.c | 2 +- .../gcc.dg/debug/{ => dwarf2}/dwarf2-3.h | 0 10 files changed, 53 insertions(+), 19 deletions(-) delete mode 100644 gcc/testsuite/g++.dg/debug/dwarf2-2.C rename gcc/testsuite/g++.dg/debug/{ => dwarf2}/dwarf2-1.C (61%) create mode 100644 gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C rename gcc/testsuite/g++.dg/debug/{pr46123.C => dwarf2/pr46123-2.C} (81%) rename gcc/testsuite/gcc.dg/debug/{ => dwarf2}/dwarf2-3.c (77%) rename gcc/testsuite/gcc.dg/debug/{ => dwarf2}/dwarf2-3.h (100%) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 73ef79d4ea4..047a158e29a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-25 Aldy Hernandez + + PR debug/46102 + * dwarf2out.c (dwarf2out_init): Disable -feliminate-dwarf2-dups. + 2015-02-26 Sebastian Pop PR tree-optimization/65048 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ebf41c8e5a1..6c8e51fcab4 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -22621,6 +22621,14 @@ 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 + && strstr (lang_hooks.name, "C++")) + { + warning (0, "-feliminate-dwarf2-dups is broken for C++, ignoring"); + flag_eliminate_dwarf2_dups = 0; + } + /* Allocate the file_table. */ file_table = hash_table::create_ggc (50); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 41c0685db70..0d1b9b5e451 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2015-02-25 Aldy Hernandez + + PR debug/46102 + * g++.dg/debug/dwarf2-1.C: XFAIL and move... + * g++.dg/debug/dwarf2/dwarf2-1.C: ...here. + * g++.dg/debug/dwarf2-2.C: XFAIL and move... + * g++.dg/debug/dwarf2/dwarf2-2.C: ...here. + * g++.dg/debug/dwarf2/typedef5.C: XFAIL. + * g++.dg/debug/pr46123.C: XFAIL and move... + * g++.dg/debug/dwarf2/pr46123-2.C: ...here. + * gcc.dg/debug/dwarf2-3.c: Move... + * gcc.dg/debug/dwarf2/dwarf2-3.c: ...here. + 2015-02-26 Marek Polacek PR c++/65202 diff --git a/gcc/testsuite/g++.dg/debug/dwarf2-2.C b/gcc/testsuite/g++.dg/debug/dwarf2-2.C deleted file mode 100644 index 9e6dbd2169d..00000000000 --- a/gcc/testsuite/g++.dg/debug/dwarf2-2.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR debug/27057 -// { dg-do compile } -// { dg-options "-g -feliminate-dwarf2-dups" } - -namespace N -{ -} - -struct A -{ - void foo (); -}; - -void A::foo () -{ - using namespace N; -} diff --git a/gcc/testsuite/g++.dg/debug/dwarf2-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C similarity index 61% rename from gcc/testsuite/g++.dg/debug/dwarf2-1.C rename to gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C index e90d51030c8..d0176bae6f5 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2-1.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C @@ -4,7 +4,7 @@ // PR 24824 // Origin: wanderer@rsu.ru -// { dg-options "-feliminate-dwarf2-dups" } +// { dg-options "-gdwarf -feliminate-dwarf2-dups" } namespace N { @@ -20,3 +20,5 @@ namespace N } N::Derived thing; + +/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } 1 } */ diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C new file mode 100644 index 00000000000..23175c666af --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C @@ -0,0 +1,19 @@ +// PR debug/27057 +// { dg-do compile } +// { dg-options "-gdwarf -feliminate-dwarf2-dups" } + +namespace N +{ +} + +struct A +{ + void foo (); +}; + +void A::foo () +{ + using namespace N; +} + +/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } 1 } */ diff --git a/gcc/testsuite/g++.dg/debug/pr46123.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C similarity index 81% rename from gcc/testsuite/g++.dg/debug/pr46123.C rename to gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C index 9e115cd06da..b262034eafb 100644 --- a/gcc/testsuite/g++.dg/debug/pr46123.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C @@ -45,3 +45,5 @@ int main () return 1; return 0; } + +/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } 1 } */ diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C b/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C index d9d058c9c8c..b742c1dfd41 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 "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } 1 } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c similarity index 77% rename from gcc/testsuite/gcc.dg/debug/dwarf2-3.c rename to gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c index f0c129c6026..e3646705706 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c @@ -1,7 +1,7 @@ /* Test -feliminate-dwarf2-dups */ /* Contributed by Devang Patel */ /* { dg-do compile } */ -/* { dg-options "-feliminate-dwarf2-dups" } */ +/* { dg-options "-gdwarf -feliminate-dwarf2-dups" } */ #include "dwarf2-3.h" diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-3.h b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h similarity index 100% rename from gcc/testsuite/gcc.dg/debug/dwarf2-3.h rename to gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h -- 2.30.2