public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR86452
@ 2018-07-11 13:11 Richard Biener
  2018-07-12 17:14 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2018-07-11 13:11 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason, dodji


The following fixes PR86452 by using scope_die_for which correctly
deals with -g1 in not creating (new) DIEs for namespaces.  With
a larger LTO testcase we run into this with a namespace DIE not
readily available but I'm not sure the issue isn't latent with
non-LTO.

The original code was added with the fix for PR44188 which
had a lengthy discussion and various patch variants but this
very piece of change didn't have an explanation and why it
didn't use scope_die_for.  The single testcase added still passes
after the patch.

Bootstraped on x86_64-unknown-linux-gnu, testing in progress.

OK for trunk?

Thanks,
Richard.

2018-07-11  Richard Biener  <rguenther@suse.de>

	PR debug/86452
	* dwarf2out.c (gen_type_die_with_usage): Use scope_die_for
	instead of get_context_die.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 262551)
+++ gcc/dwarf2out.c	(working copy)
@@ -25378,11 +25378,8 @@ gen_type_die_with_usage (tree type, dw_d
      generate debug info for the typedef.  */
   if (is_naming_typedef_decl (TYPE_NAME (type)))
     {
-      /* Use the DIE of the containing namespace as the parent DIE of
-         the type description DIE we want to generate.  */
-      if (DECL_CONTEXT (TYPE_NAME (type))
-	  && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL)
-	context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
+      /* Give typedefs the right scope.  */
+      context_die = scope_die_for (type, context_die);
 
       gen_decl_die (TYPE_NAME (type), NULL, NULL, context_die);
       return;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix PR86452
  2018-07-11 13:11 [PATCH] Fix PR86452 Richard Biener
@ 2018-07-12 17:14 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2018-07-12 17:14 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: jason, dodji

On 07/11/2018 07:11 AM, Richard Biener wrote:
> 
> The following fixes PR86452 by using scope_die_for which correctly
> deals with -g1 in not creating (new) DIEs for namespaces.  With
> a larger LTO testcase we run into this with a namespace DIE not
> readily available but I'm not sure the issue isn't latent with
> non-LTO.
> 
> The original code was added with the fix for PR44188 which
> had a lengthy discussion and various patch variants but this
> very piece of change didn't have an explanation and why it
> didn't use scope_die_for.  The single testcase added still passes
> after the patch.
> 
> Bootstraped on x86_64-unknown-linux-gnu, testing in progress.
> 
> OK for trunk?
> 
> Thanks,
> Richard.
> 
> 2018-07-11  Richard Biener  <rguenther@suse.de>
> 
> 	PR debug/86452
> 	* dwarf2out.c (gen_type_die_with_usage): Use scope_die_for
> 	instead of get_context_die.
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-12 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 13:11 [PATCH] Fix PR86452 Richard Biener
2018-07-12 17:14 ` Jeff Law

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