[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-25 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #12 from Rory Bolt --- (In reply to Patrick O'Neill from comment #11) > I can confirm that your fix does *not* break the testsuite on little endian. > > We also recently added inline subword atomics to GCC 13, will this code also >

[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-25 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #10 from Rory Bolt --- Tested and verified on little endian too.

[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-24 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #9 from Rory Bolt --- Created attachment 55153 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55153&action=edit patch Tested fix for big endian, NOT tested on little endian

[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-24 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #8 from Rory Bolt --- So... The logic for this is simple: For little endian the shift amount is ((address & 3) * 8) For big endian the shift amount is ((3 -(address & 3)) * 8) Unfortunately I have ZERO experience modifying GCC, a

[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-23 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #6 from Rory Bolt --- Ah... that code makes so much sense now... So my original comment about simply using a different constant was too simplistic; what is being attempted is to shift the constant 1 into the correct byte position si

[Bug target/109933] New: __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-22 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 Bug ID: 109933 Summary: __atomic_test_and_set is broken for BIG ENDIAN riscv targets Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal