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

rory.bolt at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 24 14:08:16 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933

--- Comment #8 from Rory Bolt <rory.bolt at gmail dot com> ---
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, and the mechanism to
determine if it is generating big endian code or little endian code is not
obvious to me...

So working on this in my spare time it will be a while for me to create a
patch. That said, I do have a full big endian linux environment so I can test a
patch (relatively quickly - it takes a while to build GCC ;-)) if some one
beats me to this.


More information about the Gcc-bugs mailing list