This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Update BBs in cleanup_barriers pass (PR rtl-optimization/61058)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 Jan 2015 09:41:39 +0100
- Subject: Re: [PATCH] Update BBs in cleanup_barriers pass (PR rtl-optimization/61058)
- Authentication-results: sourceware.org; auth=none
- References: <20150122204317 dot GM1746 at tucnak dot redhat dot com> <2504092 dot nZhz1bK3s6 at polaris> <20150126091100 dot GG1746 at tucnak dot redhat dot com> <1733432 dot yb2b9bkGJx at polaris>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jan 27, 2015 at 09:25:32AM +0100, Eric Botcazou wrote:
> > Yes, they do, that is why it crashed during final.
>
> OK. Why wouldn't it work to call reorder_insns instead of reorder_insns_nobb?
Because reorder_insns doesn't handle the case of moving a barrier into a
middle of basic block.
if (!BARRIER_P (from)
&& (bb2 = BLOCK_FOR_INSN (from)))
{
if (BB_END (bb2) == to)
BB_END (bb2) = prev;
df_set_bb_dirty (bb2);
}
if (BB_END (bb) == after)
BB_END (bb) = to;
for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
if (!BARRIER_P (x))
df_insn_change_bb (x, bb);
from == to is a BARRIER in this case, BB_END (bb) != after (BB_END
is actually PREV_INSN (from)), so this doesn't do anything at all.
While what we need is:
1) set BB_END to after
2) clear BLOCK_FOR_INSN on the notes after AFTER (after addition of
barrier after FROM == TO) until former PREV_INSN (FROM) (inclusive)
Jakub