Skip to content

64 bit shift is broken in nightly build for MIPS #116177

Closed
@mcroomp

Description

@mcroomp

I tried this code:

const SHIFTVALUE : i64 = 10000000000i64;

fn main() {

    fn shiftleft(a : i64, b : i64) -> i64 {
        a << b
    }

    assert_eq!(shiftleft(black_box(SHIFTVALUE), black_box(2)), SHIFTVALUE << 2);
}

Nightly fails running on MIPS emulator

assertion left == right failed
left: 35705032704
right: 40000000000

Stable succeeds

Looks like the top and bottom dwords are mixed up

target is mips-unknown-linux-musl
emulator is qemu-mips-static

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-MIPSTarget: MIPS processorsP-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions