From owner-sc22wg5@open-std.org  Mon Jun  6 03:30:25 2011
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id DB942C178E5; Mon,  6 Jun 2011 03:30:25 +0200 (CET DST)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
X-Greylist: delayed 1812 seconds by postgrey-1.18 at www2.open-std.org; Mon, 06 Jun 2011 03:30:24 CET DST
Received: from ns.nag-j.co.jp (218-42-159-107.cust.bit-drive.ne.jp [218.42.159.107])
	by www2.open-std.org (Postfix) with ESMTP id E31C3C178E3
	for <sc22wg5@open-std.org>; Mon,  6 Jun 2011 03:30:24 +0200 (CET DST)
Received: from 218-42-159-108.cust.bit-drive.ne.jp ([218.42.159.108] helo=Maru6)
	by ns.nag-j.co.jp with smtp (Exim 4.50)
	id 1QTOAb-0005xV-Q7
	for sc22wg5@open-std.org; Mon, 06 Jun 2011 09:59:53 +0900
Message-ID: <5A1B5F62AB31420A9CBD0153FEBFAD94@Maru6>
From: "Malcolm Cohen" <malcolm@nag-j.co.jp>
To: "WG5" <sc22wg5@open-std.org>
References: <20110605224006.B3F8AC178E3@www2.open-std.org>
In-Reply-To: <20110605224006.B3F8AC178E3@www2.open-std.org>
Subject: Re: [ukfortran] (SC22WG5.4469) Question on CONTIGUOUS
Date: Mon, 6 Jun 2011 10:00:08 +0900
Organization: =?utf-8?B?5pel5pysTkFH?=
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="utf-8";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 15.4.3502.922
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3502.922
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

>Question: Does this program conform to the Fortran 2008 standard?

Yes.

>Reason: Of three compilers that accept the CONTIGUOUS attribute, one
>rejects the above, and two accept it.

Then one compiler has a bug.

> Given 5.3.7 para 1 I would tend to
>conclude that the code is invalid.

5.3.7p1 does appear on the face of it to be incorrect.  Note that 5.3.7p1 makes 
no requirement on the program or processor (it does not use "shall"), and there 
is no normative text to support its first claim.

There are no requirements in the procedure chapter (12) on the actual argument 
corresponding to a nonpointer CONTIGUOUS dummy (there are requirements on 
contiguous array pointers).

Furthermore, 12.5.2.4p10 describes what happens with pointer association when a 
pointer is associated with a CONTIGUOUS dummy and the actual is not simply 
contiguous.  That text would be meaningless if we did not allow noncontiguous 
actual arguments for a contiguous dummy.

> From a usability point of view I'd consider it a nice feature if the processor 
> would
> do the necessary copy-in/out if the actual argument is non-contiguous. If the 
> code
> is deemed invalid - why was it decided to not support this?

In fact we did decide to support it.  After all, it's no more work for the 
compiler than what we already required for explicit-shape and assumed-size 
arrays, way back in F90 days.

Cheers,
-- 
................................Malcolm Cohen, Nihon NAG, Tokyo. 

