On 14/02/2020 03:18, apin...@marvell.com wrote:
From: Andrew Pinski <apin...@marvell.com>
Right if someone supplies a -mcpu= option and then overrides
that option with -march=*, we get a warning when they conflict.
What we need is a generic cpu for each arch level but that is not
that useful because the only difference would be the arch level.
The best option is to allow -mcpu=generic -march=armv8.5-a not to
warn and that is now a generic armv8.5-a arch.
Then they should use -mtune=generic, rather than -mcpu.
OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.
* config/aarch64/aarch64.c (aarch64_override_options): Don't
warn when the selected cpu was generic.
gcc/config/aarch64/aarch64.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 4a34dce..9173afe 100644
@@ -14075,10 +14075,12 @@ aarch64_override_options (void)
explicit_tune_core = selected_tune->ident;
/* If both -mcpu and -march are specified check that they are
- compatible, warn if they're not and prefer the -march ISA flags. */
+ compatible, warn if they're not and prefer the -march ISA flags.
+ Only warn if not using the generic cpu. */
else if (selected_arch)
- if (selected_arch->arch != selected_cpu->arch)
+ if (selected_cpu->ident != generic
+ && selected_arch->arch != selected_cpu->arch)
warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch",