diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2018-09-28 17:40:06 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2018-09-29 13:00:41 +0300 |
| commit | 9c62193fec1c5d2200c19d9445fe9bad753eefea (patch) | |
| tree | 79710beff41e5f750a8a57b08bba3e36ce5e1a07 /src/librustc_codegen_llvm | |
| parent | 80e6e3e582a9eb9115900d51ae6edecf46d81f6e (diff) | |
| download | rust-9c62193fec1c5d2200c19d9445fe9bad753eefea.tar.gz rust-9c62193fec1c5d2200c19d9445fe9bad753eefea.zip | |
Do not put noalias annotations by default
This will be re-enabled sooner or later depending on results of further investigation. Fixes #54462
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/type_of.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/librustc_codegen_llvm/type_of.rs b/src/librustc_codegen_llvm/type_of.rs index 6eec0b0b68c..765708aeafd 100644 --- a/src/librustc_codegen_llvm/type_of.rs +++ b/src/librustc_codegen_llvm/type_of.rs @@ -10,11 +10,9 @@ use abi::{FnType, FnTypeExt}; use common::*; -use llvm; use rustc::hir; use rustc::ty::{self, Ty, TypeFoldable}; use rustc::ty::layout::{self, Align, LayoutOf, Size, TyLayout}; -use rustc_target::spec::PanicStrategy; use rustc_target::abi::FloatTy; use rustc_mir::monomorphize::item::DefPathBasedNames; use type_::Type; @@ -433,12 +431,19 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> { PointerKind::Shared }, hir::MutMutable => { - // Only emit noalias annotations for LLVM >= 6 or in panic=abort - // mode, as prior versions had many bugs in conjunction with - // unwinding. See also issue #31681. + // Previously we would only emit noalias annotations for LLVM >= 6 or in + // panic=abort mode. That was deemed right, as prior versions had many bugs + // in conjunction with unwinding, but later versions didn’t seem to have + // said issues. See issue #31681. + // + // Alas, later on we encountered a case where noalias would generate wrong + // code altogether even with recent versions of LLVM in *safe* code with no + // unwinding involved. See #54462. + // + // For now, do not enable mutable_noalias by default at all, while the + // issue is being figured out. let mutable_noalias = cx.tcx.sess.opts.debugging_opts.mutable_noalias - .unwrap_or(unsafe { llvm::LLVMRustVersionMajor() >= 6 } - || cx.tcx.sess.panic_strategy() == PanicStrategy::Abort); + .unwrap_or(false); if mutable_noalias { PointerKind::UniqueBorrowed } else { |
