-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.O-PowerPCTarget: PowerPC processorsTarget: PowerPC processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
fn main() {
let range = -2..i64::MAX;
dbg!(&range);
// With this assertion, it works as expected!
// assert!(range.start < range.end);
dbg!(range.size_hint());
}
I expected to see this, which does work in debug mode:
[src/main.rs:3] &range = -2..9223372036854775807
[src/main.rs:6] range.size_hint() = (
9223372036854775809,
Some(
9223372036854775809,
),
)
But in release mode, this happened:
[src/main.rs:3] &range = -2..9223372036854775807
[src/main.rs:6] range.size_hint() = (
0,
Some(
0,
),
)
However, it does work in release mode if that start < len
assertion is uncommented.
Meta
$ rustc --version --verbose
rustc 1.45.0-nightly (a08c47310 2020-05-07)
binary: rustc
commit-hash: a08c47310c7d49cbdc5d7afb38408ba519967ecd
commit-date: 2020-05-07
host: powerpc64le-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0
This is not new -- it comes from a failure noted in rayon-rs/rayon#585 in July 2018, which unfortunately I forgot to followup on until now. It's fine on x86_64, so it seems like an arch-specific codegen issue, most likely down to LLVM.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.O-PowerPCTarget: PowerPC processorsTarget: PowerPC processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.