https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58479

--- Comment #15 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
t and the lexical block enclosing it are regarded as unused by
remove_unused_scope_block_p, so process_scope_var doesn't get a chance to
output location information for t.  It's there at all because of early debug
info recording.  remove_unused_locals has a comment just before the test for
is_gimple_debug that suggests a good spot to keep the block alive, but it has a
significant impact on compile memory use and debug info size, even though it's
not clear that the unused variable would remain in the scope block decl list so
as to get a loclist.  I suppose it is not sensible to keep debug bind stmts for
discarded variables past this point, but in several cases, including this, it's
hard to figure out because the bind stmts refer to SRAed fragments of the
actual variable.

Reply via email to