arm: Ignore --with-mode when CPU only supports one instruction set.
commit15cf7fe3556d11aa895cee0f162f6678da9daca6
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 2 Mar 2021 14:51:11 +0000 (2 14:51 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Wed, 3 Mar 2021 13:53:37 +0000 (3 13:53 +0000)
treea594a13126ddf917e040c76f34fb805b8833b4bb
parent74aee6d20872e8d87558eb5bf601042e3ed3fb2a
arm: Ignore --with-mode when CPU only supports one instruction set.

Arm processors can support up to two instruction sets.  Some early
cores only support the traditional A32 (Arm) instructions, while some
more recent devices only support T32 (Thumb) instructions.

When configuring the compiler,--with-mode can be used to select the
default instruction set to target if the user has not made an explicit
choice, but this can cause needless problems if the default is not
supported by the requested CPU.

To fix this this patch adjusts the way that the --with-mode selection
is processed so that it can take into account the selected CPU or
architecture and not create a meaningless combination.

gcc:
* common/config/arm/arm-common.c: Include configargs.h.
(arm_config_default): New function.
(arm_target_mode): Renamed from arm_target_thumb_only.  Handle
processors that do not support Thumb.  Take into account the
--with-mode configuration setting for selecting the default.
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Remove entry for 'mode'.
(TARGET_MODE_SPEC_FUNCTIONS): Update for function name change.
gcc/common/config/arm/arm-common.c
gcc/config/arm/arm.h