[PATCH] [ARC] Add support for naked functions.
authorClaudiu Zissulescu <claziss@synopsys.com>
Mon, 17 Jul 2017 10:46:55 +0000 (12:46 +0200)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Mon, 17 Jul 2017 10:46:55 +0000 (12:46 +0200)
commit1825c61e15cf34364792180ca017c998cab3fe34
treeee7d5ab017ac8466277d3bfa737e36ff23115c48
parent9ebce098585220299a78ecda84b145d16ee25bca
[PATCH] [ARC] Add support for naked functions.

gcc/
2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>

        * 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  <claziss@synopsys.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>

        * gcc.target/arc/naked-1.c: New file.
        * gcc.target/arc/naked-2.c: Likewise.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
From-SVN: r250266
gcc/ChangeLog
gcc/config/arc/arc-protos.h
gcc/config/arc/arc.c
gcc/config/arc/arc.h
gcc/config/arc/arc.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arc/naked-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arc/naked-2.c [new file with mode: 0644]