Created attachment 38285 [details] test case Here is the output of the attached test case when it is build with -fopenacc: tr1.c: In function ‘sum’: tr1.c:12:9: error: ‘s’ appears both in data and map clauses #pragma acc parallel num_gangs (10) copy (s) reduction (+:s) ^~~ There are two problems with this. 1) the c FE should not be reporting a data map clause error on a reduction variable. 2) That error only gets detected some of the time, depending on the ordering of the clauses (e.g. a data clause involving variable 'v' appears before a reduction clause involving 'v' in the clause list). A third problem would be that this error message is not specific to OpenACC. The c++ FE also has a similar problem.
Created attachment 38621 [details] new test case This issue has been resolved in trunk r236678. I forgot to include a PR tag in the ChangeLog entry. To verify the fix, I modified the original test case to make it executable in the libgomp test suite. Furthermore, I changed parallel regions to parallel loop regions so that the reduction yields sane results with multiple gangs. I'll commit this test case to trunk with the proper PR tag in the ChangeLog entry before I close this issue.
Author: cesar Date: Wed Jun 1 20:37:44 2016 New Revision: 237011 URL: https://gcc.gnu.org/viewcvs?rev=237011&root=gcc&view=rev Log: PR c/70688 * pr70688.c: New file. Added: trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c Modified: trunk/libgomp/ChangeLog
Author: cesar Date: Wed Jun 1 20:40:10 2016 New Revision: 237012 URL: https://gcc.gnu.org/viewcvs?rev=237012&root=gcc&view=rev Log: PR c/70688 * pr70688.c: New file. Added: branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c Modified: branches/gomp-4_0-branch/libgomp/ChangeLog.gomp
Fixed in r237011.