Skip to content

LLVM crash: Basic Block does not have terminator! #88043

@dtolnay

Description

@dtolnay

The following is minimized from https://crates.io/crates/lalrpop, which is regressed as of nightly-2021-08-15.

fn bump() -> Option<usize> {
    unreachable!()
}

fn take_until(terminate: impl Fn() -> bool) {
    loop {
        if terminate() {
            return;
        } else {
            bump();
        }
    }
}

fn main() {
    take_until(|| true);
}
$ rustc +nightly-2021-08-14 main.rs
$ ./main
$ # :)

$ rustc +nightly-2021-08-15 main.rs
Basic Block in function '_ZN4main10take_until17h0067b8a660429bc9E' does not have terminator!
label %3
in function _ZN4main10take_until17h0067b8a660429bc9E
LLVM ERROR: Broken function found, compilation aborted!

$ rustc +nightly-2021-08-15 --version --verbose
rustc 1.56.0-nightly (8007b506a 2021-08-14)
binary: rustc
commit-hash: 8007b506ac5da629f223b755f5a5391edd5f6d01
commit-date: 2021-08-14
host: x86_64-unknown-linux-gnu
release: 1.56.0-nightly
LLVM version: 12.0.1

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions