[PATCH] Better .debug_aranges fix (PR debug/48253, take 3)

Jakub Jelinek jakub@redhat.com
Mon Mar 28 14:38:00 GMT 2011


On Mon, Mar 28, 2011 at 10:23:08AM -0400, Jason Merrill wrote:
> On 03/25/2011 01:01 PM, Jakub Jelinek wrote:
> >+	    if (node == loc_list->last_before_switch
> >+		&& (node != loc_list->first || loc_list->first->next)
> >+		&& current_function_decl)
> 
> Let's store this test in a local variable rather than repeat it a
> few lines down.

Ok, will do.

> >+  if (fde->dw_fde_second_begin && fde->dw_fde_switch_cfi == NULL)
> >+    start_label = fde->dw_fde_second_begin;
> 
> Can this happen?  If we haven't switched, second_begin should be null.

It could happen if the first partition didn't contain any CFI adjustments,
but the second one did.  As dw_fde_switch_cfi points to the last CFI
before the switch, it will be NULL in that case.  But now that I think about
it, in that case we should still add something for the fde->dw_fde_begin ..
fde->dw_fde_end range.

So perhaps
  if (fde->dw_fde_second_begin && fde->dw_fde_switch_cfi == NULL)
    {
      /* If the first partition contained no CFI adjustments, the
	 CIE opcodes apply to the whole first partition.  */
      *list_tail = new_loc_list (build_cfa_loc (&last_cfa, offset),
				 fde->dw_fde_begin, fde->dw_fde_end, section);
      list_tail = &(*list_tail)->dw_loc_next;
      start_label = last_label = fde->dw_fde_second_begin;
    }
instead and put this right before the for cycle (so that last_cfa
is already computed).

	Jakub



More information about the Gcc-patches mailing list