This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch RFA] Fix PR rtl-optimization/35190
- From: "Steven Bosscher" <stevenb dot gcc at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Kaz Kojima" <kkojima at rr dot iij4u dot or dot jp>
- Date: Fri, 15 Feb 2008 23:07:45 +0100
- Subject: Re: [patch RFA] Fix PR rtl-optimization/35190
xf. http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00587.html
Kaz wrote:
> - /* Don't substitute into a non-local goto, this confuses CFG. */
> + /* Don't substitute into a non-local goto, this confuses CFG.
> + Since bb-reorder uses indirect jumps for crossing branches
> + when the architecture doesn't have unconditional branches
> + that can span all of memory, don't touch a jump associated
> + with a REG_CROSSING_JUMP note. */
This seems like just a way to paper over the problem.
If local-alloc makes a substitution that results in a bad insn, then
the validation of the substitution should fail. The SH target specific
code should just not accept this. Or, you could test for
HAS_LONG_UNCOND_BRANCH like bb-reorder.c does. There is nothing I see
in this bug report that is limited to hot/cold splitting, you can
probably trigger this bug with a carefully crafted test case. Finally,
it's not clear (at least to me) whether there are other substitutions
that your patch would disable.
Although doing this optimization in local-alloc seems out of place to
begin with...
Oh, and btw, fix_crossing_conditional_branches() is called twice in
bb-reorder.c:fix_edges_for_rarely_executed_code(). This looks like a
merge error.
Gr.
Steven