From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by sourceware.org (Postfix) with ESMTPS id 86EAB3858C5F; Tue, 11 Jun 2024 14:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86EAB3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86EAB3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718115167; cv=none; b=qqvgrGPPUT9R7fd8reONoeEkCnpAdijmkI15KMZUYOfkm5yYV1jbVwp67Stule7wYHogaZ5utr/cLu4LkcK68lXIscYcqhLBTiNtXh0biFpPrXEMZGiU01UUS3QBBRy7jU4dexRR3TP4F6svFG0/hQ7aJS++Q6RkZEU3FxYfVNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718115167; c=relaxed/simple; bh=QVeDhyCsUeEOVhfALW5L2HZ5BuLTDVcViXgQytlNZRY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=BBUV3vrB5b4UNBXKJ6g+7q993/NACU9m+p3sPUi44vfhOYakDs8NQoZ4Yit4E3dp+i2nowwbcrayapL56Wl/CjbulMoUOKBh1oZcIMWqT02INI6SG+wTzLR/Xy3gLGUp3uhJ3SZcdPx8fWosrRtwrp8YFaUWyWYVnbzbhlgXu1I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1718115161; x=1718719961; i=vehre@gmx.de; bh=bpegcUAA6eBU2tEKj0rDXbW4OGSzlPEKaBklU6VsdO8=; h=X-UI-Sender-Class:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=OvyawW6Wt47oGsF6SaIKGUclRlYvYhbY9VaLCEYetTadSq8/ldw6bhLQXKPgV3jY Ok7kiW0oNXLOGNwlb2wsEzJYrcZfZbgzx/aFVdBtBLh/8mdMWnN/7eWYEZ85D55bJ epmDdzfqI3MuIfCoxc9N+ANQbxG9XipfQJlQZG+p+3CzFMcJQXFoMaDd36sXvKFFy P7qDlq4tso/klpsQY/PdcdiG1o5EdtjgxAG1dM9dPSEf/BOmdmmU911v3ffCRbXeP zbyu4xySnlA5Ef7VAIDHSZgbhbDiNaBL/6WtR9uMEf6G73gzZAN+IdW1C+9FB86jg uNuhnLhEEWn8np+u+w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from vepi2 ([62.155.205.192]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUj2-1sZFc244eY-00rvbj; Tue, 11 Jun 2024 16:12:41 +0200 Date: Tue, 11 Jun 2024 16:12:38 +0200 From: Andre Vehreschild To: GCC-Patches-ML , GCC-Fortran-ML Subject: [Patch, Fortran, 96418] Fix Test coarray_alloc_comp_4.f08 ICEs Message-ID: <20240611161238.14634f57@vepi2> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/uqPGLDJS=TZtLW=pO6xWEfC" X-Provags-ID: V03:K1:R1Gz18Hz89loXartCdnWgIWz9pqgbbvMyjul8bBPL1NOX7Pe9v1 nfOE57WuOZjYuJcSAhfWQPAMXETZpHt5F/+7i9U8i8ZZK0uLwk7cf/0nq5/7jQ8xvNroybx Ddt/6ZSMx+vFq2ebJBJDlD+GoDmnRAv87zZp4AgRNRSSRllyatoRBeVmdBXY4azeYNuy7xr GKAeSvGqtP40nPzRLuplw== UI-OutboundReport: notjunk:1;M01:P0:ZfqDYn8j+RY=;zfodoa/J54949tr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INE 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: --MP_/uqPGLDJS=TZtLW=pO6xWEfC Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi all, attached patch has already been present in 2020, but lost my attention. It fixes an ICE in the testsuite. The old mails description is: attached patch fixes PR96418 where the code in the testsuite when compiled= with -fcoarray=3Dsingle lead to an ICE. The reason was that the coarray object= was derefed as an array, but it was no array. Introducing the test for the descriptor removes the ICE. Regtests ok on x86_64-linux/Fedora 39. Ok for mainline? Regards, Andre =2D- Andre Vehreschild * Email: vehre ad gmx dot de --MP_/uqPGLDJS=TZtLW=pO6xWEfC Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=pr96418_1.patch =46rom e56f32ed836c1ecc2b46497d1d7b9c7c08749521 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Tue, 11 Jun 2024 15:24:55 +0200 Subject: [PATCH] Fix ICE when compiling with -fcoarray=3Dsingle, when dere= fing a non-array. PR fortran/96418 gcc/fortran/ChangeLog: * trans.c (gfc_deallocate_with_status): Check that object to d= eref is an array, before applying array deref. gcc/testsuite/ChangeLog: * gfortran.dg/coarray_alloc_comp_3.f08: Moved to... * gfortran.dg/coarray/alloc_comp_6.f90: ...here. Should be tested for both -fcoarray=3Dsingle and lib, resp. * gfortran.dg/coarray_alloc_comp_4.f08: Fix program name. =2D-- gcc/fortran/trans.cc | 3 ++- .../{coarray_alloc_comp_3.f08 =3D> coarray/alloc_comp_6.f08} | 3 +-- gcc/testsuite/gfortran.dg/coarray_alloc_comp_4.f08 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename gcc/testsuite/gfortran.dg/{coarray_alloc_comp_3.f08 =3D> coarray/a= lloc_comp_6.f08} (95%) diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc index a208afe90ab..1335b8cc48b 100644 =2D-- a/gcc/fortran/trans.cc +++ b/gcc/fortran/trans.cc @@ -1838,7 +1838,8 @@ gfc_deallocate_with_status (tree pointer, tree statu= s, tree errmsg, else caf_dereg_type =3D (enum gfc_coarray_deregtype) coarray_dealloc_mode= ; } - else if (flag_coarray =3D=3D GFC_FCOARRAY_SINGLE) + else if (flag_coarray =3D=3D GFC_FCOARRAY_SINGLE + && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (pointer))) pointer =3D gfc_conv_descriptor_data_get (pointer); } else if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (pointer))) diff --git a/gcc/testsuite/gfortran.dg/coarray_alloc_comp_3.f08 b/gcc/test= suite/gfortran.dg/coarray/alloc_comp_6.f08 similarity index 95% rename from gcc/testsuite/gfortran.dg/coarray_alloc_comp_3.f08 rename to gcc/testsuite/gfortran.dg/coarray/alloc_comp_6.f08 index e2037aa5809..8b153925129 100644 =2D-- a/gcc/testsuite/gfortran.dg/coarray_alloc_comp_3.f08 +++ b/gcc/testsuite/gfortran.dg/coarray/alloc_comp_6.f08 @@ -1,12 +1,11 @@ ! { dg-do run } -! { dg-options "-fcoarray=3Dlib -lcaf_single" } ! { dg-additional-options "-latomic" { target libatomic_available } } ! ! Contributed by Andre Vehreschild ! Check that manually freeing components does not lead to a runtime crash= , ! when the auto-deallocation is taking care. -program coarray_alloc_comp_3 +program alloc_comp_6 implicit none type dt diff --git a/gcc/testsuite/gfortran.dg/coarray_alloc_comp_4.f08 b/gcc/test= suite/gfortran.dg/coarray_alloc_comp_4.f08 index 6586ec651dd..4c71a90af8f 100644 =2D-- a/gcc/testsuite/gfortran.dg/coarray_alloc_comp_4.f08 +++ b/gcc/testsuite/gfortran.dg/coarray_alloc_comp_4.f08 @@ -5,7 +5,7 @@ ! Contributed by Andre Vehreschild ! Check that sub-components are caf_deregistered and not freed. -program coarray_alloc_comp_3 +program coarray_alloc_comp_4 implicit none type dt =2D- 2.45.1 --MP_/uqPGLDJS=TZtLW=pO6xWEfC--