https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70643
Bug ID: 70643 Summary: broken openacc reduction inside a fortran module 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 38248 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38248&action=edit broken test case The attached test case causes an ICE in omp_low.c:lower_oacc_reductions because that function is only guarding the incoming reduction variable against INTEGER_CST when it comes time to build a mem_ref to it. Instead that function should be checking if incoming is a TREE_CONSTANT. Thomas reported this problem for gomp-4_0-branch here <https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00491.html>, and as he stated this is also present in trunk. I'm testing a patch for it.