Add ARM/thumb attribute target
authorChristian Bruel <christian.bruel@st.com>
Wed, 10 Jun 2015 07:50:59 +0000 (09:50 +0200)
committerChristian Bruel <chrbr@gcc.gnu.org>
Wed, 10 Jun 2015 07:50:59 +0000 (09:50 +0200)
commitd5524d521efc91c4b8d8efe2ebace3176aa092e5
tree1f17c4692550cddef894f009b22e9e45c99ab8d2
parenteb071c6bdc37cc6ba41611bf2c0cb96de376e39e
Add ARM/thumb attribute target

PR target/52144

* config/arm/arm.opt (THUMB, arm_restrict_it, inline_asm_unified): Save.
* config/arm/arm-protos.h (arm_valid_target_attribute_tree): Declare.
(arm_reset_previous_fndecl, arm_change_mode_p): Likewise.
* config/arm/arm.h (SWITCHABLE_TARGET): Define.
* config/arm/arm.c (arm_reset_previous_fndecl): New functions.
(arm_valid_target_attribute_tree, arm_change_mode_p): Likewise.
(arm_valid_target_attribute_p): Likewise.
(arm_set_current_function, arm_can_inline_p): Likewise.
(arm_valid_target_attribute_rec): Likewise.
(arm_previous_fndecl): New variable.
(TARGET_SET_CURRENT_FUNCTION, TARGET_OPTION_VALID_ATTRIBUTE_P): Define.
(TARGET_CAN_INLINE_P): Define.
(arm_asm_trampoline_template): Emit mode.
(arm_file_start): Don't set unified syntax.
(arm_declare_function_name): Set unified syntax and mode.
(arm_option_override): Init target_option_default_node.
and target_option_current_node.
* config/arm/arm.md (*call_value_symbol): Set mode when possible.
(*call_symbol): Likewise.
* doc/extend.texi: Document ARM/Thumb target attribute.
* doc/invoke.texi: Likewise.

* gcc.target/arm/attr_arm.c: New test
* gcc.target/arm/attr_arm-err.c: New test
* gcc.target/arm/attr_thumb.c: New test
* gcc.target/arm/attr_thumb-static.c: New test

From-SVN: r224314
13 files changed:
gcc/ChangeLog
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/arm.md
gcc/config/arm/arm.opt
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/attr_arm-err.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/attr_arm.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/attr_thumb-static.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/attr_thumb.c [new file with mode: 0644]