]> git.ipfire.org Git - people/ms/gcc.git/commit
Allow optional arguments to be used in the use_device OpenACC clause
authorKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 31 Jan 2019 16:00:16 +0000 (08:00 -0800)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:15:32 +0000 (12:15 +0100)
commita0a5fe7aada4e39f5cb8cdb45e57cfda0f56f8c1
treec6372ab2a60ff6a927a45a2845f404f81ad5e226
parentc6afc44abf6e045d737d600f6334ff6cae9f6033
Allow optional arguments to be used in the use_device OpenACC clause

Optional arguments should be treated as references rather than pointers
in the lowering.  However, for non-present arguments, this would result
in a null dereference, so conditionals need to be added to detect and
handle this.

gcc/
* omp-low.c (lower_omp_target): For use_device clauses, generate
conditional statements to treat Fortran optional arguments like
references if non-null, or propogate null arguments into offloaded
code otherwise.

Reviewed-by: Julian Brown <julian@codesourcery.com>
(cherry picked from openacc-gcc-9-branch commit
4fba24cfbbd3738216a3551483744f82888741f3)
gcc/ChangeLog.omp
gcc/omp-low.c