On 06/22/2018 02:39 AM, Richard Biener wrote: > On Thu, Jun 21, 2018 at 9:37 PM Jeff Law <l...@redhat.com> wrote: >> >> On 06/21/2018 11:04 AM, Eric Botcazou wrote: >>> When code is compiled at -O0, the RTL middle-end makes sure that location >>> information is preserved as much as possible by generating NOPs with the >>> location information (goto_locus) present on edges in the CFG, if it thinks >>> that these edges are the only place where a particular location is >>> mentioned. >>> >>> The attached patch prevents this from happening in a couple of cases: >>> 1. if the function has the DECL_IGNORED_P flag set, >>> 2. if the NOP is emitted by merge_blocks and the 2nd block is a forwarder >>> block whose outgoing edge has no location, because in this case the location >>> of the to-be-elided edge is copied onto the aforementioned outgoing edge. >>> >>> Tested (GCC and GDB) on x86-64/Linux, applied on the mainline. >>> >>> >>> 2018-06-21 Eric Botcazou <ebotca...@adacore.com> >>> >>> * cfgrtl.c (fixup_reorder_chain): Do not emit NOPs in DECL_IGNORED_P >>> functions. >>> (rtl_merge_blocks): Likewise. Do not emit a NOP if the location of >>> the >>> edge can be forwarded. >>> (cfg_layout_merge_blocks): Likewise. >> Funny Alex and I were just talking about the need to stuff away debug >> info on edges for gimple. Attaching it to gimple nops sounds like a >> fairly straightforward approach :-) > > But wouldn't that create BBs? Sounds like you want DEBUG PHIs... :/ We talked about those too :-)
Jeff