This is the mail archive of the gcc-bugs@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: ARM/THUMB long calls stubs


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"

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