re PR debug/32610 (ICE in gen_tagged_type_instantiation_die, at dwarf2out.c:12762)
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Aug 2007 17:11:20 +0000 (19:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Aug 2007 17:11:20 +0000 (19:11 +0200)
PR debug/32610
* dwarf2out.c (gen_decl_die): Don't call
gen_tagged_type_instantiation_die if decl doesn't have tagged type.

* gcc.dg/debug/pr32610.c: New test.

From-SVN: r127669

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/pr32610.c [new file with mode: 0644]

index 4724e162d15b4ae2d773e5ad7ed960d73ad57427..82b7685d5cd8f4e2890c16a0f9e3e7d7d3b5c804 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/32610
+       * dwarf2out.c (gen_decl_die): Don't call
+       gen_tagged_type_instantiation_die if decl doesn't have tagged type.
+
 2007-08-21  Paul Brook  <paul@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Mark Mitchell  <mark@codesourcery.com>
index ec6e121f4119b897414056a19b016a1927ecd9ce..a03b81abf5bccf08fdbd9880d05d052b9de4d7d6 100644 (file)
@@ -13622,7 +13622,8 @@ gen_decl_die (tree decl, dw_die_ref context_die)
         was generated within the original definition of an inline function) we
         have to generate a special (abbreviated) DW_TAG_structure_type,
         DW_TAG_union_type, or DW_TAG_enumeration_type DIE here.  */
-      if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE)
+      if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE
+         && is_tagged_type (TREE_TYPE (decl)))
        {
          gen_tagged_type_instantiation_die (TREE_TYPE (decl), context_die);
          break;
index 4fc50cef9f0a157e3bcb558e2430bd4ab29e399b..002f82420853ef96633e5507dbbcd87234536e21 100644 (file)
@@ -1,5 +1,8 @@
 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/32610
+       * gcc.dg/debug/pr32610.c: New test.
+
        * g++.dg/init/new24.C: New test.
 
        PR middle-end/32912
diff --git a/gcc/testsuite/gcc.dg/debug/pr32610.c b/gcc/testsuite/gcc.dg/debug/pr32610.c
new file mode 100644 (file)
index 0000000..d1dae1d
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR debug/32610 */
+/* { dg-do compile } */
+
+inline void
+foo (int x)
+{
+  double (*arr)[x];
+}
+
+void
+bar (void)
+{
+  foo (1);
+}