This patch updates the way that private reductions are handled in gomp4 to be more like trunk. Before, omp lower was using a complicated mapping for private variables, but now it's treating them more like omp, with the exception of reference-type variables. This complication originated back when we were using ganglocal memory for private variables. Now that private variables just regular local variables, I was able to remove a lot of that old code. It should be noted that reference-type variables still rely on gimplifier creating a special OMP_CLAUSE_REDUCTION_PRIVATE_DECL, which is basically a local copy of the reduction variable. Currently this is used when the reduction variables are dummy arguments in fortran or parallel (non-loop) reductions. I want to get rid of the localize_reductions pass from the gimplifier eventually, but for the time being this patch does fix pr/68813. In the process of removing removing that old private code, I noticed that lower_oacc_reductions couldn't handle reductions of the form #pragma acc loop reduction (+:v) for (...) #pragma acc loop reduction (+:v) for (...) That's fixed now. In addition to teaching lower_oacc_reductions about private variables, I also taught it how to update any intermediate reduction variable when present. I'll port over this change to trunk once I've resolved the localize_reductions issue in the gimplifier. I don't have recent baseline, but I am seeing these failures: g++.sum:c-c++-common/goacc/routine-7.c libgomp.oacc-c/../libgomp.oacc-c-c++-common/declare-4.c I'll work on routine-7.c tomorrow. Jim, can you look at the declare-4.c failure? This patch has been applied to gomp-4_0-branch. Cesar