public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR46796, LTO debuginfo for basic type variants
@ 2010-12-10 15:50 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2010-12-10 15:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason


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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-10 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-10 15:50 [PATCH] Fix PR46796, LTO debuginfo for basic type variants Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).