You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take a build of rustc for ARM (specifically, gnueabi; gnueabihf is untested and may or may not exhibit this problem). Luqman has one you can use at http://luqman.ca/rust-builds/.
Attempt to compile something with optimisations, e.g. echo 'fn main(){}' | rustc - -O.
This fails altogether:
Stack dump:
0. Running pass 'Function Pass Manager' on module 'rust_out.rc'.
1. Running pass 'Machine Common Subexpression Elimination' on function '@main'
Segmentation fault
@chris-morgan: Use rustc --emit-llvm to output LLVM bytecode, and then use bugpoint -simplify-cfg -early-cse from Rust's LLVM directory (in Release+Asserts/bin) on the bytecode file. It should narrow down small a test case.
So it turns out it was a problem with the gcc version I was using (Debian 4.4.6-14) miscompiling LLVM in some way. Switched to Debian 4.7.2-4 and it seems to work.
This has turned out to be a false alarm caused by old software; @luqmana provided me with a new build using GCC 4.7 to build LLVM instead of GCC 4.4 and -O is now working. Yes, compilation of the http crate on my tablet can now take more than a minute instead of twenty seconds.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jan 12, 2023
Steps to reproduce:
echo 'fn main(){}' | rustc - -O
.This fails altogether:
A more complex example is building chris-morgan/rust-http@e909dfb; in this case it fails in a different way:
I believe these are LLVM bugs rather than rustc bugs, but at the least Rust is triggering them. Should I be reporting them in LLVM?
The text was updated successfully, but these errors were encountered: