re PR debug/46102 (ICE: SIGSEGV in dwarf2out_finish (dwarf2out.c:8490) with -felimina...
authorAldy Hernandez <aldyh@redhat.com>
Thu, 26 Feb 2015 15:31:52 +0000 (15:31 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 26 Feb 2015 15:31:52 +0000 (15:31 +0000)
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

14 files changed:
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2-1.C [deleted file]
gcc/testsuite/g++.dg/debug/dwarf2-2.C [deleted file]
gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
gcc/testsuite/g++.dg/debug/pr46123.C [deleted file]
gcc/testsuite/gcc.dg/debug/dwarf2-3.c [deleted file]
gcc/testsuite/gcc.dg/debug/dwarf2-3.h [deleted file]
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h [new file with mode: 0644]

index 73ef79d4ea484bcf27ba4b836701dbcaf7655e4f..047a158e29ad7e0438bea27050fed28246eccaab 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-25  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR debug/46102
+       * dwarf2out.c (dwarf2out_init): Disable -feliminate-dwarf2-dups.
+
 2015-02-26  Sebastian Pop  <s.pop@samsung.com>
 
        PR tree-optimization/65048
index ebf41c8e5a17f8062b2b74fbf03f8806599adca2..6c8e51fcab42447dddd0f587b1db67e1cd345cc4 100644 (file)
@@ -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<dwarf_file_hasher>::create_ggc (50);
 
index 41c0685db708d1df394ea63b1068c9d5936ab98f..0d1b9b5e4519931c2abc8e3fa3db4bed48561a40 100644 (file)
@@ -1,3 +1,16 @@
+2015-02-25  Aldy Hernandez  <aldyh@redhat.com>
+
+       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  <polacek@redhat.com>
 
        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 (file)
index e90d510..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
-// Contributed by Nathan Sidwell 6 Jan 2006 <nathan@codesourcery.com>
-
-// 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 (file)
index 9e6dbd2..0000000
+++ /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 (file)
index 0000000..d0176ba
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2006 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Jan 2006 <nathan@codesourcery.com>
+
+// 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 (file)
index 0000000..23175c6
--- /dev/null
@@ -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 (file)
index 0000000..b262034
--- /dev/null
@@ -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 } */
index d9d058c9c8cebcf12775f132cf8aba94a9227ad2..b742c1dfd4173adba17a28a835d74d616404b20d 100644 (file)
@@ -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 (file)
index 9e115cd..0000000
+++ /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 (file)
index f0c129c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Test -feliminate-dwarf2-dups */
-/* Contributed by Devang Patel <dpatel@apple.com> */
-/* { 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 (file)
index 26ad0ba..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Test -feliminate-dwarf2-dups */
-/* Contributed by Devang Patel <dpatel@apple.com> */
-
-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 (file)
index 0000000..e364670
--- /dev/null
@@ -0,0 +1,13 @@
+/* Test -feliminate-dwarf2-dups */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+/* { 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 (file)
index 0000000..26ad0ba
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test -feliminate-dwarf2-dups */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+struct point
+{
+  int x;
+  int y;
+};
+