From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id A0E3B3857C5A; Thu, 23 Jul 2020 12:42:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A0E3B3857C5A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: 0BBOT5WPVh/8SKLRB1akfNZXqvK26NeXY5vqMBQRpaZENuHVLuyqyhmYdjpIe03CcLwxWH0pBl OsmaM4uBgJaYbwwbKgheE1XQ8o5QXRWsVAzZR2kkxd7wyEHq8DBkJkj21DUKJ5AIzwgEJYiUlG fPmM8Z1j76obapz/2dp3FKyH4KFwLHWN8bJCFeHFyKLwTLXx8C/vVI3KcXmBX5cyG2LnQV1GCp Fqqd37liB9MtyZtYGxDluMIneWGYcdtwi7tjC/j9DqJuGigOocxd6gP4tUkrEkY9PqfrRFcIvr M6o= X-IronPort-AV: E=Sophos;i="5.75,386,1589270400"; d="diff'?scan'208";a="51230116" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 23 Jul 2020 04:42:30 -0800 IronPort-SDR: AOWOdCLy+PsbwReJhwzoqhk6hUGmyBVdG6QdkVSPSKf7y/ekfoU3RqdCmNLNtnqkVynHXRGpj+ UfRKFz0Of3eymMWMp6Z/vYNAmWCFfhAdS3qpxMtD2x914zqHCApMmQIuyzuMMHkVhCVfvBL17W lC74SNfeD58owbG0wlYXi3Z8p3Uzgq1ZycVhXwhBKdkamQH5pZojdg05+GeKlH4DOa8BBvhkku rzQe9ckgKSkJcVwkWlcwZI4k9Asy91QpfAKVE7gYi8IxBwpAB6ZnV75K3lKA7BDGXomGwvbFvr Cuw= To: gcc-patches , fortran , Jakub Jelinek From: Tobias Burnus Subject: [Patch] libomp: Add omp_depend_kind to omp_lib.{f90,h} Message-ID: <6615746d-4fb4-9702-8197-9efd927208b2@codesourcery.com> Date: Thu, 23 Jul 2020 14:42:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------30534BA85D01F9EE7D379144" Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 12:42:53 -0000 --------------30534BA85D01F9EE7D379144 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable As just discussed,* this patch adds omp_depend_kind to Fortran's omp_lib.{h,f90}. I fixed a problem in omp_lib.h (which as already fixed in the module version) and I added a sizeof check, which I missed when adding the other items previously. OK? Tobias * https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550517.html ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstra=C3=9Fe 201, 80634 M=C3=BCnch= en / Germany Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas = Heurung, Alexander Walter --------------30534BA85D01F9EE7D379144 Content-Type: text/x-patch; charset="UTF-8"; name="omp-dep.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="omp-dep.diff" libomp: Add omp_depend_kind to omp_lib.{f90,h} gcc/fortran/ChangeLog: * intrinsic.texi (OMP_LIB_KINDS): Add omp_depend_kind. libgomp/ChangeLog: * configure.ac: Add OMP_DEPEND_KIND and OMP_INT128_SIZE. * libgomp_f.h.in (omp_check_defines): Check whether sizeof of determined Fortran kind and C typedef match. * omp_lib.f90.in: Add omp_depened_kind. * omp_lib.h.in: Likewise; fix omp_alloctrait_key_kind. * configure: Regenerate. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. gcc/fortran/intrinsic.texi | 1 + libgomp/Makefile.in | 2 ++ libgomp/configure | 31 +++++++++++++++++++++++++++++-- libgomp/configure.ac | 14 ++++++++++++++ libgomp/libgomp_f.h.in | 7 ++++++- libgomp/omp_lib.f90.in | 1 + libgomp/omp_lib.h.in | 4 +++- libgomp/testsuite/Makefile.in | 2 ++ 8 files changed, 58 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 1b93d251509..6268feca70c 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -15317,6 +15317,7 @@ named constants: @item @code{omp_allocator_handle_kind} @item @code{omp_alloctrait_key_kind} @item @code{omp_alloctrait_val_kind} +@item @code{omp_depend_kind} @item @code{omp_lock_kind} @item @code{omp_lock_hint_kind} @item @code{omp_nest_lock_kind} diff --git a/libgomp/configure.ac b/libgomp/configure.ac index d1034dab7f8..dc840754ca1 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -396,6 +396,9 @@ for i in $config_path; do done _AC_COMPUTE_INT([sizeof (__INTPTR_TYPE__)], [INTPTR_T_KIND]) +_AC_COMPUTE_INT([sizeof (__int128)], [OMP_INT128_SIZE],,[OMP_INT128_SIZE=0]) +_AC_COMPUTE_INT([2*sizeof (__INTPTR_TYPE__)], [OMP_DEPEND_KIND],, + [OMP_DEPEND_KIND=0]) _AC_COMPUTE_INT([sizeof (omp_lock_t)], [OMP_LOCK_SIZE],, [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_t)])]) _AC_COMPUTE_INT([__alignof (omp_lock_t)], [OMP_LOCK_ALIGN]) @@ -428,6 +431,15 @@ fi if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then OMP_NEST_LOCK_25_KIND=8 fi +if test $OMP_DEPEND_KIND -eq 16; then + if $OMP_INT128_SIZE -ne 16; then + AC_MSG_ERROR([unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind]) + fi +else + if test $OMP_DEPEND_KIND -ne 8; then + AC_MSG_ERROR([unsupported system, cannot find Fortran integer kind for omp_depend_kind]) + fi +fi AC_SUBST(INTPTR_T_KIND) AC_SUBST(OMP_LOCK_SIZE) @@ -442,6 +454,8 @@ AC_SUBST(OMP_NEST_LOCK_25_SIZE) AC_SUBST(OMP_NEST_LOCK_25_ALIGN) AC_SUBST(OMP_LOCK_25_KIND) AC_SUBST(OMP_NEST_LOCK_25_KIND) +AC_SUBST(OMP_INT128_SIZE) +AC_SUBST(OMP_DEPEND_KIND) CFLAGS="$save_CFLAGS" # Determine what GCC version number to use in filesystem paths. diff --git a/libgomp/libgomp_f.h.in b/libgomp/libgomp_f.h.in index 3359352a0b4..d629503b8da 100644 --- a/libgomp/libgomp_f.h.in +++ b/libgomp/libgomp_f.h.in @@ -79,7 +79,12 @@ omp_check_defines (void) || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t) || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t) || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0) - || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0)) + || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0) + || @INTPTR_T_KIND@ != sizeof (omp_allocator_handle_t) + || 4 != sizeof (omp_alloctrait_key_t) + || @INTPTR_T_KIND@ != sizeof (omp_alloctrait_value_t) + || @INTPTR_T_KIND@ != sizeof (omp_memspace_handle_t) + || @OMP_DEPEND_KIND@ != sizeof (omp_depend_t)) ? -1 : 1] __attribute__ ((__unused__)); char test2[(@OMP_LOCK_25_SIZE@ != sizeof (omp_lock_25_t) || @OMP_LOCK_25_ALIGN@ != __alignof (omp_lock_25_t) diff --git a/libgomp/omp_lib.f90.in b/libgomp/omp_lib.f90.in index b22bcbaf770..3ec31ac1f1f 100644 --- a/libgomp/omp_lib.f90.in +++ b/libgomp/omp_lib.f90.in @@ -38,6 +38,7 @@ integer, parameter :: omp_alloctrait_key_kind = c_int integer, parameter :: omp_alloctrait_val_kind = c_intptr_t integer, parameter :: omp_memspace_handle_kind = c_intptr_t + integer, parameter :: omp_depend_kind = @OMP_DEPEND_KIND@ integer (omp_sched_kind), parameter :: omp_sched_static = 1 integer (omp_sched_kind), parameter :: omp_sched_dynamic = 2 integer (omp_sched_kind), parameter :: omp_sched_guided = 3 diff --git a/libgomp/omp_lib.h.in b/libgomp/omp_lib.h.in index c7d444d4a97..26dbe03a629 100644 --- a/libgomp/omp_lib.h.in +++ b/libgomp/omp_lib.h.in @@ -26,6 +26,8 @@ integer omp_lock_kind, omp_nest_lock_kind, openmp_version parameter (omp_lock_kind = @OMP_LOCK_KIND@) parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@) + integer omp_depend_kind + parameter (omp_depend_kind = @OMP_DEPEND_KIND@) integer omp_sched_kind parameter (omp_sched_kind = 4) integer (omp_sched_kind) omp_sched_static, omp_sched_dynamic @@ -81,7 +83,7 @@ integer omp_allocator_handle_kind, omp_alloctrait_key_kind integer omp_alloctrait_val_kind, omp_memspace_handle_kind parameter (omp_allocator_handle_kind = @INTPTR_T_KIND@) - parameter (omp_alloctrait_key_kind = @INTPTR_T_KIND@) + parameter (omp_alloctrait_key_kind = 4) parameter (omp_alloctrait_val_kind = @INTPTR_T_KIND@) parameter (omp_memspace_handle_kind = @INTPTR_T_KIND@) integer (omp_alloctrait_key_kind) omp_atk_sync_hint diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index bc044b1820a..38d44983d7e 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -421,6 +421,8 @@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OMP_DEPEND_KIND = @OMP_DEPEND_KIND@ +OMP_INT128_SIZE = @OMP_INT128_SIZE@ OMP_LOCK_25_ALIGN = @OMP_LOCK_25_ALIGN@ OMP_LOCK_25_KIND = @OMP_LOCK_25_KIND@ OMP_LOCK_25_SIZE = @OMP_LOCK_25_SIZE@ diff --git a/libgomp/configure b/libgomp/configure index d85023f4f05..e9746d8dafb 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -635,6 +635,8 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS get_gcc_base_ver +OMP_DEPEND_KIND +OMP_INT128_SIZE OMP_NEST_LOCK_25_KIND OMP_LOCK_25_KIND OMP_NEST_LOCK_25_ALIGN @@ -11434,7 +11436,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11437 "configure" +#line 11439 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11540,7 +11542,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11543 "configure" +#line 11545 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16968,6 +16970,20 @@ if ac_fn_c_compute_int "$LINENO" "sizeof (__INTPTR_TYPE__)" "INTPTR_T_KIND" fi +if ac_fn_c_compute_int "$LINENO" "sizeof (__int128)" "OMP_INT128_SIZE" ""; then : + +else + OMP_INT128_SIZE=0 +fi + + +if ac_fn_c_compute_int "$LINENO" "2*sizeof (__INTPTR_TYPE__)" "OMP_DEPEND_KIND" ""; then : + +else + OMP_DEPEND_KIND=0 +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (omp_lock_t)" "OMP_LOCK_SIZE" ""; then : else @@ -17034,6 +17050,17 @@ fi if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then OMP_NEST_LOCK_25_KIND=8 fi +if test $OMP_DEPEND_KIND -eq 16; then + if $OMP_INT128_SIZE -ne 16; then + as_fn_error $? "unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind" "$LINENO" 5 + fi +else + if test $OMP_DEPEND_KIND -ne 8; then + as_fn_error $? "unsupported system, cannot find Fortran integer kind for omp_depend_kind" "$LINENO" 5 + fi +fi + + diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in index bbec6aeca00..ff9149e7030 100644 --- a/libgomp/testsuite/Makefile.in +++ b/libgomp/testsuite/Makefile.in @@ -186,6 +186,8 @@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OMP_DEPEND_KIND = @OMP_DEPEND_KIND@ +OMP_INT128_SIZE = @OMP_INT128_SIZE@ OMP_LOCK_25_ALIGN = @OMP_LOCK_25_ALIGN@ OMP_LOCK_25_KIND = @OMP_LOCK_25_KIND@ OMP_LOCK_25_SIZE = @OMP_LOCK_25_SIZE@ --------------30534BA85D01F9EE7D379144--