]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/34895 (ICE in force_type_die, at dwarf2out.c:12923)
authorMichael Matz <matz@suse.de>
Wed, 23 Jan 2008 16:44:27 +0000 (16:44 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Wed, 23 Jan 2008 16:44:27 +0000 (16:44 +0000)
        PR debug/34895
        * dwarf2out.c (force_type_die): Use modified_type_die instead of
        gen_type_die.

        * g++.dg/debug/pr34895.cc: New testcase.

From-SVN: r131761

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

index c34dbd07bd885e97eda1e746756a4518b8c4cd32..99fe6282519f1155984d199d056590e8eee11fa4 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-23  Michael Matz  <matz@suse.de>
+
+       PR debug/34895
+       * dwarf2out.c (force_type_die): Use modified_type_die instead of
+       gen_type_die.
+
 2008-01-23  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * ipa-struct-reorg.c (create_new_malloc): Use pointer type as
index 829b9ee328f52ebdf81d4405a479511295288bcf..c1df45af12ad58a2b4fc829b06857499438f77f6 100644 (file)
@@ -13736,11 +13736,8 @@ force_type_die (tree type)
       else
        context_die = comp_unit_die;
 
-      type_die = lookup_type_die (type);
-      if (type_die)
-       return type_die;
-      gen_type_die (type, context_die);
-      type_die = lookup_type_die (type);
+      type_die = modified_type_die (type, TYPE_READONLY (type),
+                                   TYPE_VOLATILE (type), context_die);
       gcc_assert (type_die);
     }
   return type_die;
index 2608146190fbbba69f08827970f3f59a665c0217..fe9442a92b80385fb0f7e7876798a60844ca45c5 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-23  Michael Matz  <matz@suse.de>
+
+       PR debug/34895
+       * g++.dg/debug/pr34895.cc: New testcase.
+
 2008-01-23  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/31529
diff --git a/gcc/testsuite/g++.dg/debug/pr34895.C b/gcc/testsuite/g++.dg/debug/pr34895.C
new file mode 100644 (file)
index 0000000..ca06336
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options "-O2 -g" }
+//
+// Copyright (C) 2008 Free Software Foundation, Inc.
+// Contributed by Theodore.Papadopoulo 20 Jan 2008 <Theodore.Papadopoulo@sophia.inria.fr>
+
+struct A {
+    A() { }
+    unsigned operator()() { return 1; }
+};
+struct B: public A {
+    typedef const A base;
+    using base::operator();
+    B() { }
+};
+int
+main() {
+    B b;
+}