This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: regmove sometimes fails to update basic_block_end
- To: Jeffrey A Law <law at cygnus dot com>
- Subject: Re: regmove sometimes fails to update basic_block_end
- From: Bernd Schmidt <crux at Pool dot Informatik dot RWTH-Aachen dot DE>
- Date: Thu, 1 Oct 1998 13:14:11 +0200 (MET DST)
- cc: egcs-patches at cygnus dot com
> > I've attached a suggested fix. This fix relies on the basic block heads
> > being correct in all cases (regmove does try to update them).
> Why not keep basic_block_end up-to-date as we insert insns like we do for
> basic_block_head? If that's too complicated, then we'll go with your patch.
Because we can't tell easily which basic block an insn is in. So if we
insert after insn X, we have to check all basic blocks whether X is the end
of the basic block. Other solutions are possible; e.g. regmove already
allocates a regmove_bb_head array that indicates which insns are basic block
heads. However, that is of fixed size and can't hold any new insns generated
during regmove (I'm not even convinced that the code in copy_src_to_dest
never accesses it outside its range).
All solutions I can think of are awkward.
>
> > Handling this sort of thing would be easier if every insn had an additional
> > field that carried the basic block number. Would such a change be applied?
> I think it's more likely that we'll have notes in the insn chain itself to
> mark the start/end of each bb.
And these never get changed? That sounds better, of course.
Bernd