This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: regmove sometimes fails to update basic_block_end


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]