Re: [Patch][OpenMP] Fix use_device_… with absent optional arg

2019-12-05 Thread Tobias Burnus
Hi Jakub, thanks for the review – committed as Rev. 279004. On 12/5/19 12:46 PM, Jakub Jelinek wrote: On Fri, Nov 29, 2019 at 01:03:13PM +0100, Tobias Burnus wrote: --- a/gcc/fortran/trans-openmp.c + && TREE_TYPE (decl) != pvoid_type_node Is it always pvoid_type_node, or could it be

Re: [Patch][OpenMP] Fix use_device_… with absent optional arg

2019-12-05 Thread Jakub Jelinek
On Fri, Nov 29, 2019 at 01:03:13PM +0100, Tobias Burnus wrote: > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -60,7 +60,8 @@ gfc_omp_is_allocatable_or_ptr (const_tree decl) > > /* True if the argument is an optional argument; except that false is also > returned

Re: [Patch][OpenMP] Fix use_device_… with absent optional arg

2019-11-29 Thread Tobias Burnus
Revised patch after some re-considerations (and finding tons of issues with VALUE + OPTIONAL in gfortran itself). – What the patch does [all related to use_device_{addr,ptr} and 'optional' arguments]: For assumed-shape arrays, the compiler generates code like "if (arg) arg.0 = arg->data;".

[Patch][OpenMP] Fix use_device_… with absent optional arg

2019-11-21 Thread Tobias Burnus
This fixes two issues with the recently added absent-optional patch for use_device_… (a) For nonallocatable, nonpointer arrays the data component of the array descriptor is replaced by a local variable – if the argument is absent, this variable is not initialized and, unless it is NULL, a