From patchwork Wed Sep 18 22:20:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 275827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0B6FC2C007C for ; Thu, 19 Sep 2013 08:21:08 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=cPmRQWY8UVTCUd7eR y4s0agDCkIPtjWAsZuUrcigRFACeeJs5v98UwSaZpH+xjb+FLb6YLlYXUMJY2OSS CP8VSfMsIrQVdgp03ZVk3Zg+AqArFWFfCEiZ8Sann0TXjci6KXU9u/wcSLpK31QL fubD54ydDQyKLGdfehq/MM3K4k= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=m7827VlDP3hCDNwwwAPrAqR 83tU=; b=sIKdSO572/B0BhuDEEJOlkHyJWIKJVVqlC1szBTWfeepy7LL53+gmFW CPJUX5zrqe/fBtttJMHxhfpJ7Fu+ywVC5v0+RImfN+/+HpuHwWP+2krT1nXWtBIb EF4MN02xEBnbSwkApr+Yvq7sQvzsHbCs/nf3PFHEU6JzeVvM08AY= Received: (qmail 7159 invoked by alias); 18 Sep 2013 22:20:57 -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 7134 invoked by uid 89); 18 Sep 2013 22:20:57 -0000 Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 18 Sep 2013 22:20:57 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL, BAYES_00, KHOP_DYNAMIC, KHOP_THREADED, RCVD_IN_BRBL_LASTEXT, RCVD_IN_PBL, RCVD_IN_RP_RNBL, RCVD_IN_SEMBLACK, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx02.qsc.de Received: from archimedes.net-b.de (port-92-194-31-5.dynamic.qsc.de [92.194.31.5]) by mx02.qsc.de (Postfix) with ESMTP id 883CD27640; Thu, 19 Sep 2013 00:20:52 +0200 (CEST) Message-ID: <523A2744.50608@net-b.de> Date: Thu, 19 Sep 2013 00:20:52 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Thomas Koenig CC: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: [Patch, Fortran] PR57697 - Fix an issue with defined assignment References: <522EB7F5.10606@net-b.de> <523580B1.7090504@netcologne.de> <5235D980.2030208@net-b.de> <5236A3CA.60304@netcologne.de> In-Reply-To: <5236A3CA.60304@netcologne.de> I have now committed (Rev. 202725) a test case for that patch. (I confirmed that it fails before Rev. 202609 and works now.) See attachment. (While trying to create a test case, I found another bug with defined assignment; see PR fortran/58469.) Tobias PS: I still have to do the backporting to 4.8. By the way, the following patch is still pending to be reviewed: http://gcc.gnu.org/ml/fortran/2013-09/msg00031.html Thomas Koenig wrote: >> As testing showed, it didn't fix the real-world code: ForTrilinos's >> ForTrilinos_ADT_3D_Burgers_6th_Pade did still fail as it has: >> >> *_F.DA65 = matrix_diff_x (&parm.621); >> _F.DA66 = ax->epetra_rowmatrix.universal; // Deref of "ax"! >> Build and regtested on x86-64-gnu-linux. >> OK? > The patch is OK, also for 4.8. Please add a test case which also > checks for the ForTrilinos failure. Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 202724) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2013-09-18 Tobias Burnus + + PR fortran/57697 + * gfortran.dg/defined_assignment_11.f90: New. + 2013-09-18 Vladimir Makarov PR rtl-optimization/58438 Index: gcc/testsuite/gfortran.dg/defined_assignment_11.f90 =================================================================== --- gcc/testsuite/gfortran.dg/defined_assignment_11.f90 (Revision 0) +++ gcc/testsuite/gfortran.dg/defined_assignment_11.f90 (Arbeitskopie) @@ -0,0 +1,43 @@ +! { dg-do run } +! +! PR fortran/57697 +! +! Further test of typebound defined assignment +! +module m0 + implicit none + type :: component + integer :: i = 42 + integer, allocatable :: b + contains + procedure :: assign0 + generic :: assignment(=) => assign0 + end type + type, extends(component) :: comp2 + real :: aa + end type comp2 + type parent + type(component) :: foo + real :: cc + end type + type p2 + type(parent) :: x + end type p2 +contains + elemental subroutine assign0(lhs,rhs) + class(component), intent(INout) :: lhs + class(component), intent(in) :: rhs + lhs%i = 20 + end subroutine +end module + +program main + use m0 + implicit none + type(p2), allocatable :: left + type(p2) :: right +! print *, right%x%foo%i + left = right +! print *, left%x%foo%i + if (left%x%foo%i /= 20) call abort() +end