portable-atomic icon indicating copy to clipboard operation
portable-atomic copied to clipboard

std `Atomic{I,U}{8,16}::fetch_{max,min}` seem to broken on a few platform (LLVM bug)

Open taiki-e opened this issue 3 years ago • 3 comments

std Atomic{I,U}{8,16}::fetch_{max,min} is currently broken for the following targets

https://github.com/taiki-e/portable-atomic/blob/55b3d49c293030016c1fc7f60e61e4eca6eec619/src/lib.rs#L1458-L1467

I haven't checked if it's a bug in rustc or in qemu-user, but this crate contains a workaround for this problem.

portable-atomic implements a workaround for this bug, so users aren't affected by this bug. This issue itself is tracking the upstream bug.

taiki-e avatar Feb 24 '22 02:02 taiki-e

It seems armv5te's AtomicI{8,16}::compare_exchange is also broken: https://github.com/taiki-e/portable-atomic/runs/7041957669?check_suite_focus=true

taiki-e avatar Jun 24 '22 13:06 taiki-e

It seems to be reproducible without qemu: https://github.com/rust-lang/rust/issues/100650

taiki-e avatar Aug 17 '22 07:08 taiki-e

I tested MIPS targets because the problem on MIPS was supposedly fixed in LLVM 19, but it seems that only bit-endian's MIPS32R2 is actually fixed, other MIPS targets still have problems. https://github.com/taiki-e/portable-atomic/actions/runs/11314088026

taiki-e avatar Oct 13 '24 18:10 taiki-e