Bug 70688 - bogus OpenACC data clause errors involving reductions
Summary: bogus OpenACC data clause errors involving reductions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: cesar
URL:
Keywords: openacc
Depends on:
Blocks:
 
Reported: 2016-04-15 20:42 UTC by cesar
Modified: 2016-06-01 20:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test case (164 bytes, text/plain)
2016-04-15 20:42 UTC, cesar
Details
new test case (245 bytes, text/x-csrc)
2016-06-01 20:16 UTC, cesar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cesar 2016-04-15 20:42:03 UTC
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.
Comment 1 cesar 2016-06-01 20:16:11 UTC
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.
Comment 2 cesar 2016-06-01 20:38:15 UTC
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
Comment 3 cesar 2016-06-01 20:40:42 UTC
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
Comment 4 cesar 2016-06-01 20:46:16 UTC
Fixed in r237011.