Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug info tried to be emitted for unreachable code #22852

Closed
Aatch opened this issue Feb 27, 2015 · 1 comment
Closed

Debug info tried to be emitted for unreachable code #22852

Aatch opened this issue Feb 27, 2015 · 1 comment
Labels
A-codegen Area: Code generation A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Aatch
Copy link
Contributor

Aatch commented Feb 27, 2015

This code causes an ICE:

fn main() {
    println!("x");
    return;
    let test = if x() { 1 } else { 2 };
}

fn x() -> bool { unreachable!() }

complaining that the the test variable isn't an alloca. This is true, since we don't output any LLVM IR for unreachable code, which is everything after the return. For some reason, this only happens with if expressions (or at least, it doesn't happen with plain expressions or ordinary blocks) on the RHS.

@Aatch Aatch added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 27, 2015
@michaelwoerister
Copy link
Member

Thanks for the report. Closing as duplicate of #21559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants