diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2014-01-20 11:32:32 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2014-01-20 11:32:32 +0000 |
commit | ffee7aa91a16a2a037aee7f96dd635df18cd7109 (patch) | |
tree | 0f72a08d989156923d4ad477e3da76e54d4867d2 /gcc/config | |
parent | c716977996bb5b73c3ab8dd7c14215697d5eed19 (diff) | |
download | gcc-ffee7aa91a16a2a037aee7f96dd635df18cd7109.zip gcc-ffee7aa91a16a2a037aee7f96dd635df18cd7109.tar.gz gcc-ffee7aa91a16a2a037aee7f96dd635df18cd7109.tar.bz2 |
[AArch64] Fix behaviour of -mcpu option to match ARM.
gcc/
* common/config/aarch64/aarch64-common.c
(aarch64_handle_option): Don't handle any option order logic here.
* config/aarch64/aarch64.c (aarch64_parse_arch): Do not override
selected_cpu, warn on architecture version mismatch.
(aarch64_override_options): Fix parsing order for option strings.
From-SVN: r206803
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 96a6d23..7091d3e 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5101,7 +5101,9 @@ aarch64_parse_arch (void) { selected_arch = arch; aarch64_isa_flags = selected_arch->flags; - selected_cpu = &all_cores[selected_arch->core]; + + if (!selected_cpu) + selected_cpu = &all_cores[selected_arch->core]; if (ext != NULL) { @@ -5109,6 +5111,12 @@ aarch64_parse_arch (void) aarch64_parse_extension (ext); } + if (strcmp (selected_arch->arch, selected_cpu->arch)) + { + warning (0, "switch -mcpu=%s conflicts with -march=%s switch", + selected_cpu->name, selected_arch->name); + } + return; } } @@ -5197,20 +5205,21 @@ aarch64_parse_tune (void) static void aarch64_override_options (void) { - /* march wins over mcpu, so when march is defined, mcpu takes the same value, - otherwise march remains undefined. mtune can be used with either march or - mcpu. */ + /* -mcpu=CPU is shorthand for -march=ARCH_FOR_CPU, -mtune=CPU. + If either of -march or -mtune is given, they override their + respective component of -mcpu. - if (aarch64_arch_string) + So, first parse AARCH64_CPU_STRING, then the others, be careful + with -march as, if -mcpu is not present on the command line, march + must set a sensible default CPU. */ + if (aarch64_cpu_string) { - aarch64_parse_arch (); - aarch64_cpu_string = NULL; + aarch64_parse_cpu (); } - if (aarch64_cpu_string) + if (aarch64_arch_string) { - aarch64_parse_cpu (); - selected_arch = NULL; + aarch64_parse_arch (); } if (aarch64_tune_string) |