From patchwork Tue Sep 28 13:00:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1533888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJflf0Ck1z9sXS for ; Tue, 28 Sep 2021 23:01:33 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6CE1C3857C75 for ; Tue, 28 Sep 2021 13:01:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 88E213858408 for ; Tue, 28 Sep 2021 13:01:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88E213858408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: WJujuS7fgNps+MwGFixge+OK31WGaOJt9Mu8qOdd+SgtKAZzzWWU1QWnyVSoCM49Ij28EawhEN Cy1WD+V+XVXsSCIgRlCfWGw1DgFMmSz+m8bVZ5XEZZZRyRGHIJII9kiQK7wS1XSzKmu96/Xhud z23183Z9p6ooRwEiGpMVagEf2KSXFcTugFFKnYkH+Z8AOUgA0VBiLq4BNLt+/uZGFQDCiI60tc d0d2lw3ViH6wpLnar60aOl4HUpw7iV12u2VdHmFvIsV/F3NbUcggNH6/kMV3XjwpqVqOVZahOG BEaT/IilbCf1jd3ukSoZZDv9 X-IronPort-AV: E=Sophos;i="5.85,329,1624348800"; d="diff'?scan'208";a="66445445" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 28 Sep 2021 05:01:02 -0800 IronPort-SDR: bAO7a1mUpH5HB6C5iEF1+YURPUK1RpeUU46PhQY58SR9ez+boAXt6MjWAt8yltxAbm0QpSES/D 5CKHSMFAg74gVnipqvjlF40JVrfIEbHoFJvwPQuq5/LTTrvR7HypMEReYCWw6SMdhtPZBvjH/x 8TwfAj/THxMQ0teWw0883N4ukgfvM6kOPkMBNQhREcLnhwX/yLnmY2gYkLFbNM3lqtyuHzHrKo 9PAJ/3o1T1p8mHEDF26YLtSk+9Bm5goEKvPrhfw8slIBryiN4VkLKUxAy2Y+Evixi/+lXg7kGa rz4= To: Jakub Jelinek , gcc-patches From: Tobias Burnus Subject: [Patch] libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] Message-ID: <2936edb9-2921-0133-fa9b-247e2c43e3d3@codesourcery.com> Date: Tue, 28 Sep 2021 15:00:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Found this one lurking around in one of my trees. It does not solve the actual issue of John that hppa64-hp-hpux11.11 does not have an __int128 alias integer(kind=16) type. The latter is required for OpenMP's omp_depend_kind as per implementation choice is has to be large enough to store two pointers (2*sizeof(void*)). However, when thinking about the check again: It does not make sense to break the build if only C/C++ is enabled and Fortran disabled. While that probably has no real-world impact, I still think it makes sense to fix it. OK for mainline and GCC 11? Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] The depend type is a struct with two pointer members for C/C++ - but for Fortran OpenMP requires an integer type with kind = omp_depend_kind. Thus, libgomp's configure checks that an integer type/kind with size 2*sizeof(void*) is available. However, this integer type/kind is not needed when building without Fortran support. Thus, only check this when Fortran is enabled. libgomp/ PR libgomp/96661 * configure.ac: Only check for int-type = 2*size_t support when building with Fortran support. * configure: Regenerate. diff --git a/libgomp/configure b/libgomp/configure index 6161da579c0..4bc9b381c5c 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -17007,13 +17007,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 test $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 +if test "$ac_cv_fc_compiler_gnu" = yes; then + if test $OMP_DEPEND_KIND -eq 16; then + if test $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 fi diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 7df80a32765..bfb613b91f0 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -438,13 +438,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 test $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]) +if test "$ac_cv_fc_compiler_gnu" = yes; then + if test $OMP_DEPEND_KIND -eq 16; then + if test $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 fi