diff mbox series

Fix misleading aarch64 mcpu/march warning string

Message ID 1c368ec6-51a2-6e11-d0d2-c1e5193d5679@arm.com
State New
Headers show
Series Fix misleading aarch64 mcpu/march warning string | expand

Commit Message

Joel Feb. 27, 2020, 2:31 p.m. UTC
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  <Joel.Hutton@arm.com>
        PR target/87612
        * config/aarch64/aarch64.c (aarch64_override_options): Fix
misleading warning string.

Comments

Kyrill Tkachov Feb. 27, 2020, 2:36 p.m. UTC | #1
Hi Joel,

On 2/27/20 2:31 PM, Joel Hutton wrote:
> 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  <Joel.Hutton@arm.com>

>         PR target/87612

>         * config/aarch64/aarch64.c (aarch64_override_options): Fix

> misleading warning string.



Newline after the Name/email line in the ChangeLog.

This is okay for trunk.

Do you have commit access?

If not, please follow the steps at 
https://gcc.gnu.org/gitwrite.html#authenticated listing myself as approver.

Then you can commit this yourself.

Thanks,

Kyrill
diff mbox series

Patch

From 67e2be75db63238bb8d4418db70fb5876465f9f7 Mon Sep 17 00:00:00 2001
From: Joel Hutton <Joel.Hutton@arm.com>
Date: Thu, 27 Feb 2020 12:02:09 +0000
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