Skip to content

Commit

Permalink
Auto merge of #67878 - Others:opt-3, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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 #52378

(possibly relevant is the [current update to LLVM 10](#67759))
  • Loading branch information
bors committed Jan 31, 2020
2 parents 34700c1 + 0d52c56 commit 138c50f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ 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

# These options are controlled from our rustc wrapper script, so turn them off
# here and have them controlled elsewhere.
[profile.dev]
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_mir/interpret/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ impl<'mir, 'tcx, 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);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make/wasm-stringify-ints-small/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "20500" ]
[ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "25000" ]
else
all:
endif

0 comments on commit 138c50f

Please sign in to comment.