Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr, addr} (+ OpenACC's use_device clause)

2020-04-29 Thread Thomas Schwinge
Hi! On 2019-11-11T13:14:43+0100, I wrote: > On 2019-11-08T16:41:23+0100, Tobias Burnus wrote: >> --- /dev/null >> +++ b/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-2.f90 > > When adding '{ dg-do run }' for torture testing (please remember to), I > see the '-O0' and '-O1' execution

Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-11 Thread Thomas Schwinge
Hi Tobias! Thanks for looking into this mess ;-) of Fortran optional arguments support for OMP, based on what Kwok has already developed. On 2019-11-08T16:41:23+0100, Tobias Burnus wrote: > --- /dev/null > +++ b/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-2.f90 When adding '{

Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-08 Thread Jakub Jelinek
On Fri, Nov 08, 2019 at 04:41:23PM +0100, Tobias Burnus wrote: > With DECL_ARTIFICIAL added and also_value replaced: > Build on x86-64-gnu-linux. OK once regtested? Almost. > - gimplify_assign (x, var, ); > + if (do_optional_check && omp_check_optional_argument (ovar, true)) Do

Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-08 Thread Tobias Burnus
Hi Jakub, thanks for the review. On 11/8/19 3:39 PM, Jakub Jelinek wrote: + /* Walk function argument list to find the hidden arg. */ + decl = DECL_ARGUMENTS (DECL_CONTEXT (decl)); + for ( ; decl != NULL_TREE; decl = TREE_CHAIN (decl)) + if (DECL_NAME (decl) == tree_name)

Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-08 Thread Jakub Jelinek
On Thu, Nov 07, 2019 at 11:42:22AM +0100, Tobias Burnus wrote: > + /* For VALUE, the scalar variable is passed as is but a hidden argument > + denotes the value. Cf. trans-expr.c. */ > + if (TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE) > +{ > + char name[GFC_MAX_SYMBOL_LEN + 2];

Re: [Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-07 Thread Tobias Burnus
Thinking about the patch over night, I have now updated it a bit: Namely, I only add the "if(present-check)" condition, if the original variable is dereferenced. There is no need for code like   omp_data_arr.c = c == NULL ? NULL : c; and then, after the libgomp call, code like "c_2 = c ==

[Patch][OpenMP][Fortran] Support absent optional args with use_device_{ptr,addr} (+ OpenACC's use_device clause)

2019-11-06 Thread Tobias Burnus
This patch is based on Kwok's patch, posted as (4/5) at https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00964.html – which is targeting OpenACC's use_device* – but it also applies to OpenMP use_device_{ptr,addr}. I added an OpenMP test case. It showed that for arguments with value attribute