Skip to content

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

@taiki-e

Description

@taiki-e

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

portable-atomic/src/lib.rs

Lines 1458 to 1467 in 55b3d49

// HACK: the following operations are currently broken (at least on qemu):
// - aarch64's `AtomicI{8,16}::fetch_{max,min}` (release mode + lse)
// - armv5te's `Atomic{I,U}{8,16}::fetch_{max,min}`
// - mips's `AtomicI8::fetch_{max,min}` (release mode)
// - mipsel's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
// - mips64's `AtomicI8::fetch_{max,min}` (release mode)
// - mips64el's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
// - powerpc's `AtomicI{8,16}::fetch_{max,min}`
// - powerpc64's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
// - powerpc64le's `AtomicU{8,16}::fetch_{max,min}` (release mode + fat LTO)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-upstream-bugCategory: This is a bug of compiler or dependencies (the fix may require action in the upstream)O-aarch64Target: Armv8-A, Armv8-R, or later processors in AArch64 modeO-armTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateO-mipsTarget: MIPS processorsO-powerpcTarget: PowerPC processors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions