From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id A89DA385842F; Wed, 21 Feb 2024 21:00:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A89DA385842F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A89DA385842F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=128.95.76.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708549248; cv=none; b=Y8a9pLQu0XZUYaIYhlnFdnDLZ8Yl44bg7WZsWLySEBqAYRHHuz0KcYIpBGZ8LDjxSRqJIfuC/QpqVvDJz4qJoSHQzdYmw5gwjNQ1p9zcA8qEZ66fIokArUjRjvu6nwDZN3MJx/6V7QOzI0gN1VAD8HYbjJl1zC/WgwihlXx8vTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708549248; c=relaxed/simple; bh=IdfHhEOg8+lKuTIaNNbllVOJR+JWCvvTL8HAI3B58Jo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=KFwMRIvSU2WBPNGwHwyf0HE9rbu7VOoGzFk86oQiXwlj/azzM9wL1xhpeRJWDdBCC5EUn2hxu50XQgsGmA/eeAcXH7Gpk9GRs+1UZNf+dAOAJi6etqYbgt6qMBLfXtCjCVxXHHEsm39yzPJaqTQVOUpoud+F/hn+geOpXOd61zI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.17.1/8.17.1) with ESMTP id 41LL0jSj088308; Wed, 21 Feb 2024 13:00:45 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) DKIM-Filter: OpenDKIM Filter v2.10.3 troutmask.apl.washington.edu 41LL0jSj088308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=troutmask.apl.washington.edu; s=troutmask; t=1708549245; bh=IdfHhEOg8+lKuTIaNNbllVOJR+JWCvvTL8HAI3B58Jo=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=MbKIAOxJYUe1uYIyEPLDqG8K3RVk4SlCFq6dVfsuXU7S0d/+jCKw5/MaHAITu8ltN WmC2rMp5ohLeA4aEr0c3Vob47IWgM0OCvJ8qKAfiisVHsmZTI79qMEq7rZi13ma1Sx 55nUhf9qIGq8z9C3jSY28V66vFltt00J8npsuYOIXxCKzyranbyyokMI54GTtElAoJ rEenZUI87SZhSkfqBq8UJamSD8LgvNaghT3KYRS0+7MW+a5cpGerTDb3t4nzHQxdua YBPHWT3aE9LE45M5X5srwTW1nvT+VVU4WIuM67sFTQkXeQ49E+XGaukxRZhgEIqqus NxKn2mSh+Slvg== Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.17.1/8.17.1/Submit) id 41LL0i2H088307; Wed, 21 Feb 2024 13:00:45 -0800 (PST) (envelope-from sgk) Date: Wed, 21 Feb 2024 13:00:44 -0800 From: Steve Kargl To: Harald Anlauf Cc: Jerry D , fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix fortran/PR114024 Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <29ba08a7-8218-4591-8c3f-36c17090e497@gmail.com> <3444d912-2e79-4e16-a425-79810d161ebb@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3444d912-2e79-4e16-a425-79810d161ebb@gmx.de> X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID,DKIM_SIGNED,KAM_DMARC_STATUS,KAM_NUMSUBJECT,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,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: On Wed, Feb 21, 2024 at 09:28:16PM +0100, Harald Anlauf wrote: > On 2/21/24 20:41, Jerry D wrote: > > On 2/21/24 10:30 AM, Steve Kargl wrote: > > > I have attached a patch to PR114024, see > > > > > > https://gcc.gnu.org/pipermail/gcc-bugs/2024-February/854651.html > > > > > > The patch contains a new testcase and passes regression > > > testing on x86_64-*-freebsd.  Could someone castr an eye > > > over the patch and commit it? > > > > > > > Hi Steve, > > > > I looked it over and looks reasonable.  I will try to apply it next few > > days and test here. If OK, I will commit. > > > > Jerry > > > > Actually the patch has two issues: > > - a minor one: a new front-end memleak which can be avoided by > using either gfc_replace_expr (see its other uses) > Hint: try valgrind on f951 Unfortunately, valgrind does not work on AMD FX-8350 cpu. memleak vs ICE. I think I'll take one over the other. Probably need to free code->expr3 before the copy. I tried gfc_replace_expr in an earlier patch. It did not work. > - it still fails on the following code, because the traversal > of the refs is incomplete / wrong: > > program foo > implicit none > complex :: cmp(3) > real, pointer :: pp(:) > class(*), allocatable :: uu(:) > type t > real :: re > real :: im > end type t > type u > type(t) :: tt(3) > end type u > type(u) :: cc > > cmp = (3.45,6.78) > cc% tt% re = cmp% re > cc% tt% im = cmp% im > allocate (pp, source = cc% tt% im) ! ICE cc%tt%im isn't a complex-part-ref, so this seems to be a different (maybe related) issue. Does the code compile with 'source = (cc%tt%im)'? If so, perhaps, detecting a component reference and doing the simply wrapping with parentheses can be done. > print *, pp > allocate (uu, source = cc% tt% im) ! ICE Ditto. Not to mention I know nothing about the implementation of CLASS in gfortran. -- Steve