RFA: Fix rtl-optimization/58021

Jeff Law law@redhat.com
Mon Jul 29 21:41:00 GMT 2013


On 07/29/2013 02:24 PM, Joern Rennecke wrote:
> The interesting case where we encounter a basic block head is when
> the check of return_copy for BB_HEAD check succeeds with return_copy
> being a label; then last_insn is a NOTE_INSN_BASIC_BLOCK, and we must
> not try to split off a part of the basic block before that note. That
> can be properly tested for by changing the !INSN_P (last_insn) check
> into a NOTE_INSN_BASIC_BLOCK_P (last_insn) check.
>
> last_insn == BB_HEAD (src_bb) can't actually be true, because we
> don't copy return_copy to last_insn when we've bit BB_HEAD, so I
> removed that test.
>
> bootstrapped / regtested on i686-pc-linux-gnu .
OK for the trunk.

>
>
>
> AFAICT, the second block split is useless, and could be replaced
> with pre_exit = src_bb; , and then the slack space allocated for
> post_entry / pre_exit blocks reduced to two.  However, I didn't want
> to tie a bugfix with a potentialy destabilizing cleanup - maybe
> there's some target port code (in the context of likely spilled
> classes?) that relies on the MODE_EXIT switch note only before, but
> in a block separate from the return value copy?
Well, the mode switching code is only used on sh (which you obviously 
know quite well) x86 and the epiphany ports.  I trust your judgement on 
this since you've probably dealt more with the optimize_switching code 
than anyone.

jeff



More information about the Gcc-patches mailing list