From: Aldy Hernandez Date: Thu, 26 Feb 2015 15:31:52 +0000 (+0000) Subject: re PR debug/46102 (ICE: SIGSEGV in dwarf2out_finish (dwarf2out.c:8490) with -felimina... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b33da0c754077df1c40bdf929eb8c9ebc9e4de2b;p=gcc.git 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 --- 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-1.C b/gcc/testsuite/g++.dg/debug/dwarf2-1.C deleted file mode 100644 index e90d51030c8..00000000000 --- a/gcc/testsuite/g++.dg/debug/dwarf2-1.C +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2006 Free Software Foundation, Inc. -// Contributed by Nathan Sidwell 6 Jan 2006 - -// PR 24824 -// Origin: wanderer@rsu.ru - -// { dg-options "-feliminate-dwarf2-dups" } - -namespace N -{ - struct Base - { - int m; - }; - - struct Derived : Base - { - using Base::m; - }; -} - -N::Derived thing; 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/dwarf2-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C new file mode 100644 index 00000000000..d0176bae6f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C @@ -0,0 +1,24 @@ +// Copyright (C) 2006 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 6 Jan 2006 + +// PR 24824 +// Origin: wanderer@rsu.ru + +// { dg-options "-gdwarf -feliminate-dwarf2-dups" } + +namespace N +{ + struct Base + { + int m; + }; + + struct Derived : Base + { + using Base::m; + }; +} + +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/dwarf2/pr46123-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C new file mode 100644 index 00000000000..b262034eafb --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C @@ -0,0 +1,49 @@ +// PR debug/46123 +// { dg-do compile } +// { dg-options "-g -feliminate-dwarf2-dups" } + +struct foo +{ + static int bar () + { + int i; + static int baz = 1; + { + static int baz = 2; + i = baz++; + } + { + struct baz + { + static int m () + { + static int n; + return n += 10; + } + }; + baz a; + i += a.m (); + } + { + static int baz = 3; + i += baz; + baz += 30; + } + i += baz; + baz += 60; + return i; + } +}; + +int main () +{ + foo x; + + if (x.bar () != 16) + return 1; + if (x.bar() != 117) + 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/g++.dg/debug/pr46123.C b/gcc/testsuite/g++.dg/debug/pr46123.C deleted file mode 100644 index 9e115cd06da..00000000000 --- a/gcc/testsuite/g++.dg/debug/pr46123.C +++ /dev/null @@ -1,47 +0,0 @@ -// PR debug/46123 -// { dg-do compile } -// { dg-options "-g -feliminate-dwarf2-dups" } - -struct foo -{ - static int bar () - { - int i; - static int baz = 1; - { - static int baz = 2; - i = baz++; - } - { - struct baz - { - static int m () - { - static int n; - return n += 10; - } - }; - baz a; - i += a.m (); - } - { - static int baz = 3; - i += baz; - baz += 30; - } - i += baz; - baz += 60; - return i; - } -}; - -int main () -{ - foo x; - - if (x.bar () != 16) - return 1; - if (x.bar() != 117) - return 1; - return 0; -} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2-3.c deleted file mode 100644 index f0c129c6026..00000000000 --- a/gcc/testsuite/gcc.dg/debug/dwarf2-3.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Test -feliminate-dwarf2-dups */ -/* Contributed by Devang Patel */ -/* { dg-do compile } */ -/* { dg-options "-feliminate-dwarf2-dups" } */ - -#include "dwarf2-3.h" - -int main() -{ - struct point p; - p.x = 0; - p.y = 0; -} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2-3.h b/gcc/testsuite/gcc.dg/debug/dwarf2-3.h deleted file mode 100644 index 26ad0bace22..00000000000 --- a/gcc/testsuite/gcc.dg/debug/dwarf2-3.h +++ /dev/null @@ -1,9 +0,0 @@ -/* Test -feliminate-dwarf2-dups */ -/* Contributed by Devang Patel */ - -struct point -{ - int x; - int y; -}; - diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c new file mode 100644 index 00000000000..e3646705706 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c @@ -0,0 +1,13 @@ +/* Test -feliminate-dwarf2-dups */ +/* Contributed by Devang Patel */ +/* { dg-do compile } */ +/* { dg-options "-gdwarf -feliminate-dwarf2-dups" } */ + +#include "dwarf2-3.h" + +int main() +{ + struct point p; + p.x = 0; + p.y = 0; +} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h new file mode 100644 index 00000000000..26ad0bace22 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h @@ -0,0 +1,9 @@ +/* Test -feliminate-dwarf2-dups */ +/* Contributed by Devang Patel */ + +struct point +{ + int x; + int y; +}; +