Skip to content

Commit 138c50f

Browse files
committedJan 31, 2020
Auto merge of rust-lang#67878 - Others:opt-3, r=Mark-Simulacrum
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 hopefully no longer needed? I tried a little bit to replicate the original problem, and could not. I think running this through CI is the best way to smoke test this :) Even if things break dramatically, the comment should be updated to reflect that things are still broken with LLVM 9. I'm just getting started playing with the compiler, so apologies if I've missed an obvious problem here. fixes rust-lang#52378 (possibly relevant is the [current update to LLVM 10](rust-lang#67759))

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
@@ -31,13 +31,6 @@ exclude = [
3131
"obj",
3232
]
3333

34-
# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3
35-
# See issue https://github.com/rust-lang/rust/issues/52378
36-
[profile.release]
37-
opt-level = 2
38-
[profile.bench]
39-
opt-level = 2
40-
4134
# These options are controlled from our rustc wrapper script, so turn them off
4235
# here and have them controlled elsewhere.
4336
[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)
Please sign in to comment.