Hi Thomas,

[Attached patch committed as Rev. 279217]
[One OpenMP (+OpenACC) patch and one OpenACC-only patch pending review are linked below.]

On 12/7/19 3:49 PM, Thomas Schwinge wrote:

I'm seeing:
     [-PASS:-]{+FAIL:+} libgomp.fortran/use_device_addr-3.f90   -O1  execution 
test

Whether it passed or not depended whether the stack was NULL for the local "array_arg.0" variable (which got assigned "array_arg->data" if the argument was present). Fixed by the following patch, which also fixes some more corner cases:

https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00707.html – pending Jakub's review

Except for trivial changes to libgomp/oacc-mem.c
Just because something is just a few lines of code doesn't mean that it's
trivial.  I had asked you to first resolve that issue separately
(referencing PR92726)

I vaguely remembered the this email – but couldn't find it in the thread. (This thread has 24 emails!) Turned out that you wrote tht email in a different thread – and while this patch is mainly about Fortran, your email was also not set to fortran@ (arguably, your quoted text didn't include any Fortran bits).

Pending OpenACC review the thread you mentedion: https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00062.html

--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95
@@ -0,0 +1,23 @@
+! Test that the cache directives work with optional arguments.  [...]
Missing '{ dg-do run }'.

Fixed/committed.

+! of giving a non-present argument to the cache directive is not tested as
+! it is undefined. […]
+! The effect of
+! non-present aguments in firstprivate clauses is undefined […] The effect of
+! non-present arguments in reduction clauses is undefined
Once you've got access, please file a ticket at
<https://github.com/OpenACC/openacc-spec/issues> so this gets clarified.

I will try to remember this – it's now on my to-do list.

+++ b/libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90
+! { dg-additional-options "-w" }
Why that?

No idea (was added by Kwok) – I do see warnings with "-Wall", but not with default options. (It then shows warnings like: "‘rg.25’ is used uninitialized in this function [-Wuninitialized]".)

I have now also removed this line → committed after testing that it runs through with nvptx.

Tobias

commit 6d8c93a07d3844bfcf646d3e53a8d57eb034c509
Author: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Dec 11 10:40:11 2019 +0000

    [OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments
    
            * testsuite/libgomp.oacc-fortran/optional-cache.f95: Add 'dg-do run'.
            * testsuite/libgomp.oacc-fortran/optional-reduction.f90: Remove
            unnecessary 'dg-additional-options "-w"'.
    
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@279217 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 83227032f88..14154088c95 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2019-12-11  Tobias Burnus  <tob...@codesourcery.com>
+
+	* testsuite/libgomp.oacc-fortran/optional-cache.f95: Add 'dg-do run'.
+	* testsuite/libgomp.oacc-fortran/optional-reduction.f90: Remove
+	unnecessary 'dg-additional-options "-w"'.
+
 2019-12-09  Thomas Schwinge  <tho...@codesourcery.com>
 	    Julian Brown  <jul...@codesourcery.com>
 
@@ -11109,7 +11115,7 @@
 	PR libgomp/30546
 	* configure.ac: Add check for makeinfo
 	* Makefile.am: Redefined target libgomp.info, build libgomp.info only
-	if an appropiate version of makeinfo is found.
+	if an appropriate version of makeinfo is found.
 	* aclocal.m4: Regenerated.
 	* configure: Regenerated.
 	* Makefile.in: Regenerated.
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95 b/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95
index 00f7472ae6e..0d48e2bd786 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95
@@ -1,3 +1,4 @@
+! { dg-do run }
 ! Test that the cache directives work with optional arguments.  The effect
 ! of giving a non-present argument to the cache directive is not tested as
 ! it is undefined.  The test is based on gfortran.dg/goacc/cache-1.f95.
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90 b/libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90
index b76db3ef6d3..29f92c0d4c3 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90
@@ -3,7 +3,6 @@
 ! for.  The tests are based on those in reduction-1.f90.
 
 ! { dg-do run }
-! { dg-additional-options "-w" }
 
 program optional_reduction
   implicit none

Reply via email to