From 1825c61e15cf34364792180ca017c998cab3fe34 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Mon, 17 Jul 2017 12:46:55 +0200 Subject: [PATCH] [ARC] Add support for naked functions. gcc/ 2017-07-17 Claudiu Zissulescu Andrew Burgess * config/arc/arc-protos.h (arc_compute_function_type): Change prototype. (arc_return_address_register): New function. * config/arc/arc.c (arc_handle_fndecl_attribute): New function. (arc_handle_fndecl_attribute): Add naked attribute. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Define. (TARGET_WARN_FUNC_RETURN): Likewise. (arc_allocate_stack_slots_for_args): New function. (arc_warn_func_return): Likewise. (machine_function): Change type fn_type. (arc_compute_function_type): Consider new naked function type, change function return type. (arc_must_save_register): Adapt to handle new arc_compute_function_type's return type. (arc_expand_prologue): Likewise. (arc_expand_epilogue): Likewise. (arc_return_address_regs): Delete. (arc_return_address_register): New function. (arc_epilogue_uses): Use above function. * config/arc/arc.h (arc_return_address_regs): Delete prototype. (arc_function_type): Change encoding, add naked type. (ARC_INTERRUPT_P): Change to handle the new encoding. (ARC_FAST_INTERRUPT_P): Likewise. (ARC_NORMAL_P): Define. (ARC_NAKED_P): Likewise. (arc_compute_function_type): Delete prototype. * config/arc/arc.md (in_ret_delay_slot): Use arc_return_address_register function. (simple_return): Likewise. (p_return_i): Likewise. gcc/testsuite 2017-07-17 Claudiu Zissulescu Andrew Burgess * gcc.target/arc/naked-1.c: New file. * gcc.target/arc/naked-2.c: Likewise. Co-Authored-By: Andrew Burgess From-SVN: r250266 --- gcc/config/arc/arc-protos.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gcc/config/arc/arc-protos.h') diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index 93a64cf..f6bf14e 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -45,13 +45,10 @@ extern void arc_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx); extern void arc_split_compare_and_swap (rtx *); extern void arc_expand_compare_and_swap (rtx *); extern bool compact_memory_operand_p (rtx, machine_mode, bool, bool); +extern int arc_return_address_register (unsigned int); +extern unsigned int arc_compute_function_type (struct function *); #endif /* RTX_CODE */ -#ifdef TREE_CODE -extern enum arc_function_type arc_compute_function_type (struct function *); -#endif /* TREE_CODE */ - - extern unsigned int arc_compute_frame_size (int); extern bool arc_ccfsm_branch_deleted_p (void); extern void arc_ccfsm_record_branch_deleted (void); -- cgit v1.1