Open
Description
cargo new foo
cd foo
rustc -Clto -Cembed-bitcode=yes -Zvirtual-function-elimination src/main.rs
./main # this works
> Hello, world!
rustc -Clto -Cembed-bitcode=yes -Zvirtual-function-elimination src/main.rs -Copt-level=1
./main
> [1] 2203089 segmentation fault (core dumped) ./main
cc #96285
rustc 1.63.0-nightly (389352c4b 2022-06-15)
binary: rustc
commit-hash: 389352c4bbd56024eefd1566e06dcba04d223f92
commit-date: 2022-06-15
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Category: This is a bug.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: Correct Rust code lowers to incorrect machine codeIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.