This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ARM/THUMB long calls stubs
- From: Nick Clifton <nickc at redhat dot com>
- To: Sami Kantoluoto <sami dot kantoluoto at embedtronics dot fi>
- Cc: Andy Green <andy dot green at oxsemi dot com>, Richard Earnshaw <rearnsha at arm dot com>, gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Jul 2004 17:04:58 +0100
- Subject: Re: ARM/THUMB long calls stubs
- References: <20040729135829.GA24137@embedtronics.fi>
Hi Sami,
oops - the previous version of the patch forgot to allow for the
increased length of the call insns. Please try this version instead.
Cheers
Nick
Index: gcc/config/arm/arm.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.md,v
retrieving revision 1.154
diff -c -3 -p -r1.154 arm.md
*** gcc/config/arm/arm.md 13 Jan 2004 13:24:37 -0000 1.154
--- gcc/config/arm/arm.md 29 Jul 2004 16:03:49 -0000
***************
*** 7203,7212 ****
{
if (TARGET_CALLER_INTERWORKING)
return \"bl\\t%__interwork_call_via_%0\";
else
return \"bl\\t%__call_via_%0\";
}"
! [(set_attr "type" "call")]
)
(define_insn "*call_value_indirect"
--- 7203,7216 ----
{
if (TARGET_CALLER_INTERWORKING)
return \"bl\\t%__interwork_call_via_%0\";
+ else if (TARGET_LONG_CALLS)
+ /* For long calls the __call_via functions might not be near
+ this branch, so we have to synthesise their actions. */
+ return \"bl\\t0f\\n\\tb\\t1f\\n0:\\tbx\\t%0\\n1:\";
else
return \"bl\\t%__call_via_%0\";
}"
! [(set_attr "type" "call")(set_attr "length" "8")]
)
(define_insn "*call_value_indirect"
***************
*** 7220,7229 ****
{
if (TARGET_CALLER_INTERWORKING)
return \"bl\\t%__interwork_call_via_%1\";
else
return \"bl\\t%__call_via_%1\";
}"
! [(set_attr "type" "call")]
)
(define_expand "call_value"
--- 7224,7237 ----
{
if (TARGET_CALLER_INTERWORKING)
return \"bl\\t%__interwork_call_via_%1\";
+ else if (TARGET_LONG_CALLS)
+ /* For long calls the __call_via functions might not be near
+ this branch, so we have to synthesise their actions. */
+ return \"bl\\t0f\\n\\tb\\t1f\\n0:\\tbx\\t%1\\n1:\";
else
return \"bl\\t%__call_via_%1\";
}"
! [(set_attr "type" "call")(set_attr "length" "8")]
)
(define_expand "call_value"