Re: [Patch] Fortran: Fix gfc_conv_gfc_desc_to_cfi_desc with NULL [PR104126]

2022-03-08 Thread Tobias Burnus
Hi Harald, On 08.03.22 22:44, Harald Anlauf wrote: Am 07.03.22 um 15:16 schrieb Tobias Burnus: Pre-remark: Related NULL, there some accepts-invalid issues, not addressed in this patch. See https://gcc.gnu.org/PR104819 This patch fixes an ICE (12 regression) with NULL() that has no MOLD argumen

Re: [Patch] Fortran: Fix gfc_maybe_dereference_var [PR104430]

2022-03-08 Thread Harald Anlauf via Fortran
Hi Tobias, Am 08.03.22 um 21:19 schrieb Tobias Burnus: PS: Can I make you review my two pending patches? (NULL and SIZEOF) ;-) I just approved the former one, but rather hope that Paul or Mikael or somebody else would jump in on the other one. PPS: I lost a bit track working on other things

Re: [Patch] Fortran: Fix gfc_conv_gfc_desc_to_cfi_desc with NULL [PR104126]

2022-03-08 Thread Harald Anlauf via Fortran
Hi Tobias, Am 07.03.22 um 15:16 schrieb Tobias Burnus: Pre-remark: Related NULL, there some accepts-invalid issues, not addressed in this patch. See https://gcc.gnu.org/PR104819 This patch fixes an ICE (12 regression) with NULL() that has no MOLD argument. the patch does fix the ICE. But giv

[PATCH, committed] PR fortran/104811 - maxloc/minloc cannot accept character arguments without `dim` optional argument

2022-03-08 Thread Harald Anlauf via Fortran
Dear all, frontend-optimization of MINLOC/MAXLOC tries to generate code for rank-1 arrays that may be expanded inline later and optimzed. Except when the argument is a character array... As there is even a comment in trans-intrinsic.cc that we will call a library function for character arguments

Re: [Patch] Fortran: Fix gfc_maybe_dereference_var [PR104430]

2022-03-08 Thread Tobias Burnus
Hi Harald, On 07.03.22 20:58, Harald Anlauf wrote: I think there are other PRs which profit from this fix. Can you please have a look at PR99585, and in particular the link in comment#0? ;-) Good pointer – the testcase looks nearly identical and it is indeed fixed. I included it in addition

[Patch] Fortran: Fix CLASS handling in SIZEOF intrinsic

2022-03-08 Thread Tobias Burnus
Fix SIZEOF handling. I have to admit that I do understand what the current code does, but do not understand what the previous code did. However, it still passes the testsuite - and also some code which did ICE now compiles :-) While writing the testcase, I did find two issues: * Passing a CLASS

[Patch] Fortran: OpenMP/OpenACC avoid uninit access in size calc for mapping

2022-03-08 Thread Tobias Burnus
Hi Thomas & Jakub, found when working on the deep-mapping patch* with OpenMP code (and part of that patch) but it already shows up in an existing OpenACC testcase. I think it makes sense to fix it already for GCC 12. Problem: Also for unallocated allocatables, their size was calculated - the 'if

[PATCH 5/5] openmp: -foffload-memory=pinned

2022-03-08 Thread Hafiz Abid Qadeer
From: Andrew Stubbs Implement the -foffload-memory=pinned option such that libgomp is instructed to enable fully-pinned memory at start-up. The option is intended to provide a performance boost to certain offload programs without modifying the code. This feature only works on Linux, at present,

[PATCH 4/5] openmp: Use libgomp memory allocation functions with unified shared memory.

2022-03-08 Thread Hafiz Abid Qadeer
This patches changes calls to malloc/free/calloc/realloc and operator new to memory allocation functions in libgomp with allocator=ompx_unified_shared_mem_alloc. This helps existing code to benefit from the unified shared memory. The libgomp does the correct thing with all the mapping constructs

[PATCH 3/5] openmp, nvptx: ompx_unified_shared_mem_alloc

2022-03-08 Thread Hafiz Abid Qadeer
From: Andrew Stubbs This adds support for using Cuda Managed Memory with omp_alloc. It will be used as the underpinnings for "requires unified_shared_memory" in a later patch. There are two new predefined allocators, ompx_unified_shared_mem_alloc and ompx_host_mem_alloc, plus corresponding memo

[PATCH 2/5] openmp: allow requires unified_shared_memory

2022-03-08 Thread Hafiz Abid Qadeer
From: Andrew Stubbs This is the front-end portion of the Unified Shared Memory implementation. It removes the "sorry, unimplemented message" in C, C++, and Fortran, and sets flag_offload_memory, but is otherwise inactive, for now. It also checks that -foffload-memory isn't set to an incompatible

[PATCH 1/5] openmp: Add -foffload-memory

2022-03-08 Thread Hafiz Abid Qadeer
From: Andrew Stubbs Add a new option. It will be used in follow-up patches. gcc/ChangeLog: * common.opt: Add -foffload-memory and its enum values. * coretypes.h (enum offload_memory): New. * doc/invoke.texi: Document -foffload-memory. --- gcc/common.opt | 16 +

[PATCH 0/5] openmp: Handle pinned and unified shared memory.

2022-03-08 Thread Hafiz Abid Qadeer
This patch series add support for unified shared memory (USM) and pinned memory. The support in libgomp is for nvptx offloading only. A new command line option -foffload-memory allows user to choose either USM or pinned memory. The USM can also be enabled using requires construct. When USM us in