On 02/08/18 10:46, Martin Liška wrote: > On 08/02/2018 11:39 AM, Richard Earnshaw (lists) wrote: >> On 18/07/18 16:48, Martin Liška wrote: >>> 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 >> >> So we have >> >> -mabi=ABI lp64 >> >> but >> >> -march= armv8-a >> ^^^^^ blank >> >> Isn't that inconsistent? > > It is probably, in this case I would remove 'ABI' from -mabi option. It's > explained bellow > what are possible options: > > Known AArch64 ABIs (for use with the -mabi= option): > ilp32 lp64 > > Similarly for: > -moverride=STRING Power users only! Override CPU optimization > parameters. > -msve-vector-bits=N Set the number of bits in an SVE vector > register to N. > > It's more common to <var> notation, there are some samples from --help=common: > > -fmax-errors=<number> Maximum number of errors to report. > -fmessage-length=<number> Limit diagnostics to <number> characters per > line. 0 suppresses line-wrapping. > -fira-region=[one|all|mixed] Set regions for IRA. > -fira-verbose=<number> Control IRA's level of diagnostic messages. > -flifetime-dse=<0,2> This option lacks documentation. > -fstack-limit-register=<register> Trap if the stack goes past <register>. > -fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>. > > Are you fine with the suggested approach?
Yes, those look sensible. R. > > Martin > >> >> R. >> >>> -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 <mli...@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(-) >>> >>> >>> >>> 0001-Print-default-options-selection-for-march-mcpu-and-m.patch >>> >>> >>> 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) >>> >> >