-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong code regression: HashSet initialization #42918
Comments
Nominating. cc @rust-lang/compiler -- anybody have any ideas what's going on with this ARM codegen regression? |
So we've updated to LLVM 4.0.1 since then (#42930) -- I suspect that may well have fixed this problem. Perhaps @Dushistov could check on a recent nightly? In case the problem isn't quite fixed, cc @arielb1 |
Yes, with rustc At now only |
I believe that the fix is backported, just we haven't released a new beta yet. |
It looks to me like the llvm patch has not been backported yet. I will do so today. |
@Mark-Simulacrum hm so it is. it is tagged incorrectly. |
beta.3 is out with the LLVM backport. Can anyone confirm a fix? |
@brson |
Thanks for confirming @Dushistov. I don't offhand know how to reduce the test case though. Sorry! |
I was able to reduce the test to this code: use std::collections::HashSet;
#[derive(PartialEq, Debug, Hash, Eq, Clone)]
enum MyEnum {
E0,
E1,
E2,
E3,
E4,
E5,
E6,
E7,
}
fn main() {
let s: HashSet<_> = [MyEnum::E4, MyEnum::E1].iter().cloned().collect();
println!("Expect only E1+E4 got {:?}", s);
} it prints
on buggy compier |
This is test for rust-lang#42918. To reproduce bug you need machine with arm cpu and compile with optimization. I tried with rustc 1.19.0-nightly (3d5b8c6 2017-06-09), if compile test with -C opt-level=3 for target=arm-linux-androideabi and run on "Qualcomm MSM 8974 arm cpu" then assert fails, if compile and run with -C opt-level=2 it gives segmentation fault. So I add `compile-flags: -O`. With rustc 1.19.0 (0ade339 2017-07-17) all works fine. Closes rust-lang#42918
Add test for wrong code generation for HashSet creation on arm cpu This is test for #42918. To reproduce bug you need machine with arm cpu and compile with optimization. I tried with rustc 1.19.0-nightly (3d5b8c6 2017-06-09), if compile test with -C opt-level=3 for target=arm-linux-androideabi and run on "Qualcomm MSM 8974 arm cpu" then assert fails, if compile and run with -C opt-level=2 it gives segmentation fault. So I add `compile-flags: -O`. With rustc 1.19.0 (0ade339 2017-07-17) all works fine. Closes #42918
Idea of bug is simple:
On stable today compiler
rustc 1.18.0 (03fc9d622 2017-06-06)
it print as expected{RMC, GGA}
, but if use beta/nightly it prints all variants fromSentenceType
.Note: that the code above is just sketch, to realy reproduce problem you need android/arm cpu (may be works with other/arm, but I not able to check right now),
and two crates, in attachment crate that reproduce problem,
to run it you may use such commands:
adb shell mkdir /data/sample cargo build --target=arm-linux-androideabi --release adb push target/arm-linux-androideabi/release/hashset_bug /data/sample/ adb shell 'RUST_LOG=debug /data/sample/hashset_bug'
With stable it produces such output:
with beta/nightly it prodcues such output:
hashset_bug.zip
The text was updated successfully, but these errors were encountered: