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 1EBDB3858010 for ; Mon, 29 Jan 2024 21:06:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1EBDB3858010 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 1EBDB3858010 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=1706562375; cv=none; b=iQJHGcYrddNNHW6tp9Q5fpZ9/JPMQ91pI1IrOLNewE7VUVIHvl3pe0AGFsMLq30Br00F8PRp6vqBNoQRc70IUqtgDJfuX7MNa/mg6eq371rvwFCf0qG20k8Qe/3jI2zpGfnPlGK1z0/Z1yUw5MSZfiSUuyPUe3zxI8zPT7lla2g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706562375; c=relaxed/simple; bh=kCjsgTUKwNVBQsDm0sZZ/k4EoJVQxZGAEFbG9awLVvY=; h=To:From:Subject:Date:Message-ID:Mime-Version; b=OghcBHrBgExwzDtWh49n0P+Zy5QwBVvt3LTTH7XBS4+SJjjqWcZ9hQXO85pG6jiAU8s+rJtYVK7TfGgGK2IKrBRaVBr/mS34fals+tFMeOslt3CW0Hn0LIBurOpOx4pCMjw20H9DqNgx/j3hUGkHmmYKxPtwSLBzT8AnYXHm+TU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rUYpY-00027Z-Bb for gcc-patches@gcc.gnu.org; Mon, 29 Jan 2024 22:06:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: Mark internal symbols as artificial [PR88009,PR68800] Date: Mon, 29 Jan 2024 22:06:04 +0100 Message-ID: References: <20211114231748.376086cd@nbbrfq> <20211117091216.3a0ec44f@nbbrfq> <4842a7cf-48a2-cd34-e717-952d181abd84@gmx.de> <20240129214509.590a7fa0@nbbrfq.loc> 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: <20240129214509.590a7fa0@nbbrfq.loc> 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,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: <20240129210604.evhFqcuDsClJ2hPOjjAONfbgwl6qDQnRNMkEv8RCr_4@z> Am 29.01.24 um 21:45 schrieb Bernhard Reutner-Fischer: > On Wed, 17 Nov 2021 21:32:14 +0100 > Harald Anlauf wrote: > >> Do you have testcases/reproducers demonstrating that the patch actually >> fixes the issues you're describing? > > I believe that marking artificial symbols as such is obvious and i did > use the existing tests to verify that the changes do not regress but > behave as intended. I did check that the memory leak in > gfc_find_derived_vtab is fixed with the patch. > > Ok for stage 1 if the rebased regression test passes? > > thanks > >> >> Am 17.11.21 um 09:12 schrieb Bernhard Reutner-Fischer via Gcc-patches: >>> On Tue, 16 Nov 2021 21:46:32 +0100 >>> Harald Anlauf via Fortran wrote: >>> >>>> Hi Bernhard, >>>> >>>> I'm trying to understand your patch. What does it really try to solve? >>> >>> Compiler generated symbols should be marked artificial. >>> The fix for PR88009 ( f8add009ce300f24b75e9c2e2cc5dd944a020c28 , >>> r9-5194 ) added artificial just to the _final component and left out all the rest. >>> Note that the majority of compiler generated symbols in class.c >>> already had artificial set properly. >>> The proposed patch amends the other generated symbols to be marked >>> artificial, too. >>> >>> The other parts fix memory leaks. >>> >>>> >>>> PR88009 is closed and seems to have nothing to do with this. >>> >>> Well it marked only _final as artificial and forgot to adjust the >>> others as well. >>> We can remove the reference to PR88009 if you prefer? >>> >>> thanks! >>>> >>>> Harald >>>> >>>> Am 14.11.21 um 23:17 schrieb Bernhard Reutner-Fischer via Fortran: >>>>> Hi! >>>>> >>>>> Amend fix for PR88009 to mark all these class components as artificial. >>>>> >>>>> gcc/fortran/ChangeLog: >>>>> >>>>> * class.c (gfc_build_class_symbol, generate_finalization_wrapper, >>>>> (gfc_find_derived_vtab, find_intrinsic_vtab): Use stringpool for >>>>> names. Mark internal symbols as artificial. >>>>> * decl.c (gfc_match_decl_type_spec, gfc_match_end): Fix >>>>> indentation. >>>>> (gfc_match_derived_decl): Fix indentation. Check extension level >>>>> before incrementing refs counter. >>>>> * parse.c (parse_derived): Fix style. >>>>> * resolve.c (resolve_global_procedure): Likewise. >>>>> * symbol.c (gfc_check_conflict): Do not ignore artificial symbols. >>>>> (gfc_add_flavor): Reorder condition, cheapest first. >>>>> (gfc_new_symbol, gfc_get_sym_tree, >>>>> generate_isocbinding_symbol): Fix style. >>>>> * trans-expr.c (gfc_trans_subcomponent_assign): Remove >>>>> restriction on !artificial. >>>>> * match.c (gfc_match_equivalence): Special-case CLASS_DATA for >>>>> warnings. >>>>> >>>>> --- >>>>> gfc_match_equivalence(), too, should not bail-out early on the first >>>>> error but should diagnose all errors. I.e. not goto cleanup but set >>>>> err=true and continue in order to diagnose all constraints of a >>>>> statement. Maybe Sandra or somebody else will eventually find time to >>>>> tweak that. >>>>> >>>>> I think it also plugs a very minor leak of name in gfc_find_derived_vtab >>>>> so i also tagged it [PR68800]. At least that was the initial >>>>> motiviation to look at that spot. >>>>> We were doing >>>>> - name = xasprintf ("__vtab_%s", tname); >>>>> ... >>>>> gfc_set_sym_referenced (vtab); >>>>> - name = xasprintf ("__vtype_%s", tname); >>>>> >>>>> Bootstrapped and regtested without regressions on x86_64-unknown-linux. >>>>> Ok for trunk? >>>>> >>>> >>>> >>> >>> >> > > Can you please post the patch here so that we can review it?