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 0E3313858D38 for ; Sat, 30 Mar 2024 14:52:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E3313858D38 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0E3313858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=116.202.254.214 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711810375; cv=none; b=oAXoTm4ewHQwm9eEnosLriF7WT96YjX+/YXUdnx/B6z9z50yr4VsQmBrXzuInoNat1PR0gYF3IOFL0Os29nsP72Xb/6fJ8hc0SyOFOC5KBMFEC6i1RyQ13Q7ttPr3wlCagxx72W9MXrxmpC9uHEqGKksNDxAu0xs5KQr3Fkn/Vc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711810375; c=relaxed/simple; bh=Ro/aagPAlPaPBQ/niSu+pMBdDtLGnPvO41HKc8q0b74=; h=To:From:Subject:Date:Message-ID:Mime-Version; b=ojTxJ7MAekExbIg9Fi/RQ8edGsO6eO1PdCF3o4VMkO2LGftnlbpMDsgxaiI2e+UmfgE9ZvmYY/m416ASk2p8ADmjQOJyCh6/GwCf5tQeTo6hl7ZVcPLQ7x8zeapKbDRoRs7VHkQE6+9vDhrNsdvZl+GXFAEkn7aVZS3bPSnizFQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rqa4i-00074b-SN for gcc-patches@gcc.gnu.org; Sat, 30 Mar 2024 15:52:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab Date: Sat, 30 Mar 2024 15:52:45 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP 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: <20240330145245.lp_EqOcfl520iymwnniCVo99HdTeE-4q-xl98J8dPeI@z> Hi Paul, I had only a quick glance at your patch. I guess you unintentionally forgot to remove those parts that you already committed for PR110987, along with the finalize-testcases. I am still trying to find the precise paragraph in the standard you refer to regarding INTENT(OUT) and default initialization. While at it, I think I found a minor nit in testcase pr112407a.f90: component x%i appears undefined the first time it is printed. This can be verified by either adding an explicit x% i = -42 in the main after the allocate(x). Alternatively, running the code with Intel and using MALLOC_PERTURB_ shows a random arg1%i, but is otherwise fine. However, if by chance (random memory) x% i = +42 then the test would likely fail everywhere. Cheers, Harald Am 30.03.24 um 10:06 schrieb Paul Richard Thomas: > Hi All, > > This bug emerged in a large code and involves possible recursion with a > "hidden" module procedure; ie. where the symtree name starts with '@'. This > throws the format decoder. As the last message in the PR shows, I have > vacillated between silently passing on the possible recursion or adding an > alternative warning message. In the end, as a conservative choice I went > for emitting the message. > > In the course of trying to develop a compact test case, I found that type > bound procedures were not being tested for recursion and that class > dummies, with intent out, were being incorrectly initialized with an empty > default initializer. Both of these have been fixed. > > Unfortunately, the most compact reproducer that Tomas was able to come up > with required more than 100kbytes of module files. I tried from the bottom > up but failed. Both the tests check the fixes for the other bugs. > > Regtests on x86_64 - OK for mainline and, in a couple of weeks, 13-branch? > > Paul > > Fortran: Fix wrong recursive errors and class initialization [PR112407] > > 2024-03-30 Paul Thomas > > gcc/fortran > PR fortran/112407 > *resolve.cc (resolve_procedure_expression): Change the test for > for recursion in the case of hidden procedures from modules. > (resolve_typebound_static): Add warning for possible recursive > calls to typebound procedures. > * trans-expr.cc (gfc_trans_class_init_assign): Do not apply > default initializer to class dummy where component initializers > are all null. > > gcc/testsuite/ > PR fortran/112407 > * gfortran.dg/pr112407a.f90: New test. > * gfortran.dg/pr112407b.f90: New test. >