re PR debug/9039 (ICE, anonymous union, gen_decl_die, dwarf2out.c:11974)
authorJason Merrill <jason@redhat.com>
Sat, 15 Mar 2003 17:41:35 +0000 (12:41 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 15 Mar 2003 17:41:35 +0000 (12:41 -0500)
        PR debug/9039
        * dwarf2out.c (gen_decl_die): Ignore frontend tree codes.

From-SVN: r64412

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/g++.dg/debug/anonunion1.C [new file with mode: 0644]

index 2a73783cee6d9ea4199241c8fc315fd347e15012..447cf7b97290c20cde7fd130f8df2696d31b6e9d 100644 (file)
@@ -1,5 +1,8 @@
 2003-03-15  Jason Merrill  <jason@redhat.com>
 
+       PR debug/9039
+       * dwarf2out.c (gen_decl_die): Ignore frontend tree codes.
+
        PR debug/6387
        * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
        function DIEs at toplevel.
index e31fcb878d38865a2368dcc5102dc342e4251454..fec07a76bd5074be1c991b7fe42c926b751ee99d 100644 (file)
@@ -12194,6 +12194,9 @@ gen_decl_die (decl, context_die)
       break;
 
     default:
+      if ((int)TREE_CODE (decl) > NUM_TREE_CODES)
+       /* Probably some frontend-internal decl.  Assume we don't care.  */
+       break;
       abort ();
     }
 }
diff --git a/gcc/testsuite/g++.dg/debug/anonunion1.C b/gcc/testsuite/g++.dg/debug/anonunion1.C
new file mode 100644 (file)
index 0000000..c48a8cd
--- /dev/null
@@ -0,0 +1,14 @@
+// PR debug/9039
+// Verify that the debugging backends don't get confused by ALIAS_DECLs.
+
+int foo()
+{
+  union
+  {
+    int z;
+    unsigned int w;
+  };
+
+  w = 0;
+  return 0;
+}