Getting rid of duplicate .debug_ranges

Cary Coutant ccoutant@google.com
Fri Jan 20 22:45:00 GMT 2012


>> Is there a way to detect that basic blocks have the same range even
>> though they have different block numbers? Or am I not looking/thinking
>> about this issue correctly?

I may be oversimplifying this, but it seems that
gen_inlined_subroutine_die generates a DW_AT_ranges list, then calls
decls_for_scope, which results in a call to gen_lexical_block_die,
which generates another DW_AT_ranges list, but in both cases,
BLOCK_FRAGMENT_CHAIN(stmt) points to the same list of block fragments.
I'd think you could just keep a single-entry cache in
add_high_low_attributes that remembers the last value of
BLOCK_FRAGMENT_CHAIN(stmt) and the pointer returned from add_ranges
(stmt) for that chain. If you get a match, just generate a
DW_AT_ranges entry using the range list already generated.

-cary



More information about the Gcc mailing list