From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 995793858C31 for ; Sat, 9 Dec 2023 15:14:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 995793858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 995793858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702134893; cv=none; b=vBwmH4319iUUXjK0P6jKH0QDCMt9tUSlraehct15BNRNKVdrQ/bzY22aYfcs5jmrvLBrl8DnBDQ4juzP5iPb1j8ApFX5ArEvet9RFlKwAzViKOugeiBmZ1ozxhPvfMb1wi2JSJG4//O6NKqqoyd5bItBxtMRC1oKt1TLFtDE878= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702134893; c=relaxed/simple; bh=lhyPrFokBvUGUmdKp6teY0KvbV1Vf5qnLfTHs8x1EPA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=kCkSIRU11IvxT8ajA+3QniZAstJIaAcpgMGTwkWkGWGKdk5ZptJNa4Abaq9b5ThkKyeOY2eaQtwkBo81prHqqCcIBmg1tFHURI8fOvyqqzdlym1y310Uz1H4QE2WfUhafbxTWrh3TU30EzpLWmaI/c4D6vJomP1zgCgLm+LiSNw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702134892; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=7L8lwrCQPFViXPGs7US6fmVR/+APtjwOvYmsnx6TaSM=; b=K/vAHFT8Ua7xg26y9Fcx9KWZMwIbzmcA/nLEq1daAO/bb6pSPmKysW84L3c5g+bnWHnVNa v+gjIlM0k7VeBgE2ep9brJmMBAC163XYBYNnDjtXd1TcTLHeKalC1k5j0HZmwc8Q368OeV +BlAj02rkeAMDdbB/lLchrcmyvBrRV4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-khi2yQaFPfGqDorX1j8rhA-1; Sat, 09 Dec 2023 10:14:48 -0500 X-MC-Unique: khi2yQaFPfGqDorX1j8rhA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1468385A589; Sat, 9 Dec 2023 15:14:48 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB048111E404; Sat, 9 Dec 2023 15:14:47 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3B9FEj0d1461239 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 9 Dec 2023 16:14:45 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B9FEitp1461238; Sat, 9 Dec 2023 16:14:44 +0100 Date: Sat, 9 Dec 2023 16:14:44 +0100 From: Jakub Jelinek To: Thomas Schwinge Cc: Tobias Burnus , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [patch] OpenMP/Fortran: Implement omp allocators/allocate for ptr/allocatables Message-ID: Reply-To: Jakub Jelinek References: <60940754-edc6-4110-b7ba-5bed2133bbb6@codesourcery.com> <87fs0bsjwx.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 In-Reply-To: <87fs0bsjwx.fsf@euler.schwinge.homeip.net> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Dec 09, 2023 at 12:19:10PM +0100, Thomas Schwinge wrote: > > --- a/gcc/omp-builtins.def > > +++ b/gcc/omp-builtins.def > > @@ -467,6 +467,9 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_WORKSHARE_TASK_REDUCTION_UNREGISTER, > > DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ALLOC, > > "GOMP_alloc", BT_FN_PTR_SIZE_SIZE_PTRMODE, > > ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LIST) > > +DEF_GOMP_BUILTIN (BUILT_IN_GOMP_REALLOC, > > + "omp_realloc", BT_FN_PTR_PTR_SIZE_PTRMODE_PTRMODE, > > + ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LEAF_LIST) > > DEF_GOMP_BUILTIN (BUILT_IN_GOMP_FREE, > > "GOMP_free", BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST) > > DEF_GOMP_BUILTIN (BUILT_IN_GOMP_WARNING, "GOMP_warning", > > Should this either be 'BUILT_IN_OMP_REALLOC' ('OMP' instead of 'GOMP'), > or otherwise a 'GOMP_realloc' be added to 'libgomp/allocator.c', like for > 'GOMP_alloc', 'GOMP_free'; 'ialias_call'ing the respective 'omp_[...]' > functions? (Verbatim 'omp_realloc' also mentioned in the comment before > 'gcc/fortran/trans-openmp.cc:gfc_omp_call_is_alloc'.) There were 3 reasons to add GOMP_alloc (and 1 for GOMP_free): 1) when it was added, omp_aligned_alloc was still not exported from the library because we thought we shouldn't expose 5.1 features until we have 5.0 implemented (then changed mind) 2) unline omp_aligned_alloc, GOMP_alloc issues fatal error on allocation failure 3) the omp_* functions have omp_allocator_handle_t arguments, which is hard to provide for builtins (I think this is the only reason for GOMP_free addition, maybe together with wanting those to be paired) Now, 1) is a non-issue anymore, I don't know what Fortran wants for allocation failures, if it is better to have diagnostics on the libgomp side or if wants to emit it inline. And yes, 3) would be an argument to add GOMP_realloc. Jakub