From patchwork Thu May 30 07:49:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 247468 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A9B462C007B for ; Thu, 30 May 2013 17:49:45 +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:subject:content-type; q= dns; s=default; b=QTxBQEfz2Mqk38m76Nsx4xVxG4bcSsaVBzebrhNbAUEQ9O jsAo0yJ47ohSjkQfYX1kmjW36tT7JitUqt1VetCCsZYOlBrPJa5VOO3rtclo2qyE TTFsgjCgPvYM4lRmvfFfDyqF92Q35Gx6oIh9X1YPQVzN/to3Vt9RUTMUnl9Ug= 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:subject:content-type; s= default; bh=JXR2lmWCK/xfugd1yw0V987if+o=; b=xQ4SRK31EQSIf2jfLYGV llaSVQeMPQCHyIJ2LzA8ZEzKm9Sd7MJ5tFB+6vP1+VBZWgg7zs/5rPjZq52FcpR9 cj4YhhbJacdXDfzm3rC6N3f/EIEnWEwlkedfTyLDXEKXGuzjQP6JOzm9O/zewLBV ufd4ej9FUWSCS3DTrEQOo1o= Received: (qmail 23098 invoked by alias); 30 May 2013 07:49:38 -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 23080 invoked by uid 89); 30 May 2013 07:49:38 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 30 May 2013 07:49:25 +0000 Received: from archimedes.net-b.de (port-92-195-106-97.dynamic.qsc.de [92.195.106.97]) by mx02.qsc.de (Postfix) with ESMTP id 3205E277D6; Thu, 30 May 2013 09:49:21 +0200 (CEST) Message-ID: <51A70480.3030100@net-b.de> Date: Thu, 30 May 2013 09:49:20 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] PR57458 - Relax two constraints for TS29113/assumed-rank X-Virus-Found: No A rather obvious patch - see PR for the quote from the standard. Thanks goes to Bill Long for finding and reporting the issue. Committed as Rev. 199437 after build+regtesting on x86-64-gnu-linux. Tobias 2013-05-30 Tobias Burnus PR fortran/57458 * interface.c (compare_parameter): Update C1239/C1240 constraint check for assumed-rank/TS29113. 2013-05-30 Tobias Burnus PR fortran/57458 * gfortran.dg/assumed_rank_13.f90: New. diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 2f8c6a5..adc4e63 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2031,14 +2031,15 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, || actual->symtree->n.sym->attr.volatile_) && (formal->attr.asynchronous || formal->attr.volatile_) && actual->rank && !gfc_is_simply_contiguous (actual, true) - && ((formal->as->type != AS_ASSUMED_SHAPE && !formal->attr.pointer) + && ((formal->as->type != AS_ASSUMED_SHAPE + && formal->as->type != AS_ASSUMED_RANK && !formal->attr.pointer) || formal->attr.contiguous)) { if (where) - gfc_error ("Dummy argument '%s' has to be a pointer or assumed-shape " - "array without CONTIGUOUS attribute - as actual argument at" - " %L is not simply contiguous and both are ASYNCHRONOUS " - "or VOLATILE", formal->name, &actual->where); + gfc_error ("Dummy argument '%s' has to be a pointer, assumed-shape or " + "assumed-rank array without CONTIGUOUS attribute - as actual" + " argument at %L is not simply contiguous and both are " + "ASYNCHRONOUS or VOLATILE", formal->name, &actual->where); return 0; } --- /dev/null 2013-05-30 08:32:37.588061020 +0200 +++ gcc/gcc/testsuite/gfortran.dg/assumed_rank_13.f90 2013-05-30 09:15:58.302491343 +0200 @@ -0,0 +1,26 @@ +! { dg-do compile } +! +! PR fortran/57458 +! +! + + integer, pointer, asynchronous :: i(:) + integer, pointer, volatile :: j(:) + call foo(i) + call foo2(i) + call foo3(j) + call foo4(j) +contains + subroutine foo(x) + type(*), dimension(:), asynchronous :: x + end subroutine foo + subroutine foo2(x) + type(*), dimension(..), asynchronous :: x + end subroutine foo2 + subroutine foo3(x) + type(*), dimension(:), asynchronous :: x + end subroutine foo3 + subroutine foo4(x) + type(*), dimension(..), asynchronous :: x + end subroutine foo4 +end