| From 8fb793ca15ae5cca4cc78029d545e47a9fe2f12c Mon Sep 17 00:00:00 2001 |
| From: Joel Galenson <jgalenson@google.com> |
| Date: Thu, 23 Apr 2020 12:43:32 -0700 |
| Subject: [PATCH] Revert "Change opt-level from 2 back to 3" |
| |
| This reverts commit 0d52c562db18e85cf53078c9ddb40abe469a4aab. |
| --- |
| Cargo.toml | 7 +++++++ |
| src/librustc_mir/interpret/step.rs | 3 --- |
| src/test/run-make/wasm-stringify-ints-small/Makefile | 2 +- |
| 3 files changed, 8 insertions(+), 4 deletions(-) |
| |
| diff --git a/Cargo.toml b/Cargo.toml |
| index be15e50e2..41e69ed86 100644 |
| --- a/Cargo.toml |
| +++ b/Cargo.toml |
| @@ -33,6 +33,13 @@ exclude = [ |
| "obj", |
| ] |
| |
| +# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3 |
| +# See issue https://github.com/rust-lang/rust/issues/52378 |
| +[profile.release] |
| +opt-level = 2 |
| +[profile.bench] |
| +opt-level = 2 |
| + |
| [profile.release.package.compiler_builtins] |
| # The compiler-builtins crate cannot reference libcore, and it's own CI will |
| # verify that this is the case. This requires, however, that the crate is built |
| diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs |
| index 18f9bbd2e..fea7e50f9 100644 |
| --- a/src/librustc_mir/interpret/step.rs |
| +++ b/src/librustc_mir/interpret/step.rs |
| @@ -38,9 +38,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { |
| /// Returns `true` as long as there are more things to do. |
| /// |
| /// This is used by [priroda](https://github.com/oli-obk/priroda) |
| - /// |
| - /// This is marked `#inline(always)` to work around adverserial codegen when `opt-level = 3` |
| - #[inline(always)] |
| pub fn step(&mut self) -> InterpResult<'tcx, bool> { |
| if self.stack().is_empty() { |
| return Ok(false); |
| diff --git a/src/test/run-make/wasm-stringify-ints-small/Makefile b/src/test/run-make/wasm-stringify-ints-small/Makefile |
| index 01e1c6b0c..26de6a0c6 100644 |
| --- a/src/test/run-make/wasm-stringify-ints-small/Makefile |
| +++ b/src/test/run-make/wasm-stringify-ints-small/Makefile |
| @@ -4,7 +4,7 @@ ifeq ($(TARGET),wasm32-unknown-unknown) |
| all: |
| $(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown |
| wc -c < $(TMPDIR)/foo.wasm |
| - [ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "25000" ] |
| + [ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "20500" ] |
| else |
| all: |
| endif |
| -- |
| 2.28.0.681.g6f77f65b4e-goog |
| |