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 B47B53858017 for ; Wed, 6 Jul 2022 13:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B47B53858017 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.92,250,1650960000"; d="scan'208";a="78388063" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 06 Jul 2022 05:31:10 -0800 IronPort-SDR: BZlRKLTS3cXjZZQqtYxlKnFIC/Z2cPfSxGDYbGRUZZ1M55hR0/VIJAFCzi77BvCqe0edcOL62f LytViLfv8a7nw6YScb9ufZJWRATHJirJPWhpSWDlA/ikzW3yfjQYLO0zLD+AqioEb1tpRnPCmo ns4JT77pRsBi1BdgLty/LLjLA9F6Smk95T2dZ5+lU7PGzRvFOOsigQ0hpJJq4k6LcastK2iWI4 yvzqPQ+4SqCkwecir9gQ7G0crAEHkG/jh2l1rAcHtQ7+nkFK056U5uO5OlrizQRTe9YdaDRFtI pgM= Message-ID: <1116448f-eb76-76b3-8aaf-a0e44330c161@codesourcery.com> Date: Wed, 6 Jul 2022 15:30:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Fix Intel MIC 'mkoffload' for OpenMP 'requires' (was: [Patch] OpenMP: Move omp requires checks to libgomp) Content-Language: en-US To: Thomas Schwinge CC: , Jakub Jelinek References: <07fec82a-41cf-fdc5-6307-c068dd95ef1a@mentor.com> <87r12y4i3u.fsf@euler.schwinge.homeip.net> <0d0b2fcf-6357-f896-dcd9-99b3d81acd21@codesourcery.com> <87mtdml8ks.fsf@dem-tschwing-1.ger.mentorg.com> From: Tobias Burnus In-Reply-To: <87mtdml8ks.fsf@dem-tschwing-1.ger.mentorg.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Wed, 06 Jul 2022 13:31:14 -0000 Hi Thomas, On 06.07.22 14:38, Thomas Schwinge wrote: > :-) Haha, that's actually *exactly* what I had implemented first! But > then I realized that 'target offloading_enabled' is doing exactly that: > check that offloading compilation is configured -- not that "there is an > offloading device available or not" as you seem to understand? Or am I > confused there? I think as you mentioned below =E2=80=93 there is a difference. And that di= fference, I explicitly maked use of: - libgomp.c-c++-common/requires-{1,5,7}.c test the device lto1 compiler, which requires that it is actually available. Thus, I used: /* { dg-do link { target { offload_target_nvptx || offload_target_amdgc= n } } } */ while - libgomp.c-c++-common/requires-2.c checks that ENABLE_OFFLOADING =3D=3D = true, i.e. the host lto1 compiler is configured to create the offload tables and, = thus, can diagnose the omp-requires mismatch. Hence, the testcase has: /* { dg-do link { target offloading_enabled } } */ /* { dg-additional-options "-foffload=3Ddisable -flto" } */ Granted, as the other files do not use -foffload=3D..., it should not make a difference - but, still, replacing it unconditionally with 'target offloading_enabled' feels wrong. I was about to write again about --enable-offload-defaulted and having no offloading compilers installed. But that comes too late. gcc.cc (the driver) will set OFFLOAD_TARGET_NAMES=3D to the configured offload-target compilers (after -foffload=3D filtering), but the is-available check is only done in lto-wrapper.cc, which comes too late. But I admit it is unlikely that someone configures + builds offload compilers and, then, for testing have no offload compilers available. > I do however agree that (generally) replacing 'target offloading_enabled' > with a new 'target offload_target_any' would seem appropriate (as a > separate patch), because that would also do the right thing when running > libgomp testing with non-default '-foffload=3D[...]', including > '-foffload=3Ddisable'. I concur =E2=80=93 but I would prefer to have that lib/libgomp.exp patch co= mmitted before the testsuite-part of this patch is committed. Albeit, I do not feel very strong about this. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955