[Bug target/115018] Incorrect data read/written at -O3 on aarch64 with 256-bit SVE SIMD width specified

2024-05-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115018

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-05-09
 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING

--- Comment #2 from Andrew Pinski  ---
https://community.arm.com/support-forums/f/high-performance-computing-forum/54025/size-of-vectors-in-sve2

[Bug target/115018] Incorrect data read/written at -O3 on aarch64 with 256-bit SVE SIMD width specified

2024-05-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115018

--- Comment #1 from Andrew Pinski  ---
First I can't reproduce it with the official releases GCC 13.2.0.

Second with the trunk, I am not sure if this is a bug or not.

With the trunk with `-O3 -Wall -Wextra -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -march=armv8.2-a+sve -msve-vector-bits=256 `
Running under qemu like this:

[apinski@xeond2 upstream-cross-aarch64]$ ./install-qemu/bin/qemu-aarch64 -cpu
max,sve128=on,sve256=on a.out
x[ 0]: 0 0 0
x[ 1]: 0 0 0
x[ 2]: 0 0 0
x[ 3]: 0 0 0
x[ 4]: 0 0 0
x[ 5]: 0 0 0
x[ 6]: 0 0 0
x[ 7]: 0 0 0
x[ 8]: 0 0 0
x[ 9]: 0 0 0
x[ 0]: 0 10 0
x[ 1]: 0 10 0
x[ 2]: 0 10 0
x[ 3]: 0 10 0
x[ 4]: 0 10 0
x[ 5]: 0 10 0
x[ 6]: 0 10 0
x[ 7]: 0 10 0
x[ 8]: 0 10 0
x[ 9]: 0 10 0


Works.
But if I enable SVE512, it fails like you are describing:
[apinski@xeond2 upstream-cross-aarch64]$ ./install-qemu/bin/qemu-aarch64 -cpu
max,sve128=on,sve256=on,sve512=on a.out
x[ 0]: 0 0 0
x[ 1]: 0 0 0
x[ 2]: 0 0 0
x[ 3]: 0 0 0
x[ 4]: 0 0 0
x[ 5]: 0 0 0
x[ 6]: 0 0 0
x[ 7]: 0 0 0
x[ 8]: 0 0 0
x[ 9]: 0 0 0
x[ 0]: 0 10 0
x[ 1]: 0 10 0
x[ 2]: 0 10 0
x[ 3]: 0 0 0
x[ 4]: 0 0 0
x[ 5]: 0 10 0
x[ 6]: 0 10 0
x[ 7]: 0 10 0
x[ 8]: 0 0 0
x[ 9]: 0 0 0