The message for conflicting mcpu and march previously printed the
architecture of the CPU instead of the CPU name, as well as omitting the
extensions to the march string. This patch corrects both errors. This
patch fixes PR target/87612.
before:
$ aarch64-unknown-linux-gnu-gcc -S -O3 -march=armv8-a+sve
-mcpu=cortex-a76 foo.c
cc1: warning: switch '-mcpu=armv8.2-a' conflicts with '-march=armv8-a'
switch
after:
$ aarch64-unknown-linux-gnu-gcc -S -O3 -march=armv8-a+sve
-mcpu=cortex-a76 foo.c
cc1: warning: switch '-mcpu=cortex-a76' conflicts with
'-march=armv8-a+sve' switch
gcc/ChangeLog:
2020-02-27 Joel Hutton
PR target/87612
* config/aarch64/aarch64.c (aarch64_override_options): Fix
misleading warning string.
>From 67e2be75db63238bb8d4418db70fb5876465f9f7 Mon Sep 17 00:00:00 2001
From: Joel Hutton
Date: Thu, 27 Feb 2020 12:02:09 +
Subject: [PATCH] Fix aarch64 warning for conflicting mcpu/march
The message for conflicting cpu and march previously printed the
architecture of the CPU instead of the CPU name, as well as omitting the
extensions to the march string. This patch corrects both errors.
---
gcc/config/aarch64/aarch64.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index f53c98e73765387974cc14f3d3ab4840a9331a08..4b9747b4c5e70432e900b4087eaefab6da6e162a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -14131,8 +14131,8 @@ aarch64_override_options (void)
if (selected_arch->arch != selected_cpu->arch)
{
warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch",
- all_architectures[selected_cpu->arch].name,
- selected_arch->name);
+ aarch64_cpu_string,
+ aarch64_arch_string);
}
aarch64_isa_flags = arch_isa;
explicit_arch = selected_arch->arch;
--
2.17.1