Skip to content

SIGSEGV on MIPS when dividing two 128-bit integers #41222

@japaric

Description

@japaric

STR

#![feature(i128_type)]

fn main() {
    let x: u128 = 1844674407370955161400;
    let y: u128 = 18002795302052819272;
    let z = x / y;

    println!("{}", x);
    println!("{}", y);
    println!("{}", z);
}
$ cargo run
1844674407370955161400
18002795302052819272
102

$ cross run --target mips-unknown-linux-gnu
     Running `/target/mips-unknown-linux-gnu/debug/hello`
Segmentation fault (core dumped)

This operation / intrinsic is implemented in Rust. Other 32-bit targets don't have this problem.

$ cross run --target arm-unknown-linux-gnueabi
1844674407370955161400
18002795302052819272
102

Meta

$ rustc -V
rustc 1.18.0-nightly (3b5754e5c 2017-04-10)

cc @est31 I suspect this is some ABI problem.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-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