On Sun, Jul 16, 2006 at 06:05:32PM -0700, Ian Lance Taylor wrote: > 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.
OK. > 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. Yes, that's correct. > 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. Sorry about that, I tried to make sure that scope_labelno was consistent. > 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. I'm testing a patch for this right now. > 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. Using scope_labelno for both cases made the patch clearer. I wanted the patch to be as simple as possible. Sorry I missed thinking about the thunks. I'll get back ASAP when my current patch finishes testing. Cheers, Carlos. -- Carlos O'Donell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x716