This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR46796, LTO debuginfo for basic type variants
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jason at redhat dot com
- Date: Fri, 10 Dec 2010 15:43:30 +0100 (CET)
- Subject: [PATCH] Fix PR46796, LTO debuginfo for basic type variants
As we do not merge TYPE-DECLs in type variant chains we confuse
get_qualified_type and thus dwarf2out.c enough to make it emit
__unknown__ for for example a volatile float variable. The issue
exposes itself only because we do streamer cache pre-seeding
for basic types. As the __unknown__ handling is supposed to
fixup bugs the following adds another layer of fixups which
works because basic type variants all share the same name anyway.
Bootstrap and regtest on x86_64-unknown-linux-gnu, ok if that succeeds?
Thanks,
Richard.
2010-12-10 Richard Guenther <rguenther@suse.de>
PR lto/46796
* dwarf2out.c (modified_type_die): Fall back to the original
types name before giving up for base types.
Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c (revision 167686)
--- gcc/dwarf2out.c (working copy)
*************** modified_type_die (tree type, int is_con
*** 12995,13001 ****
}
/* This probably indicates a bug. */
else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
! add_name_attribute (mod_type_die, "__unknown__");
if (qualified_type)
equate_type_number_to_die (qualified_type, mod_type_die);
--- 12995,13016 ----
}
/* This probably indicates a bug. */
else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
! {
! /* With LTO we do not merge TYPE_DECLs and thus get_qualified_type
! will fail to obtain a type in some cases. Do not give up but
! use the name of the qualified type instead, it will be the
! same as all variants anyway. */
! if (!name
! && TYPE_NAME (type))
! {
! name = TYPE_NAME (type);
! if (TREE_CODE (name) == TYPE_DECL)
! name = DECL_NAME (name);
! add_name_attribute (mod_type_die, IDENTIFIER_POINTER (name));
! }
! else
! add_name_attribute (mod_type_die, "__unknown__");
! }
if (qualified_type)
equate_type_number_to_die (qualified_type, mod_type_die);