Bug fix for optimize_mode_switching / NORMAL_MODE

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Wed May 29 09:11:00 GMT 2002


Hello.

> Zdenek Dvorak:
> > I really do not see into what lcm.c does; but would not creating some
> > sort of fake block at the end of chain and removing it later work?
> 
> Yes, it would; however, you'd have to allocate that fake block, copy the exit
> block to it, redirect all the predecessors of the exit block to that fake
> block, and make an edge betwen the fake block and the exit block.
> At the end, you'd have to remove the edge between exit block and fake block,
> redirect the fake block predecessors back to the exit block, and deallocate.

Unfortunatelly neither split_block nor merge_blocks_nomove can be
directly used with exit block; so it is not that straightforward as I
thought :-( It might however be beneficial to modify them so that they
can handle this special case (it seems to me that this transformation may
be generally useful).

> It would be easier if we just redefine EXIT_BLOCK_PTR and ENTRY_BLOCK_PTR in
> lcm.c
> to be global pointer variables - initialized to entry_exit_block[[01]], and set
> them to new values in the NORMAL_MODE case.

I would prefer to avoid this kind of hacks.

Zdenek



More information about the Gcc-patches mailing list