public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] debug/PR78112: remove recent duplicates for DW_TAG_subprogram attributes
@ 2016-11-08 14:24 Pierre-Marie de Rodat
  2016-11-09  9:02 ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Marie de Rodat @ 2016-11-08 14:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: Pierre-Marie de Rodat

Hello,

This patch comes from the discussion for PR debug/78112
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78112).  It seems to fix
the regression Rainer detected on x86_64-apple-darwin, although I still
wonder why remaining duplicate attributes (which were already present
before my original patch) are not a problem on this platform.

Anyway, bootstrapped and regtested on x86_64-linux.  As I said on the
PR, I managed to check with a Python script that there were no
duplicates anymore but I don't know how to turn this into a DejaGNU
testcase.

Ok to commit?

gcc/

	PR debug/78112
	* dwarf2out.c (dwarf2out_early_global_decl): Call dwarf2out_decl
	on the context only when it has no DIE yet.
---
 gcc/dwarf2out.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 1dfff38..f9ec090 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -25256,11 +25256,11 @@ dwarf2out_early_global_decl (tree decl)
 	  if (!DECL_STRUCT_FUNCTION (decl))
 	    goto early_decl_exit;
 
-	  /* For nested functions, emit DIEs for the parents first so that all
-	     nested DIEs are generated at the proper scope in the first
-	     shot.  */
+	  /* For nested functions, make sure we have DIEs for the parents first
+	     so that all nested DIEs are generated at the proper scope in the
+	     first shot.  */
 	  tree context = decl_function_context (decl);
-	  if (context != NULL)
+	  if (context != NULL && lookup_decl_die (context) == NULL)
 	    {
 	      current_function_decl = context;
 	      dwarf2out_decl (context);
-- 
2.10.2

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

end of thread, other threads:[~2016-11-18 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 14:24 [PATCH] debug/PR78112: remove recent duplicates for DW_TAG_subprogram attributes Pierre-Marie de Rodat
2016-11-09  9:02 ` Richard Biener
2016-11-10 11:06   ` Pierre-Marie de Rodat
2016-11-18 14:03     ` Christophe Lyon
2016-11-18 17:24       ` Pierre-Marie de Rodat

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