-
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-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticT-langRelevant to the language teamRelevant to the language team
Description
Noticed this while playing with #54235.
fn f(x: f64) -> f64 {
0f64 / x
}
fn main() {
println!("{:?}", (0f64 / 0f64).is_sign_negative());
println!("{:?}", f(0f64).is_sign_negative());
}
As of rustc 1.31.0-nightly (46880f4 2018-10-15) on x86_64-unknown-linux-gnu, in debug mode this program prints false
true
and in release mode prints false
false
. Two of my expectations are violated:
- The output should be consistent between debug mode and release mode.
- The first and second println should print the same value.
(Happy to reconsider if these expectations are unfounded.)
hanna-kruppe, scottmcm, Dylan-DPC-zz and workingjubileeschneiderfelipe, Shnatsel and Esper89
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-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticT-langRelevant to the language teamRelevant to the language team