Andrew Pinski <[EMAIL PROTECTED]> writes: > Here we have the same scope_labelno. The first dbxout_begin_prologue > comes from calling rs6000_output_mi_thunk. The normal way > scope_labelno gets incremented is via the > call to debug_hooks->function_decl in rest_of_handle_final which is > not done for thunks. > I don't know if we should call debug_hooks->function_decl for thunks > or not.
We shouldn't. It doesn't make sense, since there is no proper current_function_decl for a thunk. Previously, scope_labelno was referenced in dbxout_block and incremented in dbxout_function_end. Both functions are called only by dbxout_function_decl (a debug hook). So it was always consistent. Now scope_labelno is used by dbxout_begin_prologue and dbxout_source_line. Those are both debug hooks themselves. So this patch has introduced a dependency which was not previously there, which has led to a bug. There are several ways to fix this, of course. I think the simplest is going to be to always preincrement scope_labelno in dbxout_begin_prologue, rather than postincrementing it in dbxout_function_end. In cases where that fails, we are already in trouble. Note that scope_labelno is now used for two different things: for the LFBB symbol, and for the Lscope symbol. It does not have to be used for both, although as far as I can see it does no harm. Ian