Comments

This patch cleans up ARM handling of various options, making
enumerated options that were handled in arm_option_override use Enum
instead (except for -mfpu=, to be handled in a subsequent patch) and
using UInteger for -mstructure-size-boundary=.
-mfp= and -mfpe= (legacy aliases) are converted into actual .opt Alias
entries for each valid argument to those options. (Thus, the last of
a sequence of interspersed -mfpu= and -mfp=/-mfpe= options now wins,
which I think is correct, whereas previously an earlier -mfpu= option
would override a later -mfp=/-mfpe= option.)
-mstructure-size-boundary= using UInteger means that its arguments are
now required to be decimal integers without leading whitespace or
ignored trailing text, whereas previously such variants (and octal and
hexadecimal values) would be accepted; I think this stricter checking,
consistent with other integer-valued options, is also the desired
semantics.
Tested building cc1 and xgcc for cross to arm-eabi. Will commit to
trunk in the absence of target maintainer objections.
Remarks on oddities in the configuration of various ARM targets for
the consideration of the ARM target maintainers (I don't plan to work
on these issues):
* The default float-abi (TARGET_DEFAULT_FLOAT_ABI) is "hard" only for
old-ABI GNU/Linux. Although it's also defined to ARM_FLOAT_ABI_HARD
in arm/semi.h, that definition gets overridden in arm/coff.h.
* The header arm/aout.h has a comment saying it is for "ARM with
a.out", which is misleading since there are no such targets in GCC.
Actually, all ARM targets include it either immediately before
arm/arm.h, or in the case of FreeBSD with arm/freebsd.h inbetween -
but arm/freebsd.h does not test or modify any macros from
arm/aout.h, so actually arm/aout.h could safely be merged into
arm/arm.h, making the port simpler and less confusing. (I haven't
checked whether arm/arm.h tests or modifies any macros from
arm/aout.h, which would be relevant to determining the best way to
merge each macro into arm/arm.h.)
* The header arm/semi.h says "ARM on semi-hosted platform" - which is
also misleading since it's only used for WinCE. As noted above at
least one target macro in this header is dead. As the four headers
arm/semi.h arm/coff.h arm/pe.h arm/wince-pe.h are all only used for
this one target, and I doubt the distinctions between them genuinely
follow any proper abstraction levels between four different sets of
targets that simply happen to be the same right now, merging them
into one header might improve things.
* arm*-*-uclinux* are legacy Linux-based targets not using the common
gnu-user.h and linux.h headers as they should be.
* There were previous discussions of deprecating at least some
non-AAPCS targets. Since for some target OSes (such as WinCE) the
ABI is what it is, it may not be possible to eliminate the old ABI
support completely. But maybe some other OS maintainers (VxWorks,
FreeBSD, NetBSD, eCos, RTEMS) are moving their OSes to use AAPCS, in
which case some older target variants could be deprecated and
removed? (Maybe old-ABI bare-metal, GNU/Linux and uClinux could be
deprecated in any case.) Closely tied into old-ABI use are defaults
of -mfpu= based on the selected CPU - but NetBSD and VxWorks at
least default to VFP (define FPUTYPE_DEFAULT appropriately) even
though using pre-AAPCS ABIs.
* There was also a previous suggestion that -mwords-little-endian is
long-obsolete and should be removed as well.
2011-05-17 Joseph Myers <joseph@codesourcery.com>
* config/arm/arm-opts.h (enum arm_fp16_format_type, enum
arm_abi_type, enum float_abi_type, enum arm_tp_type): Move from
arm.h.
* config/arm/arm.c (arm_float_abi, arm_fp16_format, arm_abi,
target_thread_pointer, arm_structure_size_boundary, struct
float_abi, all_float_abis, struct fp16_format, all_fp16_formats,
struct abi_name, arm_all_abis): Remove.
(arm_option_override) Don't process most enumerated option values
here. Don't process target_fpe_name here. Work with integer not
string for structure size boundary; use separate diagnostics for
each case.
* config/arm/arm.h (enum float_abi_type, enum
arm_fp16_format_type, enum arm_abi_type, enum arm_tp_type): Move
to arm-opts.h.
(arm_float_abi, arm_fp16_format, arm_abi, target_thread_pointer,
arm_structure_size_boundary): Remove.
* config/arm/arm.opt (mabi=): Use Enum and Init.
(arm_abi_type): New Enum and EnumValue entries.
(mfloat-abi=): Use Enum and Init.
(float_abi_type): New Enum and EnumValue entries.
(mfp=, mfpe=): Replace by separate Alias entries for each
argument.
(mfp16-format=): Use Enum and Init.
(arm_fp16_format_type): New Enum and EnumValue entries.
(mstructure-size-boundary=): Use UInteger and Init.
(mtp=): Use Enum and Init.
(arm_tp_type): New Enum and EnumValue entries.