[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 9 15:42:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193

--- Comment #15 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Fri Mar  9 15:42:10 2018
New Revision: 258389

URL: https://gcc.gnu.org/viewcvs?rev=258389&root=gcc&view=rev
Log:
[arm] PR target/83193: Do not print arch/cpu hints twice on invalid
-march/-mcpu

Currently when handling an invalid -march or -mcpu option on a toolchain
without an explicit --with-mode configuration
and compiling without an explicit -mthumb or -marm the arm specs end up calling
arm_target_thumb_only to determine
the "thumbness" of the target, which involves parsing the architecture or cpu
name. But the functions doing that
parsing also emit error messages and hints on invalid arguments. Later when we
parse the architecture or cpu string to
as part of the canonicalisation process (arm_canon_arch_option) we end up
emitting the errors again.

The solution in this patch is to silence the errors during the
arm_target_thumb_only processing so that they are not emitted
twice. arm_canon_arch_option is guaranteed to run as well, so it can emit the
errors and hints that it needs.

Bootstrapped and tested on arm-none-linux-gnueabihf.

Checked that we emit the arch/cpu hints for invalid -march/-mcpu options only
once when no "thumbness" options were specified
during configuration or invocation.

        PR target/83193
        * common/config/arm/arm-common.c (arm_parse_arch_option_name):
        Accept complain bool parameter.  Only emit errors if it is true.
        (arm_parse_cpu_option_name): Likewise.
        (arm_target_thumb_only): Adjust callers of the above.
        * config/arm/arm-protos.h (arm_parse_cpu_option_name): Adjust
        prototype to take a default true bool parameter.
        (arm_parse_arch_option_name): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/common/config/arm/arm-common.c
    trunk/gcc/config/arm/arm-protos.h


More information about the Gcc-bugs mailing list