View | Details | Return to bug 97060
Collapse All | Expand All

(-)gcc/dwarf2out.c.jj (-2 / +10 lines)
Lines 26547-26553 dwarf2out_early_global_decl (tree decl) Link Here
26547
	      && ((origin_die = lookup_decl_die (origin)) == NULL
26547
	      && ((origin_die = lookup_decl_die (origin)) == NULL
26548
		  || is_declaration_die (origin_die)))
26548
		  || is_declaration_die (origin_die)))
26549
	    {
26549
	    {
26550
	      current_function_decl = origin;
26550
	      cgraph_node *cnode = cgraph_node::get (origin);
26551
	      if (cnode && cnode->has_gimple_body_p ())
26552
		current_function_decl = origin;
26553
	      else
26554
		current_function_decl = NULL_TREE;
26551
	      dwarf2out_decl (origin);
26555
	      dwarf2out_decl (origin);
26552
	    }
26556
	    }
26553
26557
Lines 26556-26562 dwarf2out_early_global_decl (tree decl) Link Here
26556
	  if ((old_die = lookup_decl_die (decl)) == NULL
26560
	  if ((old_die = lookup_decl_die (decl)) == NULL
26557
	      || is_declaration_die (old_die))
26561
	      || is_declaration_die (old_die))
26558
	    {
26562
	    {
26559
	      current_function_decl = decl;
26563
	      cgraph_node *cnode = cgraph_node::get (decl);
26564
	      if (cnode && cnode->has_gimple_body_p ())
26565
		current_function_decl = decl;
26566
	      else
26567
		current_function_decl = NULL_TREE;
26560
	      dwarf2out_decl (decl);
26568
	      dwarf2out_decl (decl);
26561
	    }
26569
	    }
26562
26570
(-)gcc/testsuite/gcc.dg/debug/dwarf2/pr97060.c.jj (+13 lines)
Line 0 Link Here
1
/* PR debug/97060 */
2
/* { dg-do compile } */
3
/* { dg-options "-g -dA" } */
4
/* { dg-final { scan-assembler-times "DW_AT_declaration" 2 } } */
5
6
extern int foo (unsigned int, unsigned int);
7
8
int
9
bar (void)
10
{
11
  foo (1, 2);
12
  return 0;
13
}

Return to bug 97060