Skip to content

Commit 0d52c56

Browse files
committed
Change opt-level from 2 back to 3
In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is no longer needed. This creates a small compile time regression in MIR constant eval, so I've added a #[inline(always)] on the `step` function used in const eval Also creates a binary size increase in wasm-stringify-ints-small, so I've bumped the limit there.
1 parent 760ce94 commit 0d52c56

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Cargo.toml

-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ exclude = [
3030
"obj",
3131
]
3232

33-
# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3
34-
# See issue https://github.com/rust-lang/rust/issues/52378
35-
[profile.release]
36-
opt-level = 2
37-
[profile.bench]
38-
opt-level = 2
39-
4033
# These options are controlled from our rustc wrapper script, so turn them off
4134
# here and have them controlled elsewhere.
4235
[profile.dev]

src/librustc_mir/interpret/step.rs

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
3838
/// Returns `true` as long as there are more things to do.
3939
///
4040
/// This is used by [priroda](https://github.com/oli-obk/priroda)
41+
///
42+
/// This is marked `#inline(always)` to work around adverserial codegen when `opt-level = 3`
43+
#[inline(always)]
4144
pub fn step(&mut self) -> InterpResult<'tcx, bool> {
4245
if self.stack.is_empty() {
4346
return Ok(false);

src/test/run-make/wasm-stringify-ints-small/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ifeq ($(TARGET),wasm32-unknown-unknown)
44
all:
55
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown
66
wc -c < $(TMPDIR)/foo.wasm
7-
[ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "20500" ]
7+
[ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "25000" ]
88
else
99
all:
1010
endif

0 commit comments

Comments
 (0)