regmove sometimes fails to update basic_block_end

Bernd Schmidt crux@Pool.Informatik.RWTH-Aachen.DE
Thu Oct 1 04:14:00 GMT 1998


>   > 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



More information about the Gcc-patches mailing list