This fortran testcase was passing by not testing what it thought it was testing. The loop over which the reduction is specified is not partitioned, and hence the reduction was being elided.

Fixing that problem turns out to be more involved, and a distraction from completing the patch series I'm working on (which exposed this problem).

I've adjusted the testcase to specify a partitioning, and marked the test as xfailing.

nathan
2015-10-18  Nathan Sidwell  <nat...@codesourcery.com>

	* gfortran.dg/goacc/reduction-2.f95: Force loop partitioning and
	xfail.

Index: gcc/testsuite/gfortran.dg/goacc/reduction-2.f95
===================================================================
--- gcc/testsuite/gfortran.dg/goacc/reduction-2.f95	(revision 228954)
+++ gcc/testsuite/gfortran.dg/goacc/reduction-2.f95	(working copy)
@@ -1,4 +1,6 @@
-! { dg-do compile }
+! { dg-xfail-if "" { *-*-* } { "*" } { "" } }
+! { dg-excess-errors "internal compiler error" }
+! { dg-do compile  }
 
 program reduction
   integer, parameter    :: n = 40, c = 10
@@ -13,7 +15,7 @@ subroutine redsub(sum, n, c)
   sum = 0
 
   !$acc parallel vector_length(n) copyin (n, c)
-  !$acc loop reduction(+:sum)
+  !$acc loop vector reduction(+:sum)
   do i = 1, n
      sum = sum + c
   end do

Reply via email to