Repository navigation
LLVM Assertion in autovectorization when compiling with release + overflow-checks since 1.73 #120813
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Using Rust 1.76.0 on an Apple M1 Pro with OSX 14.3, using cargo b with opt-level = 3:
fn main() {
let mut slobber = Vec::<([u8; 52], [u8; 16], usize)>::new();
slobber.push(([0; 52], [0; 16], 0));
let mut dels = Vec::<([u8; 16], [u8; 10], i8)>::new();
let i = 0;
while i < slobber.len() {
let j = slobber.len();
let mut counts = Vec::<(usize, [u8; 16], usize)>::new();
let mut k = i;
while k < j {
let l = slobber.len();
counts.push((0, [0; 16], 0));
k = l;
}
for u in 1..counts.len() {
let (b1, b2) = (counts[0].1, counts[u].1);
let mut diffs = 0;
for m in 0..16 {
if b1[m] != b2[m] {
diffs += 1;
}
}
if diffs <= 0 {
dels.push(([0; 16], [0; 10], 0));
}
}
}
}
this happens
mac% cargo b
Compiling bugsy v0.0.1 (/Users/davidjaffe/repos/infinimmune/bugsy)
error: could not compile `bugsy` (bin "bugsy")
Caused by:
process didn't exit successfully: `/Users/davidjaffe/.rustup/toolchains/1.76.0-aarch64-apple-darwin/bin/rustc --crate-name bugsy src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=100 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C debug-assertions=on -C metadata=188901b3f11ecd49 -C extra-filename=-188901b3f11ecd49 --out-dir /Users/davidjaffe/repos/infinimmune/bugsy/target/debug/deps -C incremental=/Users/davidjaffe/repos/infinimmune/bugsy/target/debug/incremental -L dependency=/Users/davidjaffe/repos/infinimmune/bugsy/target/debug/deps` (signal: 5, SIGTRAP: trace/breakpoint trap)
The error depends on the optimization level and overflow checking.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Activity
saethlin commentedon Feb 8, 2024
This is an LLVM assertion that can be hit by compiling for the
aarch64-unknown-linux-gnuas well. I suspect any aarch64 target would hit it.The regression is in nightly-2023-08-09, which is when #114048, the LLVM 17 update landed.
[-]SIGTRAP using 1.76.0 on Apple M1 Pro[/-][+]LLVM Assertion in autovectorization when compiling with release + overflow-checks since 1.73[/+]dianqk commentedon Feb 9, 2024
A reduced case:
https://llvm.godbolt.org/z/narrKadhK
Upstream issue: llvm/llvm-project#81216
(I'm on vacation, and I'm not familiar with it. So I won't be assigning it to myself for a while. :) )
apiraino commentedon Feb 9, 2024
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-high
nikic commentedon Feb 16, 2024
Should be fixed in beta & nightly.