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]

Fix PR target/11520


2004-03-19  Denis Chertykov  <denisc@overta.ru>

	* config/avr/avr.md ("call_insn"): Handle explicit integer
	specially.
	(call_value_insn): Likewise.


Index: avr.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.md,v
retrieving revision 1.44
diff -c -3 -p -r1.44 avr.md
*** avr.md	15 Mar 2004 18:20:47 -0000	1.44
--- avr.md	19 Mar 2004 19:55:04 -0000
***************
*** 2086,2093 ****
    "")
  
  (define_insn "call_insn"
!   [(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "!z,*r,i"))
!          (match_operand:HI 1 "general_operand" "X,X,X"))]
  ;; We don't need in saving Z register because r30,r31 is a call used registers
    ;; Operand 1 not used on the AVR.
    "(register_operand (operands[0], HImode) || CONSTANT_P (operands[0]))"
--- 2086,2093 ----
    "")
  
  (define_insn "call_insn"
!   [(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "!z,*r,s,n"))
!          (match_operand:HI 1 "general_operand" "X,X,X,X"))]
  ;; We don't need in saving Z register because r30,r31 is a call used registers
    ;; Operand 1 not used on the AVR.
    "(register_operand (operands[0], HImode) || CONSTANT_P (operands[0]))"
***************
*** 2104,2112 ****
  		AS2 (mov, r31, %B0) CR_TAB
  		\"icall\");
      }
!   return AS1(%~call,%c0);
  }"
!   [(set_attr "cc" "clobber,clobber,clobber")
     (set_attr_alternative "length"
  			 [(const_int 1)
  			  (if_then_else (eq_attr "mcu_enhanced" "yes")
--- 2104,2116 ----
  		AS2 (mov, r31, %B0) CR_TAB
  		\"icall\");
      }
!   else if (which_alternative==2)
!     return AS1(%~call,%c0);
!   return (AS2 (ldi,r30,lo8(%0)) CR_TAB
!           AS2 (ldi,r31,hi8(%0)) CR_TAB
!           \"icall\");
  }"
!   [(set_attr "cc" "clobber,clobber,clobber,clobber")
     (set_attr_alternative "length"
  			 [(const_int 1)
  			  (if_then_else (eq_attr "mcu_enhanced" "yes")
***************
*** 2114,2130 ****
  					(const_int 3))
  			  (if_then_else (eq_attr "mcu_mega" "yes")
  					(const_int 2)
! 					(const_int 1))])])
  
  (define_insn "call_value_insn"
!   [(set (match_operand 0 "register_operand" "=r,r,r")
!         (call (mem:HI (match_operand:HI 1 "nonmemory_operand" "!z,*r,i"))
  ;; We don't need in saving Z register because r30,r31 is a call used registers
!               (match_operand:HI 2 "general_operand" "X,X,X")))]
    ;; Operand 2 not used on the AVR.
    "(register_operand (operands[0], VOIDmode) || CONSTANT_P (operands[0]))"
!   "*
! {
    if (which_alternative==0)
       return \"icall\";
    else if (which_alternative==1)
--- 2118,2134 ----
  					(const_int 3))
  			  (if_then_else (eq_attr "mcu_mega" "yes")
  					(const_int 2)
! 					(const_int 1))
! 			  (const_int 3)])])
  
  (define_insn "call_value_insn"
!   [(set (match_operand 0 "register_operand" "=r,r,r,r")
!         (call (mem:HI (match_operand:HI 1 "nonmemory_operand" "!z,*r,s,n"))
  ;; We don't need in saving Z register because r30,r31 is a call used registers
!               (match_operand:HI 2 "general_operand" "X,X,X,X")))]
    ;; Operand 2 not used on the AVR.
    "(register_operand (operands[0], VOIDmode) || CONSTANT_P (operands[0]))"
!   "*{
    if (which_alternative==0)
       return \"icall\";
    else if (which_alternative==1)
***************
*** 2137,2145 ****
  		AS2 (mov, r31, %B1) CR_TAB
  		\"icall\");
      }
!   return AS1(%~call,%c1);
  }"
!   [(set_attr "cc" "clobber,clobber,clobber")
     (set_attr_alternative "length"
  			 [(const_int 1)
  			  (if_then_else (eq_attr "mcu_enhanced" "yes")
--- 2141,2153 ----
  		AS2 (mov, r31, %B1) CR_TAB
  		\"icall\");
      }
!   else if (which_alternative==2)
!     return AS1(%~call,%c1);
!   return (AS2 (ldi, r30, lo8(%1)) CR_TAB
!           AS2 (ldi, r31, hi8(%1)) CR_TAB
!           \"icall\");
  }"
!   [(set_attr "cc" "clobber,clobber,clobber,clobber")
     (set_attr_alternative "length"
  			 [(const_int 1)
  			  (if_then_else (eq_attr "mcu_enhanced" "yes")
***************
*** 2147,2153 ****
  					(const_int 3))
  			  (if_then_else (eq_attr "mcu_mega" "yes")
  					(const_int 2)
! 					(const_int 1))])])
  
  (define_insn "return"
    [(return)]
--- 2155,2162 ----
  					(const_int 3))
  			  (if_then_else (eq_attr "mcu_mega" "yes")
  					(const_int 2)
! 					(const_int 1))
! 			  (const_int 3)])])
  
  (define_insn "return"
    [(return)]


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