This patch adds support ARMv8-M's Security Extension's cmse_nonsecure_caller intrinsic. This intrinsic is used to check whether an entry function was called from a non-secure state. See Section 5.4.3 of ARM®v8-M Security Extensions: Requirements on Development Tools (http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/index.html) for further details. The FIXME in config/arm/arm_cmse.h is for a diagnostic message that is suggested in the ARMv8-M Security Extensions document mentioned above, to diagnose the use of the cmse_nonsecure_caller intrinsic outside of functions with the 'cmse_nonsecure_entry' attribute. Checking whether the intrinsic is called from within such functions can easily be done inside 'arm_expand_builtin'. However, making the warning point to the right location is more complicated. The ARMv8-M Security Extensions specification does mention that such a diagnostic might become mandatory, so I might have to pick this up later, otherwise it is left as a potential extra feature. *** gcc/ChangeLog *** 2016-07-25 Andre Vieira Thomas Preud'homme * config/arm/arm-builtins.c (arm_builtins): Define ARM_BUILTIN_CMSE_NONSECURE_CALLER. (bdesc_2arg): Add line for cmse_nonsecure_caller. (arm_expand_builtin): Handle cmse_nonsecure_caller. * config/arm/arm_cmse.h (cmse_nonsecure_caller): New. *** gcc/testsuite/ChangeLog *** 2016-07-25 Andre Vieira Thomas Preud'homme * gcc.target/arm/cmse/cmse-1.c: Add test for cmse_nonsecure_caller.