[PATCH] Slightly decrease .debug_loc size

Jason Merrill jason@redhat.com
Tue Apr 20 16:20:00 GMT 2010


On 04/14/2010 02:05 PM, Jakub Jelinek wrote:
> +      /* If the last note doesn't cover any instructions, remove it.  */

This may be the abstract effect, but it doesn't really describe what the 
code is doing.  I think it would be clearer to say "if there haven't 
been any new instructions since the last node, reuse it."

> -	  temp->last = loc;
 >...
> +	  if (last != temp->last)
> +	    temp->last = last;

Why is this changed?  It seems like this change means that temp->last 
and temp->last->next will be different where before they were always set 
to the same value.

> +      else if (unused)
> +	   ggc_free (unused);

So in this case we're just removing the last entry from the location 
list and not replacing it with anything?  That can't be right.

> +  /* If there were no real insns between note we processed last time
> +     and this note, use the label we emitted last time.  */
> +  if (last_var_location_insn == NULL_RTX
> +      || last_var_location_insn != next_real
> +      || last_in_cold_section_p != in_cold_section_p)
> +    {
> +      last_label = NULL;
> +      last_postcall_label = NULL;
> +    }

This comment seems to describe what eventually happens if the condition 
is false; I think it would be more helpful for it to address what's 
actually happening in this code.

Jason



More information about the Gcc-patches mailing list