diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-01-20 23:12:31 -0800 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-01-22 09:30:42 -0800 |
commit | 41caf6b0d603408a829b37f7f7fb09d64d814d48 (patch) | |
tree | 780206afeda6e1a099b621c60dfab056f9da4b0d /gcc | |
parent | a1b2953924c451ce90a3fdce6841b63bf05f335f (diff) | |
download | gcc-41caf6b0d603408a829b37f7f7fb09d64d814d48.zip gcc-41caf6b0d603408a829b37f7f7fb09d64d814d48.tar.gz gcc-41caf6b0d603408a829b37f7f7fb09d64d814d48.tar.bz2 |
arm: Fix parsecpu.awk for aliases [PR113030]
So the problem here is the 2 functions check_cpu and check_arch use
the wrong variable to check if an alias is valid for that cpu/arch.
check_cpu uses cpu_optaliases instead of cpu_opt_alias. cpu_optaliases
is an array of index'ed by the cpuname that contains all of the valid aliases
for that cpu but cpu_opt_alias is an double index array which is index'ed
by cpuname and the alias which provides what is the alias for that option.
Similar thing happens for check_arch and arch_optaliases vs arch_optaliases.
Tested by running:
```
awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+simd" config/arm/arm-cpus.in
awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon" config/arm/arm-cpus.in
awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon-vfpv3" config/arm/arm-cpus.in
```
And they don't return error back.
gcc/ChangeLog:
PR target/113030
* config/arm/parsecpu.awk (check_cpu): Use cpu_opt_alias
instead of cpu_optaliases.
(check_arch): Use arch_opt_alias instead of arch_optaliases.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/arm/parsecpu.awk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk index ddd4f3b..384462b 100644 --- a/gcc/config/arm/parsecpu.awk +++ b/gcc/config/arm/parsecpu.awk @@ -529,7 +529,7 @@ function check_cpu (name) { for (n = 2; n <= exts; n++) { if (!((cpu_name, extensions[n]) in cpu_opt_remove) \ - && !((cpu_name, extensions[n]) in cpu_optaliases)) { + && !((cpu_name, extensions[n]) in cpu_opt_alias)) { return "error" } } @@ -552,7 +552,7 @@ function check_arch (name) { for (n = 2; n <= exts; n++) { if (!((extensions[1], extensions[n]) in arch_opt_remove) \ - && !((extensions[1], extensions[n]) in arch_optaliases)) { + && !((extensions[1], extensions[n]) in arch_opt_alias)) { return "error" } } |