From patchwork Mon Nov 12 11:03:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 198361 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 69F482C0081 for ; Mon, 12 Nov 2012 22:04:14 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353323054; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=EyUSf74 52dlKfCd807li2qp6DV8=; b=DRSZiYWHlHkW+lTDU102cD+In/fz7HOJ1aOgzMZ HJqGJj2/5q0eEB5oIBbXX5jMnEaTImfF0MBI3nVy8N4Nyo8ILYD/1WlnBKN0QXPL uaCnpB3nXWhLW7zXV6vNvLMM2m/wK9DecEicmeLMRCv4IAHDzvj0GPP4sRgKsYLi 3g7g= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jKS/0mNZmufsg3+0GO8k1Xk9w6kQS74V4yAKW3blp+IXRJQ2KOH9eQO2q9txy9 cNLqQBMHKLemeibeFrrcEfCnuNXIcuFU7rqqfWwrUxM9aHr7Dr3yDwi3KvP/V7+4 De0/uIw9LUvq06yiXOi0HtWRohK6pmGFkJA0Ysp3nkQzE=; Received: (qmail 21215 invoked by alias); 12 Nov 2012 11:04:05 -0000 Received: (qmail 21201 invoked by uid 22791); 12 Nov 2012 11:04:04 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Nov 2012 11:04:00 +0000 Received: from [192.168.188.20] (port-92-195-100-57.dynamic.qsc.de [92.195.100.57]) by mx01.qsc.de (Postfix) with ESMTP id 86CC83CE12; Mon, 12 Nov 2012 12:03:58 +0100 (CET) Message-ID: <50A0D79E.7010202@net-b.de> Date: Mon, 12 Nov 2012 12:03:58 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 MIME-Version: 1.0 To: gcc patches , gfortran , "Rouson, Damian" , "Morris, Karla NMN" , "salvatore.filippone" Subject: [Patch, Fortran, committed] PR55272 - Fix module handling of coarray scalars 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 Thanks for the report Damian! And sorry for the breakage. Fixed with the following obvious patch (committed as Rev. 193429) after an all-language bootstrap/regtesting Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 193427) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2012-11-12 Tobias Burnus + + PR fortran/55272 + * module.c (mio_array_spec): Correctly handle coarray + scalars. + 2012-11-07 Tobias Schlüter PR fortran/51727 Index: gcc/fortran/module.c =================================================================== --- gcc/fortran/module.c (Revision 193427) +++ gcc/fortran/module.c (Arbeitskopie) @@ -2395,7 +2395,7 @@ mio_array_spec (gfc_array_spec **asp) if (iomode == IO_INPUT && as->corank) as->cotype = (as->type == AS_DEFERRED) ? AS_DEFERRED : AS_EXPLICIT; - if (as->rank > 0) + if (as->rank + as->corank > 0) for (i = 0; i < as->rank + as->corank; i++) { mio_expr (&as->lower[i]); Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 193427) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2012-11-12 Tobias Burnus + + PR fortran/55272 + * gfortran.dg/coarray_29_1.f90: New. + * gfortran.dg/coarray_29_2.f90: New. + 2012-11-12 Bin Cheng * gcc.dg/hoist-register-pressure-3.c: New test. Index: gcc/testsuite/gfortran.dg/coarray_29_1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_29_1.f90 (Revision 0) +++ gcc/testsuite/gfortran.dg/coarray_29_1.f90 (Arbeitskopie) @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } + +! To be used by coarray_29_2.f90 +! PR fortran/55272 + +module co_sum_module + implicit none +contains + subroutine co_sum(scalar) + integer scalar[*] + end subroutine +end module + +! DO NOT CLEAN UP THE MODULE FILE - coarray_29_2.f90 does it. +! { dg-final { keep-modules "" } } Index: gcc/testsuite/gfortran.dg/coarray_29_2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_29_2.f90 (Revision 0) +++ gcc/testsuite/gfortran.dg/coarray_29_2.f90 (Arbeitskopie) @@ -0,0 +1,18 @@ +! { dg-compile } +! { dg-options "-fcoarray=single" } + +! Requires that coarray_29.f90 has been compiled before +! and that, thus, co_sum_module is available + +! PR fortran/55272 +! +! Contributed by Damian Rouson + +program main + use co_sum_module + implicit none + integer score[*] + call co_sum(score) +end program + +! { dg-final { cleanup-modules "co_sum_module" } }