From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id 1684A3858D35; Sat, 17 Jun 2023 18:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1684A3858D35 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=1687024895; x=1687629695; i=anlauf@gmx.de; bh=F2lyPOdIn/dViHeLi+ObYNzKR9f3UMSSvwAsExgxK70=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=eFmX/BSv/rFcpej7sTsa29zhMAlvmVpvplK4C1pp8YZm3EsSwo+UdKjqG12DpcjZr/zX4WM W8pNCJ0L2aG7OhOlX9jAbvw8Vg/+DjxjAULQ997XiLOLsF45QGH8H8Gv0r2BsUVpA/yh2C9Mb s3IrsKYQ467Bok+pNmexXXN7V6dsndlcmcYY2/nOSzQl1rD/0GSZQLkDMoNH4/cgK25sUpBGj MHPdZeNS6KJPGCeYABUIWQj1LH9JCJ45Plh6eGVzXwIt2L8JyaNvD8ZYP+tOczJ38HSiohkY0 YcaZsqsSofiVQMmgmrUaBCPV0dEdOj2m43ic9lXMfIY1do0kpg0Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.232.150.78]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1wlv-1pz4r93bA1-012JRd; Sat, 17 Jun 2023 20:01:34 +0200 Message-ID: <358e8e69-8fc9-8d00-7fde-9aaa86371c87@gmx.de> Date: Sat, 17 Jun 2023 20:01:32 +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 , "fortran@gcc.gnu.org" , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: 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:oLHW/9hEcaWlSkIRHc4BDNbvV+cWB/ry911rK90I3WwuvRRZpiv CUwmpJQwrryDr1q0Uhm6UDh1u3eWYWLiK8QuoZlM8mAcbs0DrSrCOiy+0LghsKpr04KQR+/ hi/3r3UBQfFwqPCZ81LRB+I6z3PDhf6/p66+qeeRV8eh2Mc0MztzF5A61lXaZmPu/STlXXj Hor+o3x6qUH6BR3NYK7xA== UI-OutboundReport: notjunk:1;M01:P0:whgJ18OIpVk=;SU145sdnM3qU/JelL90CmG41CIt KVbiwmXKYlmKwVPK+xGxiuvtg/g9AhXaSiSgjClqqJ5m8UNF179F0wD0lBxDmzEXwYBvZWtEn b+WaSa/0vASd8k/Qo9S0c+TnRScrFGFJFYfLbnKP/mMyTHotBBMJvt+xtrPU6WVhXFgU3mV4S /K0SadNL21GXueQ9+E9DbMiPUI05qqLBf8VWrnobh2s7L6AaUc/40ZjwhyCUhdwd3oY/9bl6D iTrgzQjVbUSdKsLzZiwiluqWWK7n9+WdaXppt9o0K++kLQK1PSWfsmIkbEixBqvCfLku1jac8 YBORtBT59hkIyd9h+6ufyMh2y5HFdLyvzz3rRHgBYLXXYbErZykV6gi9eit0YWpBxrW1G4+VS KAnsJ9kCnQHVMViF6gpEpwEXnIWGl0XgpdG3JrVxwzUx3joQMLE2ZAgYAJNCUmJqrmosKwBmH eJbeVplcMWWjZzsr6GFwY+S3078KNXWqJt6eJwZCnBjTS9X4jkdab9LSzUa8Bw4ZFJcqjUlxm rauMPVVgkngPQ03m2ws+IhRrRSrcMm4gUHb0XsWjK4OTuYcc7w8cGgqB/Z1/gYDulxIkUxU4/ Ypd9t8ziB2kgkGWMyUEM6oJjJPbnBc2Ih6ZdqXSFaMaxbDL4UyNZ7PubHFjjyrfOAcba6AEV7 NOBKi7Tj5sTy9BV2mu/fYxyfFLRKnTmWrXNe3aFidILxUUFX/97c8/tALDW595I4HqDocelDw leswfBYM7QW14PziK6wZftIOfMpcnCK/CPn1IqdezRRmybUuIje06J1R65DCbtGatq7ppWWcl PXeARu/SQopoUwCNvUGtbjtMLySqVjUfWohbEnoSpq5oke7Dw/r5LpTug8yqnU7WJ751eQUys elZuSyXH+G2O7pHFXOSD8Zexv2sBT4WHrN3AB0IjY+8S/d6FU6WbMlhw6NxeSBZv6c2NMwVjM R3gxEGcAbwcC4YLN31D7ni6n1Jc= 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,KAM_SHORT,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,WEIRD_PORT 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, On 6/17/23 11:14, Paul Richard Thomas via Gcc-patches wrote: > Hi All, > > The attached patch is amply described by the comments and the > changelog. It also includes the fix for the memory leak in decl.cc, as > promised some days ago. > > OK for trunk? I hate to say it, but you forgot to add the testcase again... :-( The patch fixes your "extended" testcase in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107900#c2 but the original one in comment ICEs for me here: % gfc-14 pr107900.f90 f951: internal compiler error: Segmentation fault 0x1025c2f crash_signal ../../gcc-trunk/gcc/toplev.cc:314 0x9d31d3 resolve_select_type ../../gcc-trunk/gcc/fortran/resolve.cc:9791 0x9cef5e gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:12588 0x9d2431 resolve_codes ../../gcc-trunk/gcc/fortran/resolve.cc:18057 0x9d24fe gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18092 0x9cf0ee gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18077 0x9cf0ee resolve_block_construct ../../gcc-trunk/gcc/fortran/resolve.cc:10971 0x9cf0ee gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:12596 0x9d2431 resolve_codes ../../gcc-trunk/gcc/fortran/resolve.cc:18057 0x9d24fe gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18092 0x9b11f1 resolve_all_program_units ../../gcc-trunk/gcc/fortran/parse.cc:6864 0x9b11f1 gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.cc:7120 0xa033ef gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.cc:229 It hits an assert here: 9790 st =3D gfc_find_symtree (ns->sym_root, name); 9791 gcc_assert (st->n.sym->assoc); My tree is slightly modified, but the changes should not have any effect here. Can you please have a look, too? Thanks, Harald > Regards > > Paul > > PS This leaves 89645 and 99065 as the only real blockers to PR87477. > These will take a little while to fix. They come about because the > type of the associate name is determined by that of a derived type > function that hasn't been parsed at the time that component references > are being parsed. If the order of the contained procedures is > reversed, both test cases compile correctly. The fix will comprise > matching the component name to the accessible derived types, while > keeping track of all the references in case the match is ambiguous and > has to be fixed up later. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 49E233858C5F for ; Sat, 17 Jun 2023 18:01:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49E233858C5F Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qAaF1-0002fw-34 for gcc-patches@gcc.gnu.org; Sat, 17 Jun 2023 20:01:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [Patch, fortran] PR107900 Select type with intrinsic type inside associate causes ICE / Segmenation fault Date: Sat, 17 Jun 2023 20:01:32 +0200 Message-ID: <358e8e69-8fc9-8d00-7fde-9aaa86371c87@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US In-Reply-To: Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20230617180132.HzKM_mE5oenJ_g0f7IWs_juydzZtjtFZKdOudsMpnXk@z> Hi Paul, On 6/17/23 11:14, Paul Richard Thomas via Gcc-patches wrote: > Hi All, > > The attached patch is amply described by the comments and the > changelog. It also includes the fix for the memory leak in decl.cc, as > promised some days ago. > > OK for trunk? I hate to say it, but you forgot to add the testcase again... :-( The patch fixes your "extended" testcase in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900#c2 but the original one in comment ICEs for me here: % gfc-14 pr107900.f90 f951: internal compiler error: Segmentation fault 0x1025c2f crash_signal ../../gcc-trunk/gcc/toplev.cc:314 0x9d31d3 resolve_select_type ../../gcc-trunk/gcc/fortran/resolve.cc:9791 0x9cef5e gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:12588 0x9d2431 resolve_codes ../../gcc-trunk/gcc/fortran/resolve.cc:18057 0x9d24fe gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18092 0x9cf0ee gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18077 0x9cf0ee resolve_block_construct ../../gcc-trunk/gcc/fortran/resolve.cc:10971 0x9cf0ee gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:12596 0x9d2431 resolve_codes ../../gcc-trunk/gcc/fortran/resolve.cc:18057 0x9d24fe gfc_resolve(gfc_namespace*) ../../gcc-trunk/gcc/fortran/resolve.cc:18092 0x9b11f1 resolve_all_program_units ../../gcc-trunk/gcc/fortran/parse.cc:6864 0x9b11f1 gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.cc:7120 0xa033ef gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.cc:229 It hits an assert here: 9790 st = gfc_find_symtree (ns->sym_root, name); 9791 gcc_assert (st->n.sym->assoc); My tree is slightly modified, but the changes should not have any effect here. Can you please have a look, too? Thanks, Harald > Regards > > Paul > > PS This leaves 89645 and 99065 as the only real blockers to PR87477. > These will take a little while to fix. They come about because the > type of the associate name is determined by that of a derived type > function that hasn't been parsed at the time that component references > are being parsed. If the order of the contained procedures is > reversed, both test cases compile correctly. The fix will comprise > matching the component name to the accessible derived types, while > keeping track of all the references in case the match is ambiguous and > has to be fixed up later.