https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626
Bug ID: 70626 Summary: bogus results in 'acc parallel loop' reductions Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: openacc Severity: normal Priority: P3 Component: middle-end Assignee: cesar at gcc dot gnu.org Reporter: cesar at gcc dot gnu.org CC: tschwinge at gcc dot gnu.org Target Milestone: --- Created attachment 38233 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38233&action=edit test case Currently, given a combined acc parallel loop of the form #pragma acc parallel loop reduction(+:var) all of the front ends will split that loop as #pragma acc parallel #pragma acc loop reduction(+:var) This is bad because the gimplifier will not assign an implicit present_or_copy clause for the reduction variable 'var', instead 'var' gets transferred via firstprivate. One solution here is to teach the front ends to attach the reduction clause to both directives, instead of just the split acc loop.