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]
Other format: [Raw text]

Re: [RFC] RTL prologue/epilogue for SPARC


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


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