From patchwork Sat Apr 30 16:36:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 93505 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]) by ozlabs.org (Postfix) with SMTP id 42DC71007E8 for ; Sun, 1 May 2011 02:36:50 +1000 (EST) Received: (qmail 4950 invoked by alias); 30 Apr 2011 16:36:41 -0000 Received: (qmail 4892 invoked by uid 22791); 30 Apr 2011 16:36:39 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 30 Apr 2011 16:36:24 +0000 Received: from [192.168.178.22] (port-92-204-100-38.dynamic.qsc.de [92.204.100.38]) by mx02.qsc.de (Postfix) with ESMTP id 0A3811E3A5; Sat, 30 Apr 2011 18:36:21 +0200 (CEST) Message-ID: <4DBC3A84.1080402@net-b.de> Date: Sat, 30 Apr 2011 18:36:20 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8 MIME-Version: 1.0 To: Jerry DeLisle CC: gcc patches , gfortran Subject: Re: [Patch, Fortran] PR 48800 - fix "IMPORT :: symbol" References: <4DBB3193.1020200@net-b.de> <4DBC2B64.80104@frontier.com> In-Reply-To: <4DBC2B64.80104@frontier.com> 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 Am 30.04.2011 17:31, schrieb Jerry DeLisle: > On 04/29/2011 02:45 PM, Tobias Burnus wrote: >> Nearly obvious patch. Build and regtested on x86-64-linux. >> OK for the trunk? >> > Thats a oneliner. OK Thanks for the review! Unfortunately, I had submitted/committed the wrong test case. (Both test cases are extremely similar, but test something quite different.) I have now corrected the test suite using the attached patch. (Rev. 173221). Tobias Index: gcc/testsuite/gfortran.dg/interface_37.f90 =================================================================== --- gcc/testsuite/gfortran.dg/interface_37.f90 (Revision 173218) +++ gcc/testsuite/gfortran.dg/interface_37.f90 (Arbeitskopie) @@ -1,31 +0,0 @@ ---- /dev/null -+++ gcc/testsuite/gfortran.dg/interface_36.f90 2011-04-29 19:10:43.000000000 +0200 -@@ -0,0 +1,28 @@ -+! { dg-do compile } -+! -+! PR fortran/48800 -+! -+! Contributed by Daniel Carrera -+! -+ pure function runge_kutta_step(t, r_, dr, h) result(res) -+ real, intent(in) :: t, r_(:), h -+ real, dimension(:), allocatable :: k1, k2, k3, k4, res -+ integer :: N -+ -+ interface -+ pure function dr(t, r_) ! { dg-error "cannot have a deferred shape" } -+ real, intent(in) :: t, r_(:) -+ real :: dr(:) -+ end function -+ end interface -+ -+ N = size(r_) -+ allocate(k1(N),k2(N),k3(N),k4(N),res(N)) -+ -+ k1 = dr(t, r_) -+ k2 = dr(t + h/2, r_ + k1*h/2) -+ k3 = dr(t + h/2, r_ + k2*h/2) -+ k4 = dr(t + h , r_ + k3*h) -+ -+ res = r_ + (k1 + 2*k2 + 2*k3 + k4) * h/6 -+ end function Index: gcc/testsuite/gfortran.dg/import9.f90 =================================================================== --- gcc/testsuite/gfortran.dg/import9.f90 (Revision 0) +++ gcc/testsuite/gfortran.dg/import9.f90 (Revision 0) @@ -0,0 +1,30 @@ +! { dg-do compile } +! +! PR fortran/48821 +! +! Contributed by Daniel Carrera +! + +contains + pure subroutine rk4_vec(t, Y, dY, h) + real, intent(inout) :: t, Y(:) + real, intent(in) :: h + real, dimension(size(Y)) :: k1, k2, k3, k4 + + interface + pure function dY(t0, y0) + import :: Y + real, intent(in) :: t0, y0(size(Y)) + real :: dY(size(y0)) + end function + end interface + + k1 = dY(t, Y) + k2 = dY(t + h/2, Y + k1*h/2) + k3 = dY(t + h/2, Y + k2*h/2) + k4 = dY(t + h , Y + k3*h) + + Y = Y + (k1 + 2*k2 + 2*k3 + k4) * h/6 + t = t + h + end subroutine +end Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 173219) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,6 +1,13 @@ 2011-04-30 Tobias Burnus - PR fortran/48800 + PR fortran/48821 + * gfortran.dg/import9.f90: New, proper test. + * gfortran.dg/interface_37.f90: Remove bogus + test (bogus copy of interface_36.f90). + +2011-04-30 Tobias Burnus + + PR fortran/48821 * gfortran.dg/interface_37.f90: New. 2011-04-30 Paul Thomas Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 173219) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,6 +1,6 @@ 2011-04-30 Tobias Burnus - PR fortran/48800 + PR fortran/48821 * decl.c (gfc_match_import): Don't try to find the symbol if already found.