Commit bdfe906f by Richard Henderson Committed by Richard Henderson

avr.c (TARGET_EXCEPT_UNWIND_INFO): New.

	* config/avr/avr.c (TARGET_EXCEPT_UNWIND_INFO): New.
	(avr_incoming_return_addr_rtx): New.
	(emit_push_byte): New.
	(expand_prologue): Use it.  Remove incorrect dwarf annotation for
	SREG, RAMPZ, zero register.  Push frame pointer by bytes.  Add dwarf
	annotation for __prologue_saves__.  Fixup dwarf annotation for CFA.
	(emit_pop_byte): New.
	(expand_epilogue): Use it.  Pop frame pointer by bytes.
	* config/avr/avr.h (FRAME_POINTER_CFA_OFFSET): Remove.
	(INCOMING_RETURN_ADDR_RTX): New.
	(INCOMING_FRAME_SP_OFFSET): New.
	(ARG_POINTER_CFA_OFFSET): New.
	* config/avr/avr.md (*pushqi): Fix mode of auto-inc.
	(*pushhi, *pushsi, *pushsf, popqi): Likewise.
	(pophi): Remove.

From-SVN: r171295
parent 5b13621b
2011-03-22 Richard Henderson <rth@redhat.com>
* config/avr/avr.c (TARGET_EXCEPT_UNWIND_INFO): New.
(avr_incoming_return_addr_rtx): New.
(emit_push_byte): New.
(expand_prologue): Use it. Remove incorrect dwarf annotation for
SREG, RAMPZ, zero register. Push frame pointer by bytes. Add dwarf
annotation for __prologue_saves__. Fixup dwarf annotation for CFA.
(emit_pop_byte): New.
(expand_epilogue): Use it. Pop frame pointer by bytes.
* config/avr/avr.h (FRAME_POINTER_CFA_OFFSET): Remove.
(INCOMING_RETURN_ADDR_RTX): New.
(INCOMING_FRAME_SP_OFFSET): New.
(ARG_POINTER_CFA_OFFSET): New.
* config/avr/avr.md (*pushqi): Fix mode of auto-inc.
(*pushhi, *pushsi, *pushsf, popqi): Likewise.
(pophi): Remove.
2011-03-22 Nathan Froyd <froydnj@codesourcery.com> 2011-03-22 Nathan Froyd <froydnj@codesourcery.com>
* tree.c (build_call_1): New function. * tree.c (build_call_1): New function.
......
...@@ -108,6 +108,7 @@ extern RTX_CODE avr_normalize_condition (RTX_CODE condition); ...@@ -108,6 +108,7 @@ extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
extern int compare_eq_p (rtx insn); extern int compare_eq_p (rtx insn);
extern void out_shift_with_cnt (const char *templ, rtx insn, extern void out_shift_with_cnt (const char *templ, rtx insn,
rtx operands[], int *len, int t_len); rtx operands[], int *len, int t_len);
extern rtx avr_incoming_return_addr_rtx (void);
#endif /* RTX_CODE */ #endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
......
...@@ -351,9 +351,6 @@ enum reg_class { ...@@ -351,9 +351,6 @@ enum reg_class {
#define STATIC_CHAIN_REGNUM 2 #define STATIC_CHAIN_REGNUM 2
/* Offset from the frame pointer register value to the top of the stack. */
#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
#define ELIMINABLE_REGS { \ #define ELIMINABLE_REGS { \
{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
...@@ -794,6 +791,13 @@ mmcu=*:-mmcu=%*}" ...@@ -794,6 +791,13 @@ mmcu=*:-mmcu=%*}"
#define OBJECT_FORMAT_ELF #define OBJECT_FORMAT_ELF
#define INCOMING_RETURN_ADDR_RTX avr_incoming_return_addr_rtx ()
#define INCOMING_FRAME_SP_OFFSET (AVR_3_BYTE_PC ? 3 : 2)
/* The caller's stack pointer value immediately before the call
is one byte below the first argument. */
#define ARG_POINTER_CFA_OFFSET(FNDECL) -1
#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \ #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
avr_hard_regno_rename_ok (OLD_REG, NEW_REG) avr_hard_regno_rename_ok (OLD_REG, NEW_REG)
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
(define_insn "*pushqi" (define_insn "*pushqi"
[(set (mem:QI (post_dec (reg:HI REG_SP))) [(set (mem:QI (post_dec:HI (reg:HI REG_SP)))
(match_operand:QI 0 "reg_or_0_operand" "r,L"))] (match_operand:QI 0 "reg_or_0_operand" "r,L"))]
"" ""
"@ "@
...@@ -189,9 +189,8 @@ ...@@ -189,9 +189,8 @@
push __zero_reg__" push __zero_reg__"
[(set_attr "length" "1,1")]) [(set_attr "length" "1,1")])
(define_insn "*pushhi" (define_insn "*pushhi"
[(set (mem:HI (post_dec (reg:HI REG_SP))) [(set (mem:HI (post_dec:HI (reg:HI REG_SP)))
(match_operand:HI 0 "reg_or_0_operand" "r,L"))] (match_operand:HI 0 "reg_or_0_operand" "r,L"))]
"" ""
"@ "@
...@@ -200,7 +199,7 @@ ...@@ -200,7 +199,7 @@
[(set_attr "length" "2,2")]) [(set_attr "length" "2,2")])
(define_insn "*pushsi" (define_insn "*pushsi"
[(set (mem:SI (post_dec (reg:HI REG_SP))) [(set (mem:SI (post_dec:HI (reg:HI REG_SP)))
(match_operand:SI 0 "reg_or_0_operand" "r,L"))] (match_operand:SI 0 "reg_or_0_operand" "r,L"))]
"" ""
"@ "@
...@@ -209,7 +208,7 @@ ...@@ -209,7 +208,7 @@
[(set_attr "length" "4,4")]) [(set_attr "length" "4,4")])
(define_insn "*pushsf" (define_insn "*pushsf"
[(set (mem:SF (post_dec (reg:HI REG_SP))) [(set (mem:SF (post_dec:HI (reg:HI REG_SP)))
(match_operand:SF 0 "register_operand" "r"))] (match_operand:SF 0 "register_operand" "r"))]
"" ""
"push %D0 "push %D0
...@@ -3126,20 +3125,12 @@ ...@@ -3126,20 +3125,12 @@
(define_insn "popqi" (define_insn "popqi"
[(set (match_operand:QI 0 "register_operand" "=r") [(set (match_operand:QI 0 "register_operand" "=r")
(mem:QI (post_inc (reg:HI REG_SP))))] (mem:QI (pre_inc:HI (reg:HI REG_SP))))]
"" ""
"pop %0" "pop %0"
[(set_attr "cc" "none") [(set_attr "cc" "none")
(set_attr "length" "1")]) (set_attr "length" "1")])
(define_insn "pophi"
[(set (match_operand:HI 0 "register_operand" "=r")
(mem:HI (post_inc (reg:HI REG_SP))))]
""
"pop %A0\;pop %B0"
[(set_attr "cc" "none")
(set_attr "length" "2")])
;; Enable Interrupts ;; Enable Interrupts
(define_insn "enable_interrupt" (define_insn "enable_interrupt"
[(unspec [(const_int 0)] UNSPEC_SEI)] [(unspec [(const_int 0)] UNSPEC_SEI)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment