diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-12-06 20:33:52 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-12-06 20:33:52 +0100 |
commit | 85b40c3ac73fb23bc400953a888209743de3c7bf (patch) | |
tree | c541315741187be413c024615beee7062b2baad9 /gcc/dwarf2out.c | |
parent | 628162eabeaddc4079107d467a55b1d0362e5cbd (diff) | |
download | gcc-85b40c3ac73fb23bc400953a888209743de3c7bf.zip gcc-85b40c3ac73fb23bc400953a888209743de3c7bf.tar.gz gcc-85b40c3ac73fb23bc400953a888209743de3c7bf.tar.bz2 |
re PR debug/45997 (__unknown__ type name for typedef'd int)
PR debug/45997
* dwarf2out.c (modified_type_die): If both is_const_type and
is_volatile_type is set, start with DW_TAG_const_type or
DW_TAG_volatile_type depending on where we get qualified type
in the recursive call.
* g++.dg/debug/dwarf2/pr45997-1.C: New test.
* g++.dg/debug/dwarf2/pr45997-2.C: New test.
From-SVN: r167517
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index acb70ed..c985527 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12907,7 +12907,12 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type, /* Else cv-qualified version of named type; fall through. */ } - if (is_const_type) + if (is_const_type + /* If both is_const_type and is_volatile_type, prefer the path + which leads to a qualified type. */ + && (!is_volatile_type + || get_qualified_type (type, TYPE_QUAL_CONST) == NULL_TREE + || get_qualified_type (type, TYPE_QUAL_VOLATILE) != NULL_TREE)) { mod_type_die = new_die (DW_TAG_const_type, comp_unit_die (), type); sub_die = modified_type_die (type, 0, is_volatile_type, context_die); @@ -12915,7 +12920,7 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type, else if (is_volatile_type) { mod_type_die = new_die (DW_TAG_volatile_type, comp_unit_die (), type); - sub_die = modified_type_die (type, 0, 0, context_die); + sub_die = modified_type_die (type, is_const_type, 0, context_die); } else if (code == POINTER_TYPE) { |