From 4747e2ccec94dc37f32201b884f574755cbb9ca8 Mon Sep 17 00:00:00 2001 From: Mihail Ionescu Date: Wed, 15 Jan 2020 11:49:32 +0000 Subject: [PATCH] [PATCH, GCC/ARM, 10/10] Enable -mcmse The patch is straightforward: it redefines ARMv8_1m_main as having the same features as ARMv8m_main (and thus as having the cmse feature) with the extra features represented by armv8_1m_main. It also removes the error for using -mcmse on Armv8.1-M Mainline. *** gcc/ChangeLog *** 2020-01-16 Mihail-Calin Ionescu 2020-01-16 Thomas Preud'homme * config/arm/arm-cpus.in (ARMv8_1m_main): Redefine as an extension to Armv8-M Mainline. * config/arm/arm.c (arm_options_perform_arch_sanity_checks): Remove error for using -mcmse when targeting Armv8.1-M Mainline. --- gcc/ChangeLog | 8 ++++++++ gcc/config/arm/arm-cpus.in | 5 +---- gcc/config/arm/arm.c | 3 --- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 123a9c39c9a..e056a6d6210 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,14 @@ 2020-01-16 Mihail-Calin Ionescu 2020-01-16 Thomas Preud'homme + * config/arm/arm-cpus.in (ARMv8_1m_main): Redefine as an extension to + Armv8-M Mainline. + * config/arm/arm.c (arm_options_perform_arch_sanity_checks): Remove + error for using -mcmse when targeting Armv8.1-M Mainline. + +2020-01-16 Mihail-Calin Ionescu +2020-01-16 Thomas Preud'homme + * config/arm/arm.md (nonsecure_call_internal): Do not force memory address in r4 when targeting Armv8.1-M Mainline. (nonsecure_call_value_internal): Likewise. diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index fdf336a5930..f5cc5ca2c31 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -272,10 +272,7 @@ define fgroup ARMv8_6a ARMv8_5a armv8_6 define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv define fgroup ARMv8m_main ARMv7m armv8 cmse define fgroup ARMv8r ARMv8a -# Feature cmse is omitted to disable Security Extensions support while secure -# code compiled by GCC does not preserve FP context as allowed by Armv8.1-M -# Mainline. -define fgroup ARMv8_1m_main ARMv7m armv8 armv8_1m_main +define fgroup ARMv8_1m_main ARMv8m_main armv8_1m_main # Useful combinations. define fgroup VFPv2 vfpv2 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5e93f52f856..5bb7a458b56 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3777,9 +3777,6 @@ arm_options_perform_arch_sanity_checks (void) if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE) sorry ("__fp16 and no ldrh"); - if (use_cmse && arm_arch8_1m_main) - error ("Armv8.1-M Mainline Security Extensions are unsupported"); - if (use_cmse && !arm_arch_cmse) error ("target CPU does not support ARMv8-M Security Extensions"); -- 2.30.2