https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104774
Bug ID: 104774 Summary: OpenACC 'kernels' decomposition: internal compiler error: 'verify_gimple' failed, with 'loop' with explicit 'seq' or 'independent' Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, openacc Severity: normal Priority: P3 Component: middle-end Assignee: tschwinge at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org Target Milestone: --- Another one in addition to PR104132, PR104133, that is *not* fixed by my WIP patches for those: int arr_0; void foo (void) { #pragma acc kernels { int k; #pragma acc loop seq for (k = 0; k < 2; k++) arr_0 = k; #pragma acc loop independent reduction(+: arr_0) for (k = 0; k < 2; k++) arr_0 += k; } } With '-fopenacc --param openacc-kernels=decompose -O0 -g0' (so, not involving 'GIMPLE_DEBUG's), for both C and C++, we run into: pr.c: In function ‘foo._omp_fn.0’: pr.c:18:1: error: non-register as LHS of binary operation 18 | } | ^ # .MEM_21 = VDEF <.MEM_3> k = 0 + .offset.24_2; pr.c:18:1: error: invalid RHS for gimple memory store: ‘var_decl’ *_23; k # .MEM_24 = VDEF <.MEM_21> *_23 = k; pr.c:18:1: error: non-register as LHS of binary operation # .MEM_27 = VDEF <.MEM_4> k = 0 + 2; during GIMPLE pass: ssa pr.c:18:1: internal compiler error: verify_gimple failed Only with both 'loop's changed to implicit or explicit 'auto' (that is, both 'seq' and 'independent' removed), we succeed to compile (with my PR104132, PR104133 WIP patches applied).