From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id C110738618F0; Thu, 28 Sep 2023 18:21:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C110738618F0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-69101d33315so11250424b3a.3; Thu, 28 Sep 2023 11:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695925284; x=1696530084; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VjIQ9WQBOheyZebk4vWYjCv2sg6D5O4E+zlahzMljRU=; b=aZm+xdgMJe+PBxbO5H/y02e9kUiuAKUSXA0Rzmd/Wcf92dcVb1719b2YNuLPOTYKHH wIuNE8PDPgGJwKNs6pdcDO74m2kn1yIcXavg4VuhnwCxFrf1IkVDep8p0lmVuVizvnEP FR+UlXO4eme8pZnkJaEySMLXYMv18TONeCKnLmXGN4M/ZjNGG1kLd5erHDg3d8Evpiar Mg9E19KtNYtz+ErEW3SXFGICBfK3dLTeKjELEy4oekPAynEdKeD+SuyBp51ErRJPV3qc ihmC0VwHRJjUfT5Lil6BZx/O4ocztmDgfcp+buTRxRKzc5FUNFbKKP88iBZ9IEMMbYhZ 7RZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695925284; x=1696530084; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VjIQ9WQBOheyZebk4vWYjCv2sg6D5O4E+zlahzMljRU=; b=k3HB1Jneva8fTVERbba+GfafyKPuvhORl+ZncHgm6hXCw9VLx1rY+Z1UJp6/5PRAzb c+pS34TCeyhxxdNKb5+A9Qn+48EW0QP7Ez8TfCbplKlRFvlc6qq+6WEjfrrxNm9SO6A/ TXEpfIZhcQ4eN/N5+2Hwf5V7rdWt9UjLR2hZMZqbPQErGIbKEzh9A/5sObDrmxWiNEJ/ 88BWypYdXyQ2DAcTxp7d8SfeU4yGbNnd9/N6vzjVFLQxiCeyfVy/WyIi7mPVRhz4yc+c prVGvgp29Z/Fhw3rIAfrw6t8XX2yWrLkZ1NTeunKK7Q+NtxSVykiZhWFKo4+vw/bn09i 4rzQ== X-Gm-Message-State: AOJu0Yy88om28eIXxkmfE4fia/d3uzmx8zfUKj/doT4fROlOADEldNye yJNmTYakDhtyTiUv0Mb/uccboehkRf/fUayuGoHrTQVR X-Google-Smtp-Source: AGHT+IHlHPBp9nFtNwEjqTR1YCmQIO8zNbPUSMtZFnommr7/0ma9nB+k2CII4Zt5Wl8xp5S2L972UxLCJ/3at/kpnj4= X-Received: by 2002:a05:6a20:4290:b0:14b:3681:567e with SMTP id o16-20020a056a20429000b0014b3681567emr2132511pzj.29.1695925283576; Thu, 28 Sep 2023 11:21:23 -0700 (PDT) MIME-Version: 1.0 References: <20230928144505.77e03a8e@vepi2> In-Reply-To: <20230928144505.77e03a8e@vepi2> From: Paul Richard Thomas Date: Thu, 28 Sep 2023 19:21:12 +0100 Message-ID: Subject: Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed. To: Andre Vehreschild Cc: GCC-Fortran-ML , GCC-Patches-ML , Katherine Rasmussen , Brad Richardson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 Andre, The patch looks fine to me. Since you mention it in the comment, is it worth declaring the derived type 'foo' in a module and giving it a final routine? Thanks for the patch. Paul On Thu, 28 Sept 2023 at 13:45, Andre Vehreschild via Fortran wrote: > > Hi all, > > attached patch fixes a crash in coarray programs when an allocatable derived > typed coarray was freed explicitly. The generated cleanup code did not take > into account, that the coarray may have been deallocated already. The patch > fixes this by moving the statements accessing components inside the derived type > into the block guard by its allocated check. > > Regtested ok on f37/x86_64. Ok for master? > > Regards, > Andre > -- > Andre Vehreschild * Email: vehre ad gmx dot de