From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id A61C93858CDA; Mon, 11 Dec 2023 22:12:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A61C93858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A61C93858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702332753; cv=none; b=peiMtcof6Km2+47Guenf02x8nCpvKpkVNe3x5O1kvT2wGPH6LZc8ekzoIgTALC0momUdOF95cLROQoP1zq+WvBVMG7Mn3kZbFJNplBnoXCpAZKT2t093RFigt+y+x1OqcS/ry+oC/a3RCcRmHWc00Bzrs/FVYJR0nLlM7eCxKDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702332753; c=relaxed/simple; bh=QaiaftL7TOygfR6+1vcfm1sIX3tfcxZEMzNrYXPlO4I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=T3EKKTc0gZkozcg5Wxj2aLofSirZR3x932Lbi6V28DWp6RTCtBPquMmv23oTV0GEn12uCTaxC+ohiD1TuVtv5Suzdfb9wFCI2dAFA6hh/JH3nevVWbjaveBcF7WZ8mSZD6uaqcoMaSwjl4XQnQydkfl+uVPoyhpSR4VFaDHADCc= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: yJBByCksRpGo8w/VZ0d5Eg== X-CSE-MsgGUID: OxwlAB+eS3G9FD2GxnHRCg== X-IronPort-AV: E=Sophos;i="6.04,268,1695715200"; d="scan'208,223";a="25005919" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 11 Dec 2023 14:12:28 -0800 IronPort-SDR: e1HL7cEHBejRTmsU1XKYIGp49SzgbG+QZY9FBhwsWYu97NHxJ+/C54ImrEStLlanE6sRHB4+dK M5lntYuh33VNdxUgpEKFbTjmSznO5Vsbpn9cM4iENzI2h11NNE4a1XPKIuPmmdOwBc+0kfO1c8 jXCxwuoL5QIQTaijb4+PXvkKCmOLTwofuOYgT/InLqp1A2wYw9SEz9PqbPdc75DVLUkb10iQoH CMheHh/i9q+IoJDMeStsxjEOg1FMSjsqs7bgJb6RJaSncJN52n1V8mVHwVv3wriq50U7PHkYsm m7g= From: Thomas Schwinge To: Tobias Burnus , , CC: Jakub Jelinek , Andrew MacLeod Subject: Re: [Patch] OpenMP: Minor '!$omp allocators' cleanup - and still: Re: [patch] OpenMP/Fortran: Implement omp allocators/allocate for ptr/allocatables In-Reply-To: <16bc2d0c-7228-43f8-803b-74a980510370@codesourcery.com> References: <60940754-edc6-4110-b7ba-5bed2133bbb6@codesourcery.com> <87fs0bsjwx.fsf@euler.schwinge.homeip.net> <16bc2d0c-7228-43f8-803b-74a980510370@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Mon, 11 Dec 2023 23:12:22 +0100 Message-ID: <878r60s81l.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,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: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! This issue would've been prevented if we'd actually use a distinct C++ data type for GCC types, checkable at compile time -- I'm thus CCing Andrew MacLeod for amusement or crying, "one more for the list!". ;-\ (See "[TTYPE] Strongly typed tree project. Original document circa 2017".) On 2023-12-11T12:45:27+0100, Tobias Burnus wrote: > I included a minor cleanup patch [...] > > I intent to commit that patch as obvious, unless there are further commen= ts. > OpenMP: Minor '!$omp allocators' cleanup > --- a/gcc/fortran/trans-openmp.cc > +++ b/gcc/fortran/trans-openmp.cc > @@ -8361,8 +8361,10 @@ gfc_omp_call_add_alloc (tree ptr) > if (fn =3D=3D NULL_TREE) > { > fn =3D build_function_type_list (void_type_node, ptr_type_node, NU= LL_TREE); > + tree att =3D build_tree_list (NULL_TREE, build_string (4, ". R "))= ; > + att =3D tree_cons (get_identifier ("fn spec"), att, TYPE_ATTRIBUTE= S (fn)); > + fn =3D build_type_attribute_variant (fn, att); > fn =3D build_fn_decl ("GOMP_add_alloc", fn); > -/* FIXME: attributes. */ > } > return build_call_expr_loc (input_location, fn, 1, ptr); > } > @@ -8380,7 +8382,9 @@ gfc_omp_call_is_alloc (tree ptr) > fn =3D build_function_type_list (boolean_type_node, ptr_type_node, > NULL_TREE); > fn =3D build_fn_decl ("GOMP_is_alloc", fn); > -/* FIXME: attributes. */ > + tree att =3D build_tree_list (NULL_TREE, build_string (4, ". R "))= ; > + att =3D tree_cons (get_identifier ("fn spec"), att, TYPE_ATTRIBUTE= S (fn)); > + fn =3D build_type_attribute_variant (fn, att); > } > return build_call_expr_loc (input_location, fn, 1, ptr); > } Pushed to master branch commit 453e0f45a49f425992bc47ff8909ed8affc29d2e "Resolve ICE in 'gcc/fortran/trans-openmp.cc:gfc_omp_call_is_alloc'", see attached. Gr=C3=BC=C3=9Fe Thomas ----------------- 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Resolve-ICE-in-gcc-fortran-trans-openmp.cc-gfc_omp_c.patch" >From 453e0f45a49f425992bc47ff8909ed8affc29d2e Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Dec 2023 22:52:54 +0100 Subject: [PATCH] Resolve ICE in 'gcc/fortran/trans-openmp.cc:gfc_omp_call_is_alloc' Fix-up for recent commit 2505a8b41d3b74a545755a278f3750a29c1340b6 "OpenMP: Minor '!$omp allocators' cleanup", which caused: {+FAIL: gfortran.dg/gomp/allocate-5.f90 -O (internal compiler error: tree check: expected class 'type', have 'declaration' (function_decl) in gfc_omp_call_is_alloc, at fortran/trans-openmp.cc:8386)+} [-PASS:-]{+FAIL:+} gfortran.dg/gomp/allocate-5.f90 -O (test for excess errors) ..., and similarly in 'libgomp.fortran/allocators-1.f90', 'libgomp.fortran/allocators-2.f90', 'libgomp.fortran/allocators-3.f90', 'libgomp.fortran/allocators-4.f90', 'libgomp.fortran/allocators-5.f90'. gcc/fortran/ * trans-openmp.cc (gfc_omp_call_is_alloc): Resolve ICE. --- gcc/fortran/trans-openmp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc index 95184920cf7..f7c73a5d273 100644 --- a/gcc/fortran/trans-openmp.cc +++ b/gcc/fortran/trans-openmp.cc @@ -8381,10 +8381,10 @@ gfc_omp_call_is_alloc (tree ptr) { fn = build_function_type_list (boolean_type_node, ptr_type_node, NULL_TREE); - fn = build_fn_decl ("GOMP_is_alloc", fn); tree att = build_tree_list (NULL_TREE, build_string (4, ". R ")); att = tree_cons (get_identifier ("fn spec"), att, TYPE_ATTRIBUTES (fn)); fn = build_type_attribute_variant (fn, att); + fn = build_fn_decl ("GOMP_is_alloc", fn); } return build_call_expr_loc (input_location, fn, 1, ptr); } -- 2.34.1 --=-=-=--