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: [Patch ARM] Turn on sibling calls for Thumb2.


Daniel Jacobowitz wrote:

> FYI, Mark Mitchell tested an internal patch to do this last year, and
> discovered it broke early returns from functions that end in a tail
> call.  It was something to do with USE_RETURN_INSN, but we didn't
> get to the bottom of it at the time.

My notes say this:

> Unfortunately, the sibcall experiment failed.  The problem that occurs
> is that in a function that uses sibcalls, we don't generate proper
> return instructions elsewhere.  That's apparently because of:
> 
> ;; Often the return insn will be the same as loading from memory, so set
> (define_insn "return"
>   [(return)]
>   "TARGET_ARM && USE_RETURN_INSN (FALSE)"
>   "*
> 
> and:
> 
> /* Determine if the epilogue should be output as RTL.
> 
>    You should override this if you define FUNCTION_EXTRA_EPILOGUE.  */
> /* This is disabled for Thumb-2 because it will confuse the
> 
>    conditional insn counter.  */
> #define USE_RETURN_INSN(ISCOND)                         \
>   (TARGET_ARM ? use_return_insn (ISCOND, NULL) : 0)

My conclusion was that to fix this, we would need to first fix Thumb-2
to use RTL epilogues.  Which would certainly be a good thing.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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