On 12/02/2015 07:58 AM, Thomas Schwinge wrote: > diff --git gcc/testsuite/gfortran.dg/goacc/coarray.f95 gcc/testsuite/gfortran.dg/goacc/coarray.f95 > index 130ffc3..d2f10d5 100644 > --- gcc/testsuite/gfortran.dg/goacc/coarray.f95 > +++ gcc/testsuite/gfortran.dg/goacc/coarray.f95 > @@ -1,7 +1,9 @@ > ! { dg-do compile } > ! { dg-additional-options "-fcoarray=single" } > - > -! TODO: These cases must fail > +! > +! PR fortran/63861 > +! { dg-xfail-if "" { *-*-* } } > +! { dg-excess-errors "TODO" } > > module test > contains > @@ -9,7 +11,6 @@ contains > implicit none > integer :: i > integer, codimension[*] :: a > - ! { dg-excess-errors "sorry, unimplemented: directive not yet implemented" } > !$acc declare device_resident (a) > !$acc data copy (a) > !$acc end data > @@ -17,7 +18,6 @@ contains > !$acc end data > !$acc parallel private (a) > !$acc end parallel > - ! { dg-excess-errors "sorry, unimplemented: directive not yet implemented" } > !$acc host_data use_device (a) > !$acc end host_data > !$acc parallel loop reduction(+:a) > diff --git gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 > index f9cf9ac..87e04d5 100644 > --- gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 > +++ gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 > @@ -3,6 +3,7 @@ > ! > ! PR fortran/63861 > ! { dg-xfail-if "" { *-*-* } } > +! { dg-excess-errors "TODO" } This host_data patch exposed a bug in the fortran front end where it was allowing arrays to be used as reduction variables. If replace you replace codimension with dimension, you'd see a similar ICE. The attached patch, while it doesn't make any attempt to fix the gimplifier changes, does teach the fortran front end to error on acc reductions containing array variables. Note that this solution is somewhat aggressive because we probably should allow reductions on individual array elements. E.g. !$acc loop reduction(+:var(1)) The c and c++ front ends also have that problem. Maybe I'll revisit this later. Is this ok for trunk? It will close pr63861. Cesar