https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93553
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> --- Slightly simplified one can use a scalar 'c' instead of an array. One gets (-fdump-tree-gimple): #pragma omp parallel reduction(+:x) shared(c) { integer(kind=8) D.3933; integer(kind=8) D.3934; #pragma omp for nowait private(i) for (i = 1; i <= 8; i = i + 1) { D.3933 = (integer(kind=8)) i; D.3934 = D.3933 + -1; (*x)[D.3934] = c; During omp-lowering, one has: … D.3924 = S.0 + -1; D.3940 = x; (*D.3940)[D.3924] = 0; The "D.3940 = x;" is processed and the "D.3940" ends up as "tp" argument to "scan_omp_1_op" which calls then in turn: tree repl = remap_decl (t, &ctx->cb) The latter then calls omp_copy_decl and returns error_mark_node → this gives then the gcc_assert in scan_omp1_op. By contrast, "S.0" appears in ctx->cb->decl_map and, hence, omp_copy_decl is not called for it.