[Patch][OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments

Tobias Burnus tobias@codesourcery.com
Wed Dec 11 10:52:00 GMT 2019


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: committed.diff
Type: text/x-patch
Size: 2439 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191211/8e2dabe2/attachment.bin>


More information about the Gcc-patches mailing list