This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Print default options selection for -march,-mcpu and -mtune for aarch64 (PR driver/83193).
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Date: Wed, 18 Jul 2018 17:48:17 +0200
- Subject: [PATCH] Print default options selection for -march,-mcpu and -mtune for aarch64 (PR driver/83193).
Hi.
This is aarch64 fix for PR83193. It's about setting of default options
so that --help=target -Q prints proper numbers:
Now this is seen on my cross-compiler:
--- /home/marxin/Downloads/options-2-before.txt 2018-07-18 14:53:11.658146543 +0200
+++ /home/marxin/Downloads/options-2.txt 2018-07-18 14:52:30.113274284 +0200
@@ -1,10 +1,10 @@
The following options are target specific:
-mabi=ABI lp64
- -march=ARCH
+ -march= armv8-a
-mbig-endian [disabled]
-mbionic [disabled]
-mcmodel= small
- -mcpu=CPU
+ -mcpu= generic
-mfix-cortex-a53-835769 [enabled]
-mfix-cortex-a53-843419 [enabled]
-mgeneral-regs-only [disabled]
@@ -19,7 +19,7 @@
-msve-vector-bits=N scalable
-mtls-dialect= desc
-mtls-size= 24
- -mtune=CPU
+ -mtune= generic
-muclibc [disabled]
May I please ask ARM folks to test the patch?
Thanks,
Martin
gcc/ChangeLog:
2018-07-18 Martin Liska <mliska@suse.cz>
PR driver/83193
* config/aarch64/aarch64.c (aarch64_override_options_internal):
Set default values for x_aarch64_*_string strings.
* config/aarch64/aarch64.opt: Remove --{march,mcpu,mtune}==
prefix.
---
gcc/config/aarch64/aarch64.c | 7 +++++++
gcc/config/aarch64/aarch64.opt | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6fa03e4b091..d48e6278efa 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -10713,6 +10713,13 @@ aarch64_override_options_internal (struct gcc_options *opts)
&& opts->x_optimize >= aarch64_tune_params.prefetch->default_opt_level)
opts->x_flag_prefetch_loop_arrays = 1;
+ if (opts->x_aarch64_arch_string == NULL)
+ opts->x_aarch64_arch_string = selected_arch->name;
+ if (opts->x_aarch64_cpu_string == NULL)
+ opts->x_aarch64_cpu_string = selected_cpu->name;
+ if (opts->x_aarch64_tune_string == NULL)
+ opts->x_aarch64_tune_string = selected_tune->name;
+
aarch64_override_options_after_change_1 (opts);
}
diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index 1426b45ff0f..7f0b65de37b 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -117,15 +117,15 @@ Enum(aarch64_tls_size) String(48) Value(48)
march=
Target RejectNegative ToLower Joined Var(aarch64_arch_string)
--march=ARCH Use features of architecture ARCH.
+Use features of architecture ARCH.
mcpu=
Target RejectNegative ToLower Joined Var(aarch64_cpu_string)
--mcpu=CPU Use features of and optimize for CPU.
+Use features of and optimize for CPU.
mtune=
Target RejectNegative ToLower Joined Var(aarch64_tune_string)
--mtune=CPU Optimize for CPU.
+Optimize for CPU.
mabi=
Target RejectNegative Joined Enum(aarch64_abi) Var(aarch64_abi) Init(AARCH64_ABI_DEFAULT)