From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 9C83B3858D28; Tue, 27 Jun 2023 10:30:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C83B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b7e94912daso12208005ad.3; Tue, 27 Jun 2023 03:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687861854; x=1690453854; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tob+Ehuxpnd5mOcoprGwz7HFAz8J5L9nlos5upR+nJY=; b=INccHheV4q4whMctPK8CSsSiCuh8Y42CLB3Hm8b88GmPd0+xxAmy0Eyu4tKBGjmZxz PteW5cuaernvmxxVhxPExzZMyzrqURWaODhrSVk1Q7tfupVaRHrR3aYtrwCWhjF0kx2m 2SZAXKcG7kmQl1ifbbSTyj2TJZq0sIbe8awSuNa1tmVKM2UMFlH7x6KWy/DCDn1BbqNq RIgockBNoPpsd5I3y86ZfaitZ/GihYHJmnuNi27C72bPnMnlBh+2pMYhnEufUCSiGt7E wurdnh/vH1HNFn0lICpkM7SU2n3dt8uVyPj8zGzLduVi1M4osEtI8T5G//VUWf/T9GLo /ZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687861854; x=1690453854; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tob+Ehuxpnd5mOcoprGwz7HFAz8J5L9nlos5upR+nJY=; b=XhC3PLe+/ikbZYoghR37JCSmPnEUN1oEV3StZCuk1pNNIE7Os7YmoLoC2btdgPrDGW uQyESBVXF+dAP572U+aEp7sLQYU9arQBEzI4qc07p6ffsfwtc0crlm63J5k08lW/fW/9 E/5rwbGESoSWVf4oJRwMuOLSgIt06EpcJBobqfa9Dx6AsLzcfPvewZPb3ydvyR03l1A2 iDy2dBya7tfDWqITG7rzPRoL88eTu0o6UxM8F/KiRmojsg+2s1ldpBV21Tsy5erJIGU2 QPQgJhL3453XzeKaWwxsVZoNc8tGTL6huBD0Fr6Ej1qkN/tnFfmG49Pb2ArmZifZc+IH s0bw== X-Gm-Message-State: AC+VfDxtotMuBX2SaZEvAqVbS+nQMYEZJNfTQe7uFuX3OLdjRxd3+IZU PPW+gvOn8rceQHYN3ZhOi20t+soKYCsar7Hnx7yb5hhvtnE= X-Google-Smtp-Source: ACHHUZ5lxDbmGCoImcUjnnK9R01ArCwPY8rAgsQ6p/C/kT5XJi0c+ItKawX/oYF/oO1haesh0r0K3sjT/gERDOqmIdY= X-Received: by 2002:a17:90a:f815:b0:262:df91:cdce with SMTP id ij21-20020a17090af81500b00262df91cdcemr4802984pjb.23.1687861854264; Tue, 27 Jun 2023 03:30:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Tue, 27 Jun 2023 11:30:43 +0100 Message-ID: Subject: Re: [Patch, fortran] PR49213 - [OOP] gfortran rejects structure constructor expression To: Harald Anlauf Cc: "fortran@gcc.gnu.org" , gcc-patches Content-Type: multipart/mixed; boundary="00000000000040ffc105ff19f6a6" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: --00000000000040ffc105ff19f6a6 Content-Type: text/plain; charset="UTF-8" Hi Harald, Let's try again :-) OK for trunk? Regards Paul Fortran: Enable class expressions in structure constructors [PR49213] 2023-06-27 Paul Thomas gcc/fortran PR fortran/49213 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer. * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow associate names with pointer function targets to be used in variable definition context. * trans-decl.cc (get_symbol_decl): Remove extraneous line. * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain size of intrinsic and character expressions. (gfc_trans_subcomponent_assign): Expand assignment to class components to include intrinsic and character expressions. gcc/testsuite/ PR fortran/49213 * gfortran.dg/pr49213.f90 : New test On Sat, 24 Jun 2023 at 20:50, Harald Anlauf wrote: > > Hi Paul! > > On 6/24/23 15:18, Paul Richard Thomas via Gcc-patches wrote: > > I have included the adjustment to 'gfc_is_ptr_fcn' and eliminating the > > extra blank line, introduced by my last patch. I played safe and went > > exclusively for class functions with attr.class_pointer set on the > > grounds that these have had all the accoutrements checked and built > > (ie. class_ok). I am still not sure if this is necessary or not. > > maybe it is my fault, but I find the version in the patch confusing: > > @@ -816,7 +816,7 @@ bool > gfc_is_ptr_fcn (gfc_expr *e) > { > return e != NULL && e->expr_type == EXPR_FUNCTION > - && (gfc_expr_attr (e).pointer > + && ((e->ts.type != BT_CLASS && gfc_expr_attr (e).pointer) > || (e->ts.type == BT_CLASS > && CLASS_DATA (e)->attr.class_pointer)); > } > > The caller 'gfc_is_ptr_fcn' has e->expr_type == EXPR_FUNCTION, so > gfc_expr_attr (e) boils down to: > > if (e->value.function.esym && e->value.function.esym->result) > { > gfc_symbol *sym = e->value.function.esym->result; > attr = sym->attr; > if (sym->ts.type == BT_CLASS && sym->attr.class_ok) > { > attr.dimension = CLASS_DATA (sym)->attr.dimension; > attr.pointer = CLASS_DATA (sym)->attr.class_pointer; > attr.allocatable = CLASS_DATA (sym)->attr.allocatable; > } > } > ... > else if (e->symtree) > attr = gfc_variable_attr (e, NULL); > > So I thought this should already do what you want if you do > > gfc_is_ptr_fcn (gfc_expr *e) > { > return e != NULL && e->expr_type == EXPR_FUNCTION && gfc_expr_attr > (e).pointer; > } > > or what am I missing? The additional checks in gfc_expr_attr are > there to avoid ICEs in case CLASS_DATA (sym) has issues, and we all > know Gerhard who showed that he is an expert in exploiting this. > > To sum up, I'd prefer to use the safer form if it works. If it > doesn't, I would expect a latent issue. > > The rest of the code looked good to me, but I was suspicious about > the handling of CHARACTER. > > Nasty as I am, I modified the testcase to use character(kind=4) > instead of kind=1 (see attached). This either fails here (stop 10), > or if I activate the marked line > > ! cont = tContainer('hello!') ! ### ICE! ### > > I get an ICE. > > Can you have another look? > > Thanks, > Harald > > > > > > OK for trunk? > > > > Paul > > > > Fortran: Enable class expressions in structure constructors [PR49213] > > > > 2023-06-24 Paul Thomas > > > > gcc/fortran > > PR fortran/49213 > > * expr.cc (gfc_is_ptr_fcn): Guard pointer attribute to exclude > > class expressions. > > * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow > > associate names with pointer function targets to be used in > > variable definition context. > > * trans-decl.cc (get_symbol_decl): Remove extraneous line. > > * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain > > size of intrinsic and character expressions. > > (gfc_trans_subcomponent_assign): Expand assignment to class > > components to include intrinsic and character expressions. > > > > gcc/testsuite/ > > PR fortran/49213 > > * gfortran.dg/pr49213.f90 : New test -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein --00000000000040ffc105ff19f6a6 Content-Type: text/x-fortran; charset="US-ASCII"; name="pr49213.f90" Content-Disposition: attachment; filename="pr49213.f90" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lje5bu3a0 ISB7IGRnLWRvIHJ1biB9CiEKISBDb250cmlidXRlZCBieSBOZWlsIENhcmxzb24gIDxuZWlsLm4u Y2FybHNvbkBnbWFpbC5jb20+CiEKcHJvZ3JhbSBtYWluCiAgY2hhcmFjdGVyKDIpID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ogICAgICAgIGMgPSAiUzIiCiAgICAgICAgaWYgKCh4JW4g Lm5lLiAxKSAub3IuICh4JW0gLm5lLiAyKSkgc3RvcCA2CiAgICAgIGNsYXNzIGRlZmF1bHQKICAg ICAgICBzdG9wIDcKICAgIGVuZCBzZWxlY3QKICBlbmQgc3Vicm91dGluZQoKICBzdWJyb3V0aW5l IGNoZWNrX2l0ICh0LCBlcnJubykKICAgIHR5cGUodENvbnRhaW5lcikgIDo6IHQKICAgIGludGVn ZXIgOjogZXJybm8KICAgIHNlbGVjdCB0eXBlICh4ID0+IHQleCkKICAgICAgdHlwZSBpcyAoaW50 ZWdlcikKICAgICAgICBpZiAoeCAubmUuIDQyKSBzdG9wIGVycm5vCiAgICAgIHR5cGUgaXMgKGlu dGVnZXIoOCkpCiAgICAgICAgaWYgKHggLm5lLiA0Ml84KSBzdG9wIGVycm5vCiAgICAgIHR5cGUg aXMgKHJlYWwoOCkpCiAgICAgICAgaWYgKGludCh4KioyKSAubmUuIDIpIHN0b3AgZXJybm8KICAg ICAgdHlwZSBpcyAoY2hhcmFjdGVyKCosIGtpbmQ9MSkpCiAgICAgICAgaWYgKHggLm5lLiAiZW5k IG9mIHRlc3RzIikgc3RvcCBlcnJubwogICAgICB0eXBlIGlzIChjaGFyYWN0ZXIoKiwga2luZD00 KSkKICAgICAgICBpZiAoKHggLm5lLiA0XyJoZWxsbyEiKSAuYW5kLiAoeCAubmUuIDRfImdvb2Ri eWUiKSkgc3RvcCBlcnJubwogICAgICAgY2xhc3MgZGVmYXVsdAogICAgICAgIHN0b3AgZXJybm8K ICAgIGVuZCBzZWxlY3QKICBlbmQgc3Vicm91dGluZQoKICBzdWJyb3V0aW5lIGJhcgogICAhIFRl c3QgZnJvbSBjb21tZW50ICMyOSBleHRlbmRlZCBieSBIYXJhbGQgQW5sYXVmIHRvIGNoZWNrIGtp bmRzIC89IGRlZmF1bHQKICAgIGludGVnZXIoOCksIHBhcmFtZXRlciA6OiBpID0gMF84CiAgICBp bnRlZ2VyIDo6IGogPSA0MgogICAgY2hhcmFjdGVyKDcsa2luZD00KSA6OiBjaHI0ID0gNF8iZ29v ZGJ5ZSIKICAgIHR5cGUodENvbnRhaW5lcikgOjogY29udAoKICAgIGNvbnQleCA9IGoKICAgIGNh bGwgY2hlY2tfaXQgKGNvbnQsIDgpCgogICAgY29udCA9IHRDb250YWluZXIoaSs0Ml84KQogICAg Y2FsbCBjaGVja19pdCAoY29udCwgOSkKCiAgICBjb250ID0gdENvbnRhaW5lcihzcXJ0ICgyLjBf OCkpCiAgICBjYWxsIGNoZWNrX2l0IChjb250LCAxMCkKCiAgICBjb250ID0gdENvbnRhaW5lcig0 XyJoZWxsbyEiKQogICAgY2FsbCBjaGVja19pdCAoY29udCwgMTEpCgogICAgY29udCA9IHRDb250 YWluZXIoY2hyNCkKICAgIGNhbGwgY2hlY2tfaXQgKGNvbnQsIDEyKQoKICAgIGNvbnQgPSB0Q29u dGFpbmVyKCJlbmQgb2YgdGVzdHMiKQogICAgY2FsbCBjaGVja19pdCAoY29udCwgMTMpCgogIGVu ZCBzdWJyb3V0aW5lIGJhcgplbmQgcHJvZ3JhbQo= --00000000000040ffc105ff19f6a6 Content-Type: text/x-patch; charset="US-ASCII"; name="pr49213.diff" Content-Disposition: attachment; filename="pr49213.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lje5cpdx1 ZGlmZiAtLWdpdCBhL2djYy9mb3J0cmFuL2V4cHIuY2MgYi9nY2MvZm9ydHJhbi9leHByLmNjCmlu ZGV4IGM5NjBkZmVhYmQ5Li5lNDE4ZjFmMzMwMSAxMDA2NDQKLS0tIGEvZ2NjL2ZvcnRyYW4vZXhw ci5jYworKysgYi9nY2MvZm9ydHJhbi9leHByLmNjCkBAIC04MTYsOSArODE2LDcgQEAgYm9vbAog Z2ZjX2lzX3B0cl9mY24gKGdmY19leHByICplKQogewogICByZXR1cm4gZSAhPSBOVUxMICYmIGUt PmV4cHJfdHlwZSA9PSBFWFBSX0ZV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9jYWxsICh0bXAsIHNlLmV4cHIsIHNpemUpKTsKKworCSAgLyogRmlsbCB0aGUgdW5saW1pdGVk IHBvbHltb3JwaGljIF9sZW4gZmllbGQuICAqLworCSAgaWYgKFVOTElNSVRFRF9QT0xZIChjbSkg JiYgZXhwci0+dHMudHlwZSA9PSBCVF9DSEFSQUNURVIpCisJICAgIHsKKwkgICAgICB0bXAgPSBn ZmNfY2xhc3NfbGVuX2dldCAoZ2ZjX2dldF9jbGFzc19mcm9tX2V4cHIgKHRtcCkpOworCSAgICAg IGdmY19hZGRfbW9kaWZ5ICgmYmxvY2ssIHRtcCwKKwkJCSAgICAgIGZvbGRfY29udmVydCAoVFJF RV9UWVBFICh0bXApLAorCQkJICAgICAgc2Uuc3RyaW5nX2xlbmd0aCkpOworCSAgICB9CisJfQog ICAgICAgZWxzZQogCWdmY19hZGRfbW9kaWZ5ICgmYmxvY2ssIHRtcCwKIAkJCWZvbGRfY29udmVy dCAoVFJFRV9UWVBFICh0bXApLCBzZS5leHByKSk7Cg== --00000000000040ffc105ff19f6a6--