[committed] Doc update: -foffload-options= examples + OpenMP in Fortran intrinsic modules

2023-06-19 Thread Tobias Burnus
Since r14-1807-g4bcb46b3ade179, using -foffload-options='-lgfortran -lm' are no longer required as they get automatically linked on the offload side, if linked on the host side. (Linking with g++ implies -lm, with gfortran '-lgfortran -lm', while an explicit 'gcc -lm -lgfortran' would also do the

Re: [PATCH] Introduce hardbool attribute for C

2023-06-19 Thread Bernhard Reutner-Fischer via Fortran
On 16 June 2023 07:35:27 CEST, Alexandre Oliva via Gcc-patches wrote: index 0..634feaed4deef --- /dev/null +++ b/gcc/testsuite/gcc.dg/hardbool-err.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typedef _Bool __attribute__ ((__hardbool__)) +hbbl; /* { dg-error

[PATCH 00/14] [og13] OpenMP/OpenACC: map clause and OMP gimplify rework

2023-06-19 Thread Julian Brown
This series (for the og13 branch) is a rebased and merged version of the first few patches of the series previously sent upstream for mainline: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/609031.html The series contains patches 1-6 and the parts of 8 ("C++ "declare mapper" support)

[PATCH 01/14] Revert "Assumed-size arrays with non-lexical data mappings"

2023-06-19 Thread Julian Brown
This reverts commit 72733f6e6f6ec1bb9884fea8bfbebd3de03d9374. 2023-06-16 Julian Brown gcc/ Revert: * gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP. * omp-low.cc (lower_omp_target): Set the size

[PATCH 03/14] Revert "Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)"

2023-06-19 Thread Julian Brown
This reverts commit a84b89b8f070f1efe86ea347e98d57e6bc32ae2d. Relevant tests are temporarily disabled or XFAILed. 2023-06-16 Julian Brown gcc/ Revert: * gimplify.cc (oacc_array_mapping_info): New struct. (gimplify_omp_ctx): Add decl_data_clause hash map. (new_o

[PATCH 05/14] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2023-06-19 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc (c_finish_omp_cla

[PATCH 02/14] Revert "Fix references declared in lexically-enclosing OpenACC data region"

2023-06-19 Thread Julian Brown
This reverts commit c9cd2bac6a5127a01c6f47e5636a926ac39b5e21. 2023-06-16 Julian Brown gcc/fortran/ Revert: * trans-openmp.cc (gfc_omp_finish_clause): Guard addition of clauses for pointers with DECL_P. gcc/ Revert: * gimplify.cc (oacc_array_mapping_info

[PATCH 04/14] Revert "openmp: Handle C/C++ array reference base-pointers in array sections"

2023-06-19 Thread Julian Brown
This reverts commit 3385743fd2fa15a2a750a29daf6d4f97f5aad0ae. 2023-06-16 Julian Brown Revert: 2022-02-24 Chung-Lin Tang gcc/c/ChangeLog: * c-typeck.cc (handle_omp_array_sections): Add handling for creating array-reference base-pointer attachment clause. gcc/cp/Cha

[PATCH 08/14] OpenMP: Pointers and member mappings

2023-06-19 Thread Julian Brown
This patch changes the mapping node arrangement used for array components of derived types, e.g.: type T integer, pointer, dimension(:) :: arrptr end type T type(T) :: tvar [...] !$omp target map(tofrom: tvar%arrptr) This will currently be mapped using three mapping nodes: GOMP_MA

[PATCH 07/14] OpenMP: implicitly map base pointer for array-section pointer components

2023-06-19 Thread Julian Brown
Following from discussion in: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570075.html and: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608100.html and also upstream OpenMP issue 342, this patch changes mapping for array sections of pointer components on compute regions li

[PATCH 09/14] OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic

2023-06-19 Thread Julian Brown
This patch adds support for non-constant component offsets in "map" clauses for OpenMP (and the equivalants for OpenACC), which are not able to be sorted into order at compile time. Normally struct accesses in such clauses are gathered together and sorted into increasing address order after a "GOM

[PATCH 11/14] OpenACC: Reimplement "inheritance" for lexically-nested offload regions

2023-06-19 Thread Julian Brown
This patch reimplements "lexical inheritance" for OpenACC offload regions inside "data" regions, allowing e.g. this to work: int *ptr; [...] #pragma acc data copyin(ptr[10:2]) { #pragma acc parallel { ... } } here, the "copyin" is mirrored on the inner "acc parallel" as "present

[PATCH 13/14] OpenACC: Allow implicit uses of assumed-size arrays in offload regions

2023-06-19 Thread Julian Brown
This patch reimplements the functionality of the previously-reverted patch "Assumed-size arrays with non-lexical data mappings". The purpose is to support implicit uses of assumed-size arrays for Fortran when those arrays have already been mapped on the target some other way (e.g. by "acc enter dat

[PATCH 10/14] OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc

2023-06-19 Thread Julian Brown
This patch has been separated out from the C++ "declare mapper" support patch. It contains just the gimplify.cc rearrangement work, mostly moving gimplification from gimplify_scan_omp_clauses to gimplify_adjust_omp_clauses for map clauses. The motivation for doing this was that we don't know if w

[PATCH 14/14] OpenACC: Improve implicit mapping for non-lexically nested offload regions

2023-06-19 Thread Julian Brown
This patch enables use of the OMP_CLAUSE_RUNTIME_IMPLICIT_P flag for OpenACC. This allows code like this to work correctly: int arr[100]; [...] #pragma acc enter data copyin(arr[20:10]) /* No explicit mapping of 'arr' here. */ #pragma acc parallel { /* use of arr[20:10]... */ } #

[PATCH 12/14] OpenACC: "declare create" fixes wrt. "allocatable" variables

2023-06-19 Thread Julian Brown
This patch fixes a case revealed by the previous patch where a synthetic "acc data" region created for a "declare create" variable could interact strangely with lexical inheritance behaviour. In fact, it doesn't seem right to create the "acc data" region for allocatable variables at all -- doing s

Re: [PATCH v5 3/5] p1689r5: initial support

2023-06-19 Thread Jason Merrill via Fortran
On 5/12/23 10:24, Ben Boeckel wrote: On Tue, Feb 14, 2023 at 16:50:27 -0500, Jason Merrill wrote: I notice that the actual flags are all -fdep-*, though some of them are -fdeps-* here, and the internal variables all seem to be fdeps_*. I lean toward harmonizing on "deps", I think. Done. I d

Re: [PATCH v6 1/4] libcpp: reject codepoints above 0x10FFFF

2023-06-19 Thread Jason Merrill via Fortran
On 6/6/23 16:50, Ben Boeckel wrote: Unicode does not support such values because they are unrepresentable in UTF-16. Pushed. libcpp/ * charset.cc: Reject encodings of codepoints above 0x10. UTF-16 does not support such codepoints and therefore all Unicode rejects

Re: [PATCH v6 0/4] P1689R5 support

2023-06-19 Thread Jason Merrill via Fortran
On 6/17/23 10:43, Ben Boeckel wrote: On Fri, Jun 16, 2023 at 23:55:53 -0400, Jason Merrill wrote: I see the same thing with patch 4 on x86_64-pc-linux-gnu, e.g. FAIL: g++.dg/modules/ben-1_a.C -std=c++17 (test for excess errors) Excess errors: /home/jason/gt/gcc/testsuite/g++.dg/modules/ben-1_a.