Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-03 Thread Steve Kargl via Fortran
On Mon, Jul 03, 2023 at 10:49:36PM +0200, Harald Anlauf via Fortran wrote: > > Indeed, this is a nice demonstration. > > While playing, I was wondering whether the following code is conforming: > > program p > call s ((1)) > contains > subroutine s (x) > integer :: x > x = 42 > end

[PATCH 5/5] OpenMP: Array shaping operator and strided "target update" for C

2023-07-03 Thread Julian Brown
Following the similar support for C++ and Fortran, here is the C implementation for the OpenMP 5.0 array-shaping operator, and for strided and rectangular updates for "target update". Much of the implementation is shared with the C++ support added earlier in this patch series. Some details of par

[PATCH 4/5] OpenMP: Noncontiguous "target update" for Fortran

2023-07-03 Thread Julian Brown
This patch implements noncontiguous "target update" for Fortran. The existing middle end/runtime bits relating to C++ support are reused, with some small adjustments, e.g.: 1. The node used to map the OMP "array descriptor" (from omp-low.cc onwards) now uses the OMP_CLAUSE_SIZE field as a b

[PATCH 2/5] OpenMP: Allow complete replacement of clause during map/to/from expansion

2023-07-03 Thread Julian Brown
At present, map/to/from clauses on OpenMP "target" directives may be expanded into several mapping nodes if they describe array sections with pointer or reference bases, or similar. This patch allows the original clause to be replaced during that expansion, mostly by passing the list pointer to th

[PATCH 0/5] [og13] OpenMP: strides, rectangular updates and array-shaping operator for "target update"

2023-07-03 Thread Julian Brown
This patch series adds support for the array-shaping operator from OpenMP 5.0, and strided and rectangular transfers for "target update" directives. The patches were previously posted for mainline here: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613785.html (C++) https://gcc.gnu.org/

[PATCH 1/5] OpenMP: Fix "exit data" for array sections for ref-to-ptr components

2023-07-03 Thread Julian Brown
This patch fixes "exit data" for (C++) reference-to-pointer struct components with array sections, such as: struct S { int *&ptr; [...] }; ... #pragma omp target exit data map(from: str->ptr, str->ptr[0:n]) Such exits need two "detach" operations. We need to unmap both the pointer and the s

Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-03 Thread Harald Anlauf via Fortran
Hi Mikael, Am 03.07.23 um 13:46 schrieb Mikael Morin: A few thing to double check below. diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index 30946ba3f63..16e8f037cfc 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc (...) @@ -6117,6 +6118,33 @@ gfc_c

Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-03 Thread Mikael Morin
Hello, Le 02/07/2023 à 22:38, Harald Anlauf via Fortran a écrit : Dear all, the attached patch fixes a long-standing issue with the order of evaluation of procedure argument expressions and deallocation of allocatable actual arguments passed to allocatable dummies with intent(out) attribute. I