[arm] Fix incorrect __ARM_ARCH_PROFILE for -march=armv7
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 28 Jun 2017 15:02:38 +0000 (15:02 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Wed, 28 Jun 2017 15:02:38 +0000 (15:02 +0000)
commit8afb53589b8c4378636f940d8e0d19e6e3db75b4
tree0df647942750f8c8458fbe9033d4079b25f2549e
parent56a6d474ab255eddf334bd77df014673d4035336
[arm] Fix incorrect __ARM_ARCH_PROFILE for -march=armv7

ACLE explicitly states that when targetting the common subset of
ARMv7-A, ARMv7-R and ARMv7-M, the __ARM_ARCH_PROFILE macro should not
be set.  We currently set it to 'M' which is clearly erroneous.

The logic for creating this is very convoluted and also somewhat
fragile, so I've taken the opportunity to use the new CPU and
architecture definition infrastructure to record the profile for each
architecture explicitly rather than try to reconstruct it from other
data.  I think this results in a much more robust solution.

2017-06-28  Richard Earnshaw  <rearnsha@arm.com>

* config/arm/parsecpu.awk (profile): Parse new keyword in an arch
context.
(gen_comm_data): Emit architectural setting of arch_prof.
* config/arm/arm-cpus.in (armv6-m, armv6s-m, armv7-a, armv7ve): Set the
profile.
(armv7-r, armv7-m, armv7e-m, armv8-a, armv8.1-a, armv8.2-a): Likewise.
(armv8-m.base, armv8-m.main): Likewise.
* arm-protos.h (arm_build_target): Add profile field.
(arch_option): Likewise.
* config/arm/arm.c (arm_configure_build_target): Copy the profile to
the active target.
* config/arm/arm.h (TARGET_ARM_ARCH_PROFILE): Use
arm_active_target.profile.

From-SVN: r249743
gcc/ChangeLog
gcc/config/arm/arm-cpu-cdata.h
gcc/config/arm/arm-cpus.in
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/parsecpu.awk