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] Enable sibling calls for Thumb-2


On Mon, 2010-02-15 at 12:46 +0000, Julian Brown wrote:
> Hi,
> 
> This patch turns on sibling calls for Thumb-2. It works in cases which
> failed with earlier patches, e.g. described in the thread here:
> 
>   http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01291.html
> 
> Specifically,
> 
>   http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01317.html
> 
> The patch does not allow sibling calls to be conditional: I have a
> strong suspicion that would create problems for the linker at present,
> e.g. for interworking and/or long-branch stub generation. I think this
> addresses, or at least sidesteps, the issue mentioned in the (removed)
> comment on USE_RETURN_INSN about confusing the conditional insn counter.
> 
> Testing (cross to ARM Linux, targeting ARMv7-a/Thumb) shows a couple of
> progressions. OK to apply (when we get to stage 1)?
> 
> Cheers,
> 
> Julian
> 
> ChangeLog
> 
>     Julian Brown  <julian@codesourcery.com>
>     Mark Mitchell  <mark@codesourcery.com>
> 
>     gcc/
>     * config/arm/arm.c (arm_function_ok_for_sibcall): Allow sibling
>     calls for Thumb-2.
In the patch you wrote !TARGET_32BIT.  Why not use TARGET_THUMB1
(particularly since the comment talks specifically about not doing this
for Thumb1)?  
>     (output_return_instruction): Use pop not ldmfd for Thumb-2.
This bit doesn't appear in your patch.

>     * config/arm/arm.h (USE_RETURN_INSN): Enable for Thumb-2.
>     * config/arm/arm.md (*call_symbol, *call_value_symbol): Use for
>     Thumb-2.
>     (*call_insn, *call_value_insn): Don't use for Thumb-2.
>     (sibcall, sibcall_value, *sibcall_insn, *sibcall_value_insn): Use
>     for Thumb-2.
>     (return): New expander.
>     (*arm_return): New name for ARM return insn.
>     (*thumb2_return): New insn pattern.
thumb2_return should be in thumb2.md

R.


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