This is the mail archive of the 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]
Other format: [Raw text]

Re: RFA: remove fixup_fallthru_exit_predecessor

> On Fri, Jun 04, 2004 at 04:56:11PM +0100, Joern Rennecke wrote:
> > 2004-06-03  J"orn Rennecke <>
> > 
> > 	* basic-block.h (could_fall_through): Declare.
> > 	* cfganal.c (can_fallthru): Suceed if the target is EXIT_BLOCK_PTR.
> > 	Fail if the source already has a fallthrough edge to the exit
> > 	block pointer.
> > 	(could_fall_through): New function.
> > 	(make_edges): Check if we already have a fallthrough edge to the
> > 	exit block pointer.
> > 	cfglayout.c (fixup_fallthru_exit_predecessor): Delete.
> > 	(cfg_layout_finalize): Don't call it.
> > 	(fixup_reorder_chain): A fall through to the exit block does not
> > 	require the block to come last.  Add sanity checks.
> > 	* cfgrtl.c (rtl_split_edge): Add special handling of fall through
> > 	edges to the exit block.
> Ok.

Oops, I just see that we still have targets that output assembler epilogues.
I suppose the right thing to do is to make thread_prologue_and_epilogue_insns
always check for a fall-through edge to the exit block if we couldn't
use a return, and if we can't use an rtl prologue either, to generate
a new basic block at the end of the function and redirect all the exit edges
to it.

This does not give optimal code, but at lest it should work.
There might be some targets that have both high pressure on the return
register and asm epilogues, so trying to use fixup_fallthru_exit_predecessor
just for some targets would be fraught with danger.
If optimal code is desired, it is better to use rtl epilogues anyway.  And
besides, AFAIK most functions still end up with the exit block at the end.

Right now I am searching for a testcase.  I've put an abort where the fix-up
code would go and try to build an sparc-elf cross.

> Also ok is 
> which I've misplaced in my mailbox.

Thanks, I have checked this in.

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