]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #88388 - ldm0:outliner, r=nikic
authorbors <bors@rust-lang.org>
Sat, 28 Aug 2021 13:10:26 +0000 (13:10 +0000)
committerbors <bors@rust-lang.org>
Sat, 28 Aug 2021 13:10:26 +0000 (13:10 +0000)
Revert "Disable the machine outliner by default"

The fix commit is already in the fork: https://github.com/rust-lang/llvm-project/commit/6c78dbd4ca1f
Linked:
- https://github.com/rust-lang/rust/issues/85351
- https://github.com/rust-lang/rust/pull/86020

compiler/rustc_codegen_llvm/src/llvm_util.rs

index 0ca51bd288317feee81b98ddf561e64b88c3b9cd..3b64ec1a99122c389952e810f7c6a3f0bdf9f219 100644 (file)
@@ -89,13 +89,14 @@ fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
             add("-generate-arange-section", false);
         }
 
-        // FIXME(nagisa): disable the machine outliner by default in LLVM versions 11, where it was
-        // introduced and up.
+        // Disable the machine outliner by default in LLVM versions 11 and LLVM
+        // version 12, where it leads to miscompilation.
         //
-        // This should remain in place until https://reviews.llvm.org/D103167 is fixed. If LLVM
-        // has been upgraded since, consider adjusting the version check below to contain an upper
-        // bound.
-        if llvm_util::get_version() >= (11, 0, 0) {
+        // Ref:
+        // - https://github.com/rust-lang/rust/issues/85351
+        // - https://reviews.llvm.org/D103167
+        let llvm_version = llvm_util::get_version();
+        if llvm_version >= (11, 0, 0) && llvm_version < (13, 0, 0) {
             add("-enable-machine-outliner=never", false);
         }