arm.md sibcall patterns

DJ Delorie dj@redhat.com
Mon Feb 12 18:46:00 GMT 2001


While working on a bug on one of our private branches, I noticed that
sibcall patterns were being used instead of regular call patterns, and
fixed it.  A similar (or is it?) fix was added to the official
sources, but that fix makes the sibcall patterns claim to use the link
register, which is not true.  It was suggested to me to use (return)
instead, especially since the patterns sorta really do that.  Does
this patch make sense?

2001-02-12  DJ Delorie  <dj@redhat.com>

	* config/arm/arm.md: Tag sibcall patterns with a (return),
	rather than lie about using the link register.

Index: config/arm/arm.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.md,v
retrieving revision 1.80
diff -p -4 -r1.80 arm.md
*** config/arm/arm.md	2001/02/09 18:47:05	1.80
--- config/arm/arm.md	2001/02/13 02:44:47
***************
*** 6678,6687 ****
  ;; We may also be able to do sibcalls for Thumb, but it's much harder...
  (define_expand "sibcall"
    [(parallel [(call (match_operand 0 "memory_operand" "")
  		    (match_operand 1 "general_operand" ""))
! 	      (use (match_operand 2 "" ""))
! 	      (use (reg:SI LR_REGNUM))])]
    "TARGET_ARM"
    "
    {
      if (operands[2] == NULL_RTX)
--- 6678,6687 ----
  ;; We may also be able to do sibcalls for Thumb, but it's much harder...
  (define_expand "sibcall"
    [(parallel [(call (match_operand 0 "memory_operand" "")
  		    (match_operand 1 "general_operand" ""))
! 	      (return)
! 	      (use (match_operand 2 "" ""))])]
    "TARGET_ARM"
    "
    {
      if (operands[2] == NULL_RTX)
***************
*** 6692,6701 ****
  (define_expand "sibcall_value"
    [(parallel [(set (match_operand 0 "register_operand" "")
  		   (call (match_operand 1 "memory_operand" "")
  			 (match_operand 2 "general_operand" "")))
! 	      (use (match_operand 3 "" ""))
! 	      (use (reg:SI LR_REGNUM))])]
    "TARGET_ARM"
    "
    {
      if (operands[3] == NULL_RTX)
--- 6692,6701 ----
  (define_expand "sibcall_value"
    [(parallel [(set (match_operand 0 "register_operand" "")
  		   (call (match_operand 1 "memory_operand" "")
  			 (match_operand 2 "general_operand" "")))
! 	      (return)
! 	      (use (match_operand 3 "" ""))])]
    "TARGET_ARM"
    "
    {
      if (operands[3] == NULL_RTX)
***************
*** 6705,6714 ****
  
  (define_insn "*sibcall_insn"
   [(call (mem:SI (match_operand:SI 0 "" "X"))
  	(match_operand 1 "" ""))
!   (use (match_operand 2 "" ""))
!   (use (reg:SI LR_REGNUM))]
    "TARGET_ARM && GET_CODE (operands[0]) == SYMBOL_REF"
    "*
    return NEED_PLT_RELOC ? \"b%?\\t%a0(PLT)\" : \"b%?\\t%a0\";
    "
--- 6705,6714 ----
  
  (define_insn "*sibcall_insn"
   [(call (mem:SI (match_operand:SI 0 "" "X"))
  	(match_operand 1 "" ""))
!   (return)
!   (use (match_operand 2 "" ""))]
    "TARGET_ARM && GET_CODE (operands[0]) == SYMBOL_REF"
    "*
    return NEED_PLT_RELOC ? \"b%?\\t%a0(PLT)\" : \"b%?\\t%a0\";
    "
***************
*** 6718,6727 ****
  (define_insn "*sibcall_value_insn"
   [(set (match_operand 0 "s_register_operand" "=r,f")
         (call (mem:SI (match_operand:SI 1 "" "X,X"))
  	     (match_operand 2 "" "")))
!   (use (match_operand 3 "" ""))
!   (use (reg:SI LR_REGNUM))]
    "TARGET_ARM && GET_CODE (operands[1]) == SYMBOL_REF"
    "*
    return NEED_PLT_RELOC ? \"b%?\\t%a1(PLT)\" : \"b%?\\t%a1\";
    "
--- 6718,6727 ----
  (define_insn "*sibcall_value_insn"
   [(set (match_operand 0 "s_register_operand" "=r,f")
         (call (mem:SI (match_operand:SI 1 "" "X,X"))
  	     (match_operand 2 "" "")))
!   (return)
!   (use (match_operand 3 "" ""))]
    "TARGET_ARM && GET_CODE (operands[1]) == SYMBOL_REF"
    "*
    return NEED_PLT_RELOC ? \"b%?\\t%a1(PLT)\" : \"b%?\\t%a1\";
    "



More information about the Gcc-patches mailing list