Commit 6fe5e235 by Claudiu Zissulescu Committed by Claudiu Zissulescu

[ARC] Reimplement exception handling support.

2016-06-09  Claudiu Zissulescu  <claziss@synopsys.com>
	    Andrew Burgess  <andrew.burgess@embecosm.com>

	* config/arc/arc-protos.h (arc_compute_frame_size): Delete
	declaration.
	(arc_return_slot_offset): Likewise.
	(arc_eh_return_address_location): New declaration.
	* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Define.
	(MUST_SAVE_REGISTER): Add exception handler case.
	(MUST_SAVE_RETURN_ADDR): Likewise.
	(arc_frame_pointer_required): Likewise.
	(arc_frame_pointer_needed): New function.
	(arc_compute_frame_size): Changed.
	(arc_expand_prologue): Likewise.
	(arc_expand_epilogue): Likewise.
	(arc_initial_elimination_offset): Likewise.
	(arc_return_slot_offset): Delete.
	(arc_eh_return_address_location): New function.
	(arc_builtin_setjmp_frame_value): Likewise.
	* config/arc/arc.h (EH_RETURN_DATA_REGNO): Use 2 registers.
	(EH_RETURN_STACKADJ_RTX): Define.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/arc/arc.md (eh_return): Delete.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>

From-SVN: r254997
parent 24d39222
2017-11-21 Claudiu Zissulescu <claziss@synopsys.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc-protos.h (arc_compute_frame_size): Delete
declaration.
(arc_return_slot_offset): Likewise.
(arc_eh_return_address_location): New declaration.
* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Define.
(MUST_SAVE_REGISTER): Add exception handler case.
(MUST_SAVE_RETURN_ADDR): Likewise.
(arc_frame_pointer_required): Likewise.
(arc_frame_pointer_needed): New function.
(arc_compute_frame_size): Changed.
(arc_expand_prologue): Likewise.
(arc_expand_epilogue): Likewise.
(arc_initial_elimination_offset): Likewise.
(arc_return_slot_offset): Delete.
(arc_eh_return_address_location): New function.
(arc_builtin_setjmp_frame_value): Likewise.
* config/arc/arc.h (EH_RETURN_DATA_REGNO): Use 2 registers.
(EH_RETURN_STACKADJ_RTX): Define.
(EH_RETURN_HANDLER_RTX): Likewise.
* config/arc/arc.md (eh_return): Delete.
2017-11-21 Aldy Hernandez <aldyh@redhat.com>
* print-tree.h (debug_vec_tree): Remove prototype.
......@@ -111,8 +111,8 @@ extern bool arc_epilogue_uses (int regno);
extern bool arc_eh_uses (int regno);
/* insn-attrtab.c doesn't include reload.h, which declares regno_clobbered_p. */
extern int regno_clobbered_p (unsigned int, rtx_insn *, machine_mode, int);
extern int arc_return_slot_offset (void);
extern bool arc_legitimize_reload_address (rtx *, machine_mode, int, int);
extern void arc_secondary_reload_conv (rtx, rtx, rtx, bool);
extern void arc_cpu_cpp_builtins (cpp_reader *);
extern bool arc_store_addr_hazard_p (rtx_insn *, rtx_insn *);
extern rtx arc_eh_return_address_location (void);
......@@ -1365,8 +1365,11 @@ do { \
/* Frame info. */
#define EH_RETURN_DATA_REGNO(N) \
((N) < 4 ? (N) : INVALID_REGNUM)
#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM)
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 2)
#define EH_RETURN_HANDLER_RTX arc_eh_return_address_location ()
/* Turn off splitting of long stabs. */
#define DBX_CONTIN_LENGTH 0
......
......@@ -4935,39 +4935,6 @@
(const_int 4)]
(const_int 2)))])
(define_insn_and_split "eh_return"
[(eh_return)
(use (match_operand:SI 0 "move_src_operand" "rC32,mCalCpc"))
(clobber (match_scratch:SI 1 "=X,r"))
(clobber (match_scratch:SI 2 "=&r,r"))]
""
"#"
"reload_completed"
[(set (match_dup 2) (match_dup 0))]
{
int offs = arc_return_slot_offset ();
if (offs < 0)
operands[2] = gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM);
else
{
if (!register_operand (operands[0], Pmode)
&& !satisfies_constraint_C32 (operands[0]))
{
emit_move_insn (operands[1], operands[0]);
operands[0] = operands[1];
}
rtx addr = plus_constant (Pmode, stack_pointer_rtx, offs);
if (!strict_memory_address_p (Pmode, addr))
{
emit_move_insn (operands[2], addr);
addr = operands[2];
}
operands[2] = gen_frame_mem (Pmode, addr);
}
}
[(set_attr "length" "12")])
;; ??? #ifdefs in function.c require the presence of this pattern, with a
;; non-constant predicate.
(define_expand "return"
......
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