This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] RTL prologue/epilogue for SPARC
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: davem at redhat dot com (David S. Miller),gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Jun 2004 18:55:29 +0200
- Subject: Re: [RFC] RTL prologue/epilogue for SPARC
- References: <200406211548.i5LFmg623722@chloe.uk.w2k.superh.com>
> > Ok, thanks for the explanation. My problem comes from emitting the
> > prologue/epilogue later than usual (because of the register window).
>
> I don't see why this should cause a problem (other than stressing the
> cfglayout code a bit more). You just hand on to the edge pointing to
> EXIT_BLOCK_POINTER a bit longer.
Yes, that's why I figured out.
> I don't think it would cause incorrect code to be generated or ICEs, but
> it papers over a problem in your machine description, at the expense of
> giving worse code for tagets that set late_rtl_prologue_epilogue.
> (Admittedly, that's currently only SPARC.)
I get ICEs in the BB reordering pass, which is run before I emit the
epilogue, because the pass calls the cfglayout machinery and there is no
return insn. So I'd think the problem comes from what you call "stressing
the cfglayout code a bit more" rather than from the back-end per se.
> No, it's right there:
>
> ! /* Expand the function epilogue, either normal or part of a sibcall.
> ! We emit all the instructions except the return or the call. */
> !
> ! void
> ! sparc_expand_epilogue (void)
> ! {
> ! int leaf_function_p = current_function_uses_only_leaf_regs;
>
> if (num_gfregs)
> ! emit_restore_regs ();
>
> ! if (actual_fsize == 0)
> ! /* do nothing. */ ;
> ! else if (leaf_function_p)
> ! {
> ! if (actual_fsize <= 4096)
> ! emit_stack_pointer_decrement (GEN_INT (- actual_fsize));
> ! else if (actual_fsize <= 8192)
> {
> ! emit_stack_pointer_decrement (GEN_INT (-4096));
> ! emit_stack_pointer_decrement (GEN_INT (4096 - actual_fsize));
> }
> else
> {
> ! rtx reg = gen_rtx_REG (Pmode, 1);
> ! emit_move_insn (reg, GEN_INT (-actual_fsize));
> ! emit_stack_pointer_decrement (reg);
> }
> }
> }
And? Every time gen_epilogue is called, the return is emitted by the
expander (there is no DONE, unlike in sh.md). What do you want me to do
instead?
--
Eric Botcazou