Tweaks to RTL locus preservation code

Eric Botcazou ebotcazou@adacore.com
Thu Oct 21 22:07:00 GMT 2010


In http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00017.html, Jakub introduced 
code to preserve location info on control-flow altering constructs at -O0.
The attached patch makes a couple of changes to the RTL part of this code:

 1. In try_forward_edges, instead of throwing away previous steps when running 
into a different locus on an edge or an insn, the modified code only throws 
away the last step and forwards edges up to this point; this in the process 
gets rid of the bogus "Infinite loop" messages present in the RTL dumps when 
the condition triggers.

 2. try_optimize_cfg can also be bypass certain forwarder blocks by merging 
them with their single predecessor; in this case, a locus on the single edge 
in-between will be lost if it is already present on an previous instruction.
The modified code propagates it onto the outgoing edge if possible.  It also 
arranges to have the same messages in the dumps for CFG RTL or layout modes.

Tested (GCC + GDB) on x86_64-suse-linux, applied on the mainline.


2010-10-21  Eric Botcazou  <ebotcazou@adacore.com>

	* cfgcleanup.c (try_forward_edges): Do not throw away previous steps
	when stopping because of a different locus on edge or insn.
	(try_optimize_cfg): Add comment.
	* cfgrtl.c (rtl_merge_blocks): Tweak log message.  If the destination
	block is a forwarder block, propagate locus on the edge.
	(cfg_layout_merge_blocks): Likewise.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 3762 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101021/8cacb9e0/attachment.bin>


More information about the Gcc-patches mailing list