First implemented in r328030 / 858a7dd6d70bfed500e0e2a5137f25dd71b90f19 and I
speculated in this review about what exactly we should be doing here - and now
I've come across some changes I'm making that trip over the somewhat arbitrary
behavior we chose here & deciding to revisit it for more correctness/less
arbitrariness.
With that previous commit, we made a single contiguous range (high/low_pc) from
the first and last entry in the range list - that's not correct, especially at
the CU level where this address range might then span multiple sections (maybe
even not sections that would all be unified by the linker, even - if you have
functions in special sections). Instead, just don't emit any addresses (ranges
or low/high) for such an entity.
I made the change for nested constructs (not just the CU) as well, though there
doesn't seem to be test coverage for that - I can add that if folks think it's
worthwhile. (probably should, I'm just being lazy) This could still hit the
multiple different sections issue in cases like -fbasic-block-sections.
Alexey - a question I had on the orginal patch: Any idea what other compilers
have done in this case? Is it the original behavior implemented here (beginning
of the first range to the end of the last, sort of paving over any address
holes).