Skip to content

Test that the compiler/library builds with -Zmir-opt-level=3 -Zvalidate-mir #105706

Closed
@saethlin

Description

@saethlin

Because currently it doesn't. -Zmir-opt-level=3 has a handful of problems which are reported elsewhere, but discovering problems with MIR optimizations is often as simple as building the compiler with the optimization enabled and -Zvalidate-mir. So we should do that in CI.

Note that all MIR opt levels are supposed to be sound, and known unsoundness is supposed to be gated behind -Zunsound-mir-opts, which I am not suggesting we test with.


Currently attempting to build the standard library with these flags results in pages of this error:

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:20363 ~ core[b221]::core_simd::masks::mask_impl::{impl#6}::to_bitmask_integer), const_param_did: None }) (after pass DestinationPropagation) at bb2[2]:
                                encountered overlapping memory in `Call` terminator: _0 = <U as ReverseBits>::reverse_bits(move _0, const LANES) -> [return: bb3, unwind: bb6] 
   --> /home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../portable-simd/crates/core_simd/src/masks/full_masks.rs:217:13
    |    
217 |             bitmask.reverse_bits(LANES)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |    
    = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:779:26

Which looks to me like #105428

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-testsuiteArea: The testsuite used to check the correctness of rustcE-help-wantedCall for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions