Hi,

This patch fixes a broken test case I added in a recent patch: https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01504.html

The broken test can segfault due to writing to read-only memory, which this new version avoids. Will apply to the openacc-gcc-8-branch shortly.


Thanks,
Gergö


    libgomp/
    * testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90: Update.
>From 65bf7b1656d4cffa2bd057c2e3a2129d449d04a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerg=C3=B6=20Barany?= <ge...@codesourcery.com>
Date: Tue, 19 Feb 2019 04:17:26 -0800
Subject: [PATCH] [og8] Fix incorrect test case

OpenACC kernels regions implicitly copy variables to and from the device,
but in this test case a loop bound lives in read-only memory and the test
can segfault.

    libgomp/
    * testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90: Update.
---
 libgomp/ChangeLog.openacc                                           | 4 ++++
 libgomp/testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90 | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index 96908d1..3485c9d 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,7 @@
+2019-02-19  Gergö Barany  <ge...@codesourcery.com>
+
+	* testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90: Update.
+
 2019-01-31  Thomas Schwinge  <tho...@codesourcery.com>
 
 	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c:
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90 b/libgomp/testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90
index e8b4f3a..990a8ef 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90
@@ -6,7 +6,7 @@ subroutine kernel(lo, hi, a, b, c)
     integer :: lo, hi, i
     real, dimension(lo:hi) :: a, b, c
 
-!$acc kernels
+!$acc kernels copyin(lo, hi)
 !$acc loop independent ! { dg-warning "note: parallelized loop nest in OpenACC .kernels. construct" }
     do i = lo, hi
       b(i) = a(i)
-- 
2.8.1

Reply via email to