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.
>
OK
Jeff