https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120052
Bug ID: 120052
Summary: internal compiler error: in scan_omp_1_op, at
omp-low.cc:4005
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ldalessandro at gmail dot com
Target Milestone: ---
UBSan + OpenMP ICE
C-Vise reduced test case, compile with -fsanitize=undefined -fopenmp.
void copy_n(int, long, int);
unsigned long n_ranks;
long rank;
enum { TYPE_COUNT } ingest_data___trans_tmp_1;
auto ingest_data() {
long counts[TYPE_COUNT][n_ranks];
#pragma omp parallel
for (int i;;)
copy_n(ingest_data___trans_tmp_1, counts[i][rank], 0);
}
This only triggers with **both** UBSan and OpenMP.
Live: https://godbolt.org/z/oKqa6jMrq [May 1st, 2025]