This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR29906] Handle DW_AT_import <base type>
On Mar 16, 2007, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Mar 15, 2007, Mark Mitchell <mark@codesourcery.com> wrote:
>> OK, thanks.
> I've installed it on 4.2 and trunk, where I tested it. I'm testing
> 4.1 now, and assuming it passes, I'll check it in some time tomorrow
> (technically, today, but you get the idea ;-) unless someone tells me
> not to.
Here's what I'm installing in the 4.1 branch, bootstrapped and
regtested on x86_64-linux-gnu. I had to tweak the dg-options for the
4.1 branch, because the option that triggered the bug in newer
releases was not present in 4.1, and it was the default.
for gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
PR debug/29906
* dwarf2out.c (force_type_die): Adjust comment.
(dwarf2out_imported_module_or_decl): Handle base AT_import types.
for gcc/testsuite/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
PR debug/29906
* g++.dg/debug/pr29906.C: New
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c.orig 2007-03-16 02:11:27.000000000 -0300
+++ gcc/dwarf2out.c 2007-03-16 02:17:27.000000000 -0300
@@ -12893,7 +12893,8 @@ force_decl_die (tree decl)
return decl_die;
}
-/* Returns the DIE for TYPE. A DIE is always returned. */
+/* Returns the DIE for TYPE, that must not be a base type. A DIE is
+ always returned. */
static dw_die_ref
force_type_die (tree type)
@@ -13244,7 +13245,12 @@ dwarf2out_imported_module_or_decl (tree
/* For TYPE_DECL or CONST_DECL, lookup TREE_TYPE. */
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL)
- at_import_die = force_type_die (TREE_TYPE (decl));
+ {
+ if (is_base_type (TREE_TYPE (decl)))
+ at_import_die = base_type_die (TREE_TYPE (decl));
+ else
+ at_import_die = force_type_die (TREE_TYPE (decl));
+ }
else
{
at_import_die = lookup_decl_die (decl);
Index: gcc/testsuite/g++.dg/debug/pr29906.C
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/debug/pr29906.C 2007-03-16 13:37:49.000000000 -0300
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// { dg-options "-g" }
+
+struct A{
+ typedef int T;
+ virtual ~A();
+};
+struct B:public A{
+ using A::T;
+};
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}