This patch fixes a segfault in libgomp.oacc-fortran/non-scalar-data.f90.
The problem here is that 'n' is a parameter, and the kernels region
implicitly adds a copy clause to n. Naturally, the test segfaults when
it comes time to write the value back to the host as the kernels region
terminates. This problem only occurs on nvptx targets.

I'll apply this patch to trunk as obvious.

Cesar
2016-04-14  Cesar Philippidis  <ce...@codesourcery.com>

	libgomp/
	* testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Don't
	pass parameter variables to subroutines.

diff --git a/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90 b/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90
index 4afb562..94e4228 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90
@@ -6,9 +6,11 @@
 program main
   implicit none
 
-  integer, parameter :: n = 100
-  integer :: array(n), i
-  
+  integer,parameter :: size = 100
+  integer :: array(size), i, n
+
+  n = size
+
   !$acc data copy(array)
   call kernels(array, n)
 

Reply via email to