https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70828
Bug ID: 70828 Summary: broken array-type subarrays inside acc data in openacc Product: gcc Version: 6.1.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 38351 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38351&action=edit broken subarray Given an array-typed subarray with a non-zero base element on an acc data construct, the gimplifier will implicitly add a pcopy clause for any parallel and kernels construct which uses that array. The pcopy is correct, but this pcopy expects the entire array to be present on the accelerator. This ultimately results in a runtime failure when the base of the subarray is not element zero. This problem can be reproduced with the attached test case in trunk and gcc-6.