Skip to content

Incorrect LLVM generated with mir-opt-level=2: cannot invoke intrinsic #69911

Closed
@tmiasko

Description

@tmiasko
struct A;

impl Drop for A {
    fn drop(&mut self) {
        println!("A");
    }
}

fn main() {
    let a = A;
    std::sync::atomic::spin_loop_hint();
    std::mem::forget(a);
}
$ rustc -Copt-level=0 -Zmir-opt-level=2 a.rs
Cannot invoke an intrinsic other than donothing, patchpoint, statepoint, coro_resume or coro_destroy
  invoke void @llvm.x86.sse2.pause()
          to label %15 unwind label %16
Cannot invoke an intrinsic other than donothing, patchpoint, statepoint, coro_resume or coro_destroy
  invoke void @llvm.x86.sse2.pause()
          to label %15 unwind label %16
in function _ZN1a4main17h5a7c080779719c70E
LLVM ERROR: Broken function found, compilation aborted!

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-codegenArea: Code generationA-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions