From patchwork Sat Dec 3 18:51:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andre Vehreschild X-Patchwork-Id: 86436 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp798896qgi; Sat, 3 Dec 2016 10:52:00 -0800 (PST) X-Received: by 10.98.15.5 with SMTP id x5mr49983705pfi.140.1480791120095; Sat, 03 Dec 2016 10:52:00 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q2si9450479plh.215.2016.12.03.10.51.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 10:52:00 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443426-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443426-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443426-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=u2ZIDIdCxe9P1bf8 BIJA94BTURTHB2zYS1LOboMSQlxweZho50mNn1vVIljC4d3mNZQ5d43wG0SgSfR/ W0I1K3atI819buMlS8QhrcFkw1Wpf4oxYsn+9J/eJZK7YUDm5g1nKXUrDZmepaXQ +4A2yORFj4zY2laWpTFimgU0Idg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=/opUDZAisJhyVKEPhhrNfr JKWMw=; b=ky/4WHq5VxQO1N+JYJshTv1B4L2Ptc7WL/vNxdXdHfTO4k+3bHqsxP b3wwHZtAnIH8C0q4u1+BUYd7R3QuaLVEzDSq4iMV7/Th/PKZuxtmBenGAwq+cIfB jbtvn2E9ruA7Nut+Vf1OFZjwHqvUzGLgKh+uqKefSXY6uFcKj5u5k= Received: (qmail 103296 invoked by alias); 3 Dec 2016 18:51:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 103236 invoked by uid 89); 3 Dec 2016 18:51:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=dominiqlpsensfr, dominiq@lps.ens.fr X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Dec 2016 18:51:34 +0000 Received: from vepi2 ([92.76.205.227]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MWTSA-1cAaux06Yc-00Xf0z; Sat, 03 Dec 2016 19:51:29 +0100 Date: Sat, 3 Dec 2016 19:51:28 +0100 From: Andre Vehreschild To: Dominique =?UTF-8?B?ZCdIdW1pw6hyZXM=?= Cc: Fortran List , GCC-Patches-ML Subject: Re: [PATCH, Fortran, v2] Fix deallocation of nested derived typed components Message-ID: <20161203195128.03b5a90a@vepi2> In-Reply-To: <7A541266-DB7C-4A4D-BF06-B47DEB96CCF4@lps.ens.fr> References: <5B28CFDC-65D8-4FD1-8588-1100E1997FD9@lps.ens.fr> <20161203125132.3a0e6995@vepi2> <7A541266-DB7C-4A4D-BF06-B47DEB96CCF4@lps.ens.fr> MIME-Version: 1.0 X-UI-Out-Filterresults: notjunk:1; V01:K0:HujoyH1juTQ=:u0gzOcAYxn2yR2ax0Cd5A7 OiuFogsLosdbVSdtGM00PQvYPGGUPKjbH1d9BKicsvEIeXdOabD2awX8QZhyyKMOhxWerXhWq Fm4JHCmbuN1EiTdbCUZNLQS3XxA8GwDT/0LyxHoxiRFrkjSD5nst7g0QOer3unddu4bcjp1cf wrg6QDRKIa0D60fVtTdHuZ3shWuAwh2ZCoYBVFG+HdoCExMWsoODVO5QoK0LPtYjCB3NApRr2 4gQhBBcIgTFG8bDoJtiiABSK/ZHpzoQjHEjALhTUR8rkwV3eJeCVwNqFS1V2VT5XwoEYMXsQx t/6gbH53nYGTirj442Hm7WmraCcgAmThmg+E//lCs0mX/UvX8uPmQxxoPrXKiuTIGV0y87A0v /XMXXBPW7rQnYd/o9yct6szXvCPG0F6mvU6TMPhDZMhOravlPOy3YpEfmOXJrcV/z17WcLvEv Z6taZAOLaolsRPhBKx2Gbfza4I8XerSpk79RJUaDTpX74r1cSevXkDTspG3SlR6xeXJFtREZG bp/aKir1IYVCeg+UvhfvK9WYfaF56Suwp2KF2M86p2h2kE5Ui2AaVEp+GNEP9XMOAjP1+X28G 56DI548ol04ySTF7JFb3lTOmIqzJxjYx0uS6CchSHHcNmASSl4iWmXJb2zm78eqRWmI8ssptt m1pINS+B/vnkxR5pxOmo2MIU1+yKCHRYVQgZd0HR8IhkvLcdI7J7aK+vz5EXjHBpGhRBTk+Gx lSghq8S5OEosoa6a7EcHT1Ps+wUsns9ceke6bbmyOPiboo2BII6e7yzx4TE= Hi all, @Dominique: Thanks for checking. And also for pointing out that the initial version of the patch ICEd on some already closed PRs. The objective of those PRs does not seem to be covered by the current testsuite. I therefore additionally propose to add attached testcase. Ok for trunk? Of course with appropriate Changelog-entry. Regards, Andre On Sat, 3 Dec 2016 18:34:56 +0100 Dominique d'Humières wrote: > > I also have addressed the ICEs with proc_pointer components. > > Confirmed, the patch LGTM. > > Thanks, > > Dominique > > -- Andre Vehreschild * Email: vehre ad gmx dot de diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_47.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_47.f90 new file mode 100644 index 0000000..1d52100 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_47.f90 @@ -0,0 +1,40 @@ +! { dg-do run } + +MODULE distribution_types + ABSTRACT INTERFACE + FUNCTION dist_map_blk_to_proc_func ( row, col, nrow_tot, ncol_tot, proc_grid ) RESULT( reslt ) + INTEGER, INTENT( IN ) :: row, col, nrow_tot, ncol_tot + INTEGER, DIMENSION( : ), INTENT( IN ) :: proc_grid + INTEGER, DIMENSION( : ), ALLOCATABLE :: reslt + END FUNCTION dist_map_blk_to_proc_func + END INTERFACE + TYPE, PUBLIC :: dist_type + INTEGER, DIMENSION( : ), ALLOCATABLE :: task_coords + PROCEDURE( dist_map_blk_to_proc_func ), NOPASS, POINTER :: map_blk_to_proc => NULL( ) + END TYPE dist_type +END MODULE distribution_types + +MODULE sparse_matrix_types + USE distribution_types, ONLY : dist_type + TYPE, PUBLIC :: sm_type + TYPE( dist_type ) :: dist + END TYPE sm_type +END MODULE sparse_matrix_types + +PROGRAM comp_proc_ptr_test + USE sparse_matrix_types, ONLY : sm_type + + call sm_multiply_a () +CONTAINS + SUBROUTINE sm_multiply_a ( ) + INTEGER :: n_push_tot, istat + TYPE( sm_type ), DIMENSION( : ), ALLOCATABLE :: matrices_a, matrices_b + n_push_tot =2 + ALLOCATE( matrices_a( n_push_tot + 1 ), matrices_b( n_push_tot + 1), STAT=istat ) + if (istat /= 0) call abort() + if (.not. allocated(matrices_a)) call abort() + if (.not. allocated(matrices_b)) call abort() + if (associated(matrices_a(1)%dist%map_blk_to_proc)) call abort() + END SUBROUTINE sm_multiply_a +END PROGRAM comp_proc_ptr_test +