]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Fix FMV array iteration bounds
authorAndrew Carlotti <andrew.carlotti@arm.com>
Wed, 3 Apr 2024 22:35:08 +0000 (23:35 +0100)
committerAndrew Carlotti <andrew.carlotti@arm.com>
Thu, 11 Apr 2024 14:26:46 +0000 (15:26 +0100)
commit3ef14f56343ad3445f874638700f6b82f032a1ae
tree7f68041f23fda356e8acd91f2e6bcf0b5d677ace
parente33fc847d5457bd56734cad056955102a23f405b
aarch64: Fix FMV array iteration bounds

There was an assumption in some places that the aarch64_fmv_feature_data
array contained FEAT_MAX elements.  While this assumption held up till
now, it is safer and more flexible to use the array size directly.

Also fix the lower bound in compare_feature_masks to use ">=0" instead
of ">0", and add a test using the features at index 0 and 1. However,
the test already passed, because the earlier popcount check makes it
impossible to reach the loop if the masks differ in exactly one
location.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (compare_feature_masks):
Use ARRAY_SIZE and >=0 for iteration bounds.
(aarch64_mangle_decl_assembler_name): Use ARRAY_SIZE.

gcc/testsuite/ChangeLog:

* g++.target/aarch64/mv-1.C: New test.
gcc/config/aarch64/aarch64.cc
gcc/testsuite/g++.target/aarch64/mv-1.C [new file with mode: 0644]