https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106981
Bug ID: 106981 Summary: [OpenMP] ICE in decompose, at wide-int.h:984 with '#pragma acc atomic capture' Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, openacc Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: tschwinge at gcc dot gnu.org, vries at gcc dot gnu.org Target Milestone: --- This is reduced from an OpenACC testsuite. I am not quite sure whether it is valid or not; I now bluntly claim: ice-on-valid-code for C rejects-valid for C++ however, it might well be also an ICE on invalid, I have not checked ... In any case: With g++, it fails with: input5.i:6:44: error: invalid form of ‘#pragma omp atomic’ before ‘(’ token 6 | c[x] = totals[x%((int)(n/10 + 1))] = (a[x] + b[x]) + totals[x%((int) n/10 + 1)]; But with the C compiler, it has an ICE, unless 'long long n' has been changed to 'int': long long n = 100; void test1(int x, double *a, double *b, double *c, double *totals) { #pragma acc atomic capture c[x] = totals[x%((int)(n/10 + 1))] = (a[x] + b[x]) + totals[x%((int) n/10 + 1)]; } The ICE is: -------------------------- input5.i:6:7: internal compiler error: in decompose, at wide-int.h:984 6 | c[x] = totals[x%((int)(n/10 + 1))] = (a[x] + b[x]) + totals[x%((int) n/10 + 1)]; | ^ 0x67f840 wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> > >::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false, false> > const&) ../../repos/gcc/gcc/wide-int.h:984