This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix rtl-optimization/58021
- From: Jeff Law <law at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at embecosm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Eric Botcazou <ebotcazou at libertysurf dot fr>
- Date: Mon, 29 Jul 2013 15:35:53 -0600
- Subject: Re: RFA: Fix rtl-optimization/58021
- References: <20130729162406 dot tunrdei084808gw8-nzlynne at webmail dot spamcop dot net>
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.
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
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?