https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103642
Bug ID: 103642 Summary: [12 Regression] ICE in lower_omp_target: omp-low.c:12977 (fold_convert_loc) for omp target map(from: t.s->a[:N]) Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, openmp Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: cltang at gcc dot gnu.org, jakub at gcc dot gnu.org Target Milestone: --- Compiling https://github.com/clang-ykt/omptests/blob/master/t-partial-struct/test.cpp fails now as follows: during GIMPLE pass: omplower t-partial-struct/test.cpp: In function ‘int main()’: t-partial-struct/test.cpp:232:13: internal compiler error: in fold_convert_loc, at fold-const.c:2450 232 | #pragma omp target map(from: t.s->a[:N]) | ^~~ 0x7d313f fold_convert_loc(unsigned int, tree_node*, tree_node*) ../../repos/gcc/gcc/fold-const.c:2450 0x11218d4 lower_omp_target ../../repos/gcc/gcc/omp-low.c:12977 0x11218d4 lower_omp_1 ../../repos/gcc/gcc/omp-low.c:14223 0x11218d4 lower_omp ../../repos/gcc/gcc/omp-low.c:14362 Until recently, it failed with: t-partial-struct/test.cpp:232:37: error: expected ')' before '->' token which means this is a regression. Reduced testcase - compile with "gcc / g++ -fopenmp": typedef struct { int *a; } SSS; typedef struct { SSS *s; } TTT; main() { TTT t; #pragma omp target map(t.s->a[9]) ; }