]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (dwarf2out_finish): Accept namespaces as context of limbo die nodes.
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 30 Jun 2007 04:54:06 +0000 (04:54 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sat, 30 Jun 2007 04:54:06 +0000 (04:54 +0000)
gcc/ChangeLog:
* dwarf2out.c (dwarf2out_finish): Accept namespaces as context of
limbo die nodes.
gcc/testsuite/ChangeLog:
* g++.dg/ext/interface4.C, g++.dg/ext/interface4.h: New.

From-SVN: r126139

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/interface4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/interface4.h [new file with mode: 0644]

index 050623a024065d76108c735845766213bea5d19a..713ae732a8cd5bef5f62b4976bbebd8ce1068784 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-30  Alexandre Oliva  <aoliva@redhat.com>
+
+       * dwarf2out.c (dwarf2out_finish): Accept namespaces as context of
+       limbo die nodes.
+
 2007-06-28  Seongbae Park  <seongbae.park@gmail.com>
 
        * config/arm/arm.c (arm_get_frame_offsets): Set
index c244d4b3708f809673e977ee348db9567e264229..0eaf18d79021890d47d8477be3c934d3de5b8b59 100644 (file)
@@ -14151,7 +14151,9 @@ dwarf2out_finish (const char *filename)
              else if (TYPE_P (node->created_for))
                context = TYPE_CONTEXT (node->created_for);
 
-             gcc_assert (context && TREE_CODE (context) == FUNCTION_DECL);
+             gcc_assert (context
+                         && (TREE_CODE (context) == FUNCTION_DECL
+                             || TREE_CODE (context) == NAMESPACE_DECL));
 
              origin = lookup_decl_die (context);
              if (origin)
index e540725a14cac96dffeaa96b8e8037751fc65f6e..dcf606f27a14cfc1fa4fc52859f74c0b92393fba 100644 (file)
@@ -1,3 +1,7 @@
+2007-06-30  Alexandre Oliva  <aoliva@redhat.com>
+
+       * g++.dg/ext/interface4.C, g++.dg/ext/interface4.h: New.
+
 2007-06-28  Seongbae Park  <seongbae.park@gmail.com>
 
        * gcc.target/arm/stack-corruption.c: New test.
diff --git a/gcc/testsuite/g++.dg/ext/interface4.C b/gcc/testsuite/g++.dg/ext/interface4.C
new file mode 100644 (file)
index 0000000..85bb912
--- /dev/null
@@ -0,0 +1,13 @@
+/* https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227376 */
+
+/* { dg-do compile } */
+/* { dg-options "-g2" } */
+
+/* We used to crash when emitting debug info for type N::A because its
+   context was a namespace, not a function.  */
+
+#include "interface4.h"
+
+void f ( ) {
+        g ( );
+}
diff --git a/gcc/testsuite/g++.dg/ext/interface4.h b/gcc/testsuite/g++.dg/ext/interface4.h
new file mode 100644 (file)
index 0000000..0971b37
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma interface
+namespace N {
+        typedef int A;
+}
+inline void g ( ) {
+        static N :: A a = 0;
+        a = a;
+}