about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAkos Kiss <akiss@inf.u-szeged.hu>2015-01-26 22:39:51 +0100
committerAkos Kiss <akiss@inf.u-szeged.hu>2015-01-26 22:55:34 +0100
commitea50bf8850304e8afefa9089792fc077fb54aef4 (patch)
treecb84e772180603c5fde2bb8d24d8b05cf2bf2dc0
parent7615e187c6d1a4c33b973a4aefb997161729f143 (diff)
Unconditionally disable LLVM's FastISel on AArch64
Before ca07e256f62f772d14c42f41af46f2aeacc54983, LLVM's AArch64FastISel
had a sign (and zero?) extension bug. Until rustc gets its LLVM past
that commit, the way of workaround is to pass an option to LLVM that
forces the disabling of FastISel (which would normally kick in for -O0).

Fixes #21627
-rw-r--r--src/librustc_trans/back/write.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs
index 5e48ce384be..68e1be65ee8 100644
--- a/src/librustc_trans/back/write.rs
+++ b/src/librustc_trans/back/write.rs
@@ -1012,6 +1012,9 @@ unsafe fn configure_llvm(sess: &Session) {
         if sess.time_llvm_passes() { add("-time-passes"); }
         if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
 
+        // FIXME #21627 disable faulty FastISel on AArch64 (even for -O0)
+        if sess.target.target.arch.as_slice() == "aarch64" { add("-fast-isel=0"); }
+
         for arg in sess.opts.cg.llvm_args.iter() {
             add(&(*arg)[]);
         }