From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by sourceware.org (Postfix) with ESMTPS id AB3C6385841D; Wed, 21 Jun 2023 18:40:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB3C6385841D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1687372806; x=1687977606; i=anlauf@gmx.de; bh=FRZmbgUXGPfezGtXvZNCPHn7BED+Ulx6SJsJbEu+YXg=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Z90cnoAZC21BTsWGwVE3hq7tzrC+r1LfSMQTEwITWO1FCkpEcaJStFF2fEffjzFdzY7eWmU zsIJpPE5SNhimF50jwcov44bLzLgg+Pg3vOWZgSuB88GmoQ38wR2alRbDCaiNDDWDAYiTfzgP 7yFKVzOxDP3/soqMobXHmvHtcTOxGyXRezCt5GYCon7sdmH539bQ/EWUc+iZMuDleAUTE60pe imYKcfoOF4HjL8imxoaIOToCZhGEP0hh/DihdLJBfhFGfYisppHMeN7S+sVryqc07JhAi+sHZ rBxi301pOqM5uQLX5SiqSOWR2qF4BNCkMmLiZCu1VT8Wcnf1hAzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.232.158.40]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N4QsO-1q3tb93dUU-011OGv; Wed, 21 Jun 2023 20:40:05 +0200 Message-ID: Date: Wed, 21 Jun 2023 20:40:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [Patch, fortran] PR107900 Select type with intrinsic type inside associate causes ICE / Segmenation fault To: Paul Richard Thomas Cc: "fortran@gcc.gnu.org" , gcc-patches , Steve Kargl Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <358e8e69-8fc9-8d00-7fde-9aaa86371c87@gmx.de> Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:vMeu04Svg2GajeIFNHCtTX72f1Jb2sEDcdQU4YU2up03lhRhQ43 oNTdA5OzfMXtkMOS2DYJ4q1gxU9Ok7FiF7mVyKhUcnYVOfS3wBffd57H9XiSSjbKyuZ41vX 6l2v6+MdNXBD2lCiG8HnFsM2DUR/3o/KJ9IFjAv7++S1G5FpTjj04fYexW2gHrZlQ547F1g Qk2l2lP3c2ot2vDWqIMGg== UI-OutboundReport: notjunk:1;M01:P0:16PFgWyl/WM=;6PYIR1cKr4y6ec6k2rTyqgJl/4F 1Cj5tXgNQaRR7mS7hB7mWgRIGEdqgvtMXd7YObOnFykrC8OIb2JUZlaJhk1e72QOfyEPjDL4W RlJvqaEBSNxvSXcYlWdnK02FjNuKm9hfxKxC4Df8mfWCsgTMsIU1OUwuLJbysraVyPjhdxKFM Ibzz+2YIAzEBWmpqCL5UGNcIcc1f1kCM8FGaYIZDRrKJOWm2tkbC2TCuW+y+hRVOmNAvRJkbq CAU5vJx/mnqshJSIs2Ugxd+Nl0xzm+rgCWqnM8rjVJU94EuhvmxahY5sV80PZJvBRdaK+zgs0 6R4/bEOFmi0aA9Bj4qzJa0K4dh6erOgVqMDVjmQ8y25MKGxH7YLSPqXZwc0y93fiJR3s0ym2i knhdGQL6Rv0QMrEmb/EyWKIdTQUd/SzdnVYB1c2HXZMJzU5skH+IKuM4JjZ6uC7Pkr5TYuThY 99XENP5BpTOMNEnWFek6zRxLpx7FQ+nA3fUHoIvpBLpmR37kRVInkeVikwTOWAyqv+XK67F9S pFlwYd9DoreYRv4pY99Ezza0LyPR0trMzEt4n+s2Df742KaDLHTYcKNQTXzDcqmgBj5lnWWdW GUBw85QxoJ/vvUm7lr8angFz3LI6id1T4WXegXYNJheuEXBWhrUSKCzgsbj545LbIDV2zvEek crqCZJKZ3RG4ymeGvICf4OKCZtAS6zC6tktu31OcSLLnxstr1noQOPFrOAk/64rRftAOIlZxH get0woXf7OIgZz/Vj8d+NUKViazdsHftfFZDBkvDwY42j1S78DqAQYb5M0i1rB5bKkaI2SWBJ WWfpydVpM+d67S97es5LhabSCFssW41jB9hexVGRCE+mXU9rVpnana2RwuPVxYTwdVETvbtuM ywm1Cr1xTKFNXX78BP5w6ZrDI3BPIudvbvLIDK+uXP0meaaxCPd5TQ4Cuuo/qPGznk5DBv1Ih orF2WbcFvEtB46ErGPRWaUMvecg= X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: Hi Paul, while I only had a minor question regarding gfc_is_ptr_fcn(), can you still try to enlighten me why that second part was necessary? (I believed it to be redundant and may have overlooked the obvious.) Cheers, Harald On 6/21/23 18:12, Paul Richard Thomas via Gcc-patches wrote: > Committed as r14-2022-g577223aebc7acdd31e62b33c1682fe54a622ae27 > > Thanks for the help and the review Harald. Thanks to Steve too for > picking up Neil Carlson's bugs. > > Cheers > > Paul > > On Tue, 20 Jun 2023 at 22:57, Harald Anlauf wrote: >> >> Hi Paul, >> >> On 6/20/23 12:54, Paul Richard Thomas via Gcc-patches wrote: >>> Hi Harald, >>> >>> Fixing the original testcase in this PR turned out to be slightly more >>> involved than I expected. However, it resulted in an open door to fix >>> some other PRs and the attached much larger patch. >>> >>> This time, I did remember to include the testcases in the .diff :-) >> >> indeed! :-) >> >> I've only had a superficial look so far although it looks very good. >> (I have to trust your experience with unlimited polymorphism.) >> >> However, I was wondering about the following helper function: >> >> +bool >> +gfc_is_ptr_fcn (gfc_expr *e) >> +{ >> + return e !=3D NULL && e->expr_type =3D=3D EXPR_FUNCTION >> + && (gfc_expr_attr (e).pointer >> + || (e->ts.type =3D=3D BT_CLASS >> + && CLASS_DATA (e)->attr.class_pointer)); >> +} >> + >> + >> /* Copy a shape array. */ >> >> Is there a case where gfc_expr_attr (e).pointer returns false >> and you really need the || part? Looking at gfc_expr_attr >> and the present context, it might just not be necessary. >> >>> I believe that, between the Change.Logs and the comments, it is >>> reasonably self-explanatory. >>> >>> OK for trunk? >> >> OK from my side. >> >> Thanks for the patch! >> >> Harald >> >>> Regards >>> >>> Paul >>> >>> Fortran: Fix some bugs in associate [PR87477] >>> >>> 2023-06-20 Paul Thomas >>> >>> gcc/fortran >>> PR fortran/87477 >>> PR fortran/88688 >>> PR fortran/94380 >>> PR fortran/107900 >>> PR fortran/110224 >>> * decl.cc (char_len_param_value): Fix memory leak. >>> (resolve_block_construct): Remove unnecessary static decls. >>> * expr.cc (gfc_is_ptr_fcn): New function. >>> (gfc_check_vardef_context): Use it to permit pointer function >>> result selectors to be used for associate names in variable >>> definition context. >>> * gfortran.h: Prototype for gfc_is_ptr_fcn. >>> * match.cc (build_associate_name): New function. >>> (gfc_match_select_type): Use the new function to replace inline >>> version and to build a new associate name for the case where >>> the supplied associate name is already used for that purpose. >>> * 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 (gfc_get_symbol_decl): Unlimited polymorphic >>> variables need deferred initialisation of the vptr. >>> (gfc_trans_deferred_vars): Do the vptr initialisation. >>> * trans-stmt.cc (trans_associate_var): Ensure that a pointer >>> associate name points to the target of the selector and not >>> the selector itself. >>> >>> gcc/testsuite/ >>> PR fortran/87477 >>> PR fortran/107900 >>> * gfortran.dg/pr107900.f90 : New test >>> >>> PR fortran/110224 >>> * gfortran.dg/pr110224.f90 : New test >>> >>> PR fortran/88688 >>> * gfortran.dg/pr88688.f90 : New test >>> >>> PR fortran/94380 >>> * gfortran.dg/pr94380.f90 : New test >>> >>> PR fortran/95398 >>> * gfortran.dg/pr95398.f90 : Set -std=3Df2008, bump the line >>> numbers in the error tests by two and change the text in two. >> > >