On 06/04/2015 02:39 PM, Jason Merrill wrote:
On 06/04/2015 02:23 PM, Jason Merrill wrote:
On 06/03/2015 10:42 AM, Aldy Hernandez wrote:
+  /* Die was generated early via dwarf2out_early_global_decl.  */
+  BOOL_BITFIELD dumped_early : 1;

Missed a "dump".

Actually, why do we need this flag?  The uses I see are

* to avoid declaring prototype parameters multiple times

It used to verify the sanity of the late limbo list. I can remove this though if you want.

dwarf2out_decl() also has a sanity check to verify that early dumped DIEs are not generated again. I can remove this as well if you prefer.

And finally, I believe the big block you speak of below has a check for dumped_early, that may or may not allow it to distinguish for things that happen in LTO which still acts like traditional late dwarf. I haven't checked this though... but if you want it removed I can check and retest.


Can't we just assume that if we have an old DIE, it already has
parameters?

* to make the logic in gen_variable_die even more horrible

It's really not clear to me that we need the new big block of code.  I
would think that it should be enough to update this:

   /* If the compiler emitted a definition for the DECL declaration
+     and we already emitted a DIE for it, don't emit a second
      DIE for it again. Allow re-declarations of DECLs that are
      inside functions, though.  */
-  if (old_die && declaration && !local_scope_p (context_die))
     return;

to add locations instead of just returning when !early_dwarf.

Incidentally, why did you change "declaration" to "!declaration" in this
condition?

Ah, wait.  If we revert that mysterious change, it's clear again that
this check is just dealing with avoiding duplicate declarations, so
within this condition isn't the right place for adding locations to
early DIEs; that should probably happen right after this.

This was in Michael Matz's original prototype. I'm surprised it survived this long.

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?

Aldy

Reply via email to