[debug-early] fix problem with template parameter packs

Aldy Hernandez aldyh@redhat.com
Fri Jun 5 15:24:00 GMT 2015


On 06/05/2015 10:02 AM, Jason Merrill wrote:
> On 06/04/2015 07:31 PM, Aldy Hernandez wrote:
>> So... if I revert the !declaration change and move the big block below
>> said change, would you be OK with it, or did you still want some changes
>> to it?
>
> I'm still hoping to simplify it.  Actually, I think we can just remove the
>
>>    if (old_die && declaration && !local_scope_p (context_die))
>
> check; since inverting its logic didn't seem to break anything before,
> it can just go.
>
> And I'd like to rework the logic in the big block so we don't have three
> ways of getting to the same thing.  Does this work?

g++.dg/debug/dwarf2/static-data-member1.C fails because it doesn't get a 
DW_AT_specification.  How about:

   if (old_die)
     {
       if (declaration)
	{
	  /* A declaration that has been previously dumped, needs no
	     further annotations, since it doesn't need location on
	     the second pass.  */
	  return;
	}
       else if (decl_will_get_specification_p (old_die, decl, declaration)
	       && !get_AT (old_die, DW_AT_specification))
	{
	  /* Fall-thru so we can make a new variable die along with a
	     DW_AT_specification.  */
	}
       else if (origin && old_die->die_parent != context_die)
	{
	  /* If we will be creating an inlined instance, we need a
	     new DIE that will get annotated with
	     DW_AT_abstract_origin.  Clear things so we can get a
	     new DIE.  */
	  gcc_assert (!DECL_ABSTRACT_P (decl));
	  old_die = NULL;
	}
       else
	{
	  /* If a DIE was dumped early, it still needs location info.
	     Skip to where we fill the location bits.  */
	  var_die = old_die;
	  goto gen_variable_die_location;
	}
     }



More information about the Gcc-patches mailing list