[debug-early] fix problem with template parameter packs

Aldy Hernandez aldyh@redhat.com
Tue May 5 02:29:00 GMT 2015


The code handling parameter DIEs needed a little tweaking for variable 
length template arguments.  I've relaxed the original assert, but this 
may require tweaking at branch review time-- hopefully later this week.

Committing to branch.

Aldy

p.s. Richi/Jason: Winter is coming.  Down to 1 GCC regression which is 
actually a missed DIE optimization which I hope I can fix post merge.
-------------- next part --------------
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index c51cea1..a5b155f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18018,8 +18018,20 @@ gen_formal_parameter_die (tree node, tree origin, bool emit_name_p,
 	 DW_AT_abstract_origin.  */
       if (parm_die && parm_die->die_parent != context_die)
 	{
-	  gcc_assert (!DECL_ABSTRACT_P (node));
-	  parm_die = NULL;
+	  if (!DECL_ABSTRACT_P (node))
+	    {
+	      gcc_assert (!DECL_ABSTRACT_P (node));
+	      parm_die = NULL;
+	    }
+	  else
+	    {
+	      /* Reuse DIE even with a differing context.  This
+		 happens when called through
+		 dwarf2out_abstract_function for
+		 formal parameter packs.  */
+	      gcc_assert (parm_die->die_parent->die_tag
+			  == DW_TAG_GNU_formal_parameter_pack);
+	    }
 	}
 
       if (parm_die && parm_die->die_parent == NULL)


More information about the Gcc-patches mailing list