From jkr@jkr.cc.rl.ac.uk  Thu May  3 16:35:16 2001
Received: from nameserv.rl.ac.uk (nameserv.rl.ac.uk [130.246.135.129])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id QAA67096
	for <SC22WG5@dkuug.dk>; Thu, 3 May 2001 16:35:16 +0200 (CEST)
	(envelope-from jkr@jkr.cc.rl.ac.uk)
Received: from jkr.cc.rl.ac.uk (jkr.cc.rl.ac.uk [130.246.8.20])
	by nameserv.rl.ac.uk (8.8.8/8.8.8) with ESMTP id PAA15082
	for <SC22WG5@dkuug.dk>; Thu, 3 May 2001 15:35:31 +0100
Received: (from jkr@localhost)
	by jkr.cc.rl.ac.uk (8.8.8+Sun/8.8.8) id PAA03102
	for SC22WG5@dkuug.dk; Thu, 3 May 2001 15:37:36 +0100 (BST)
Date: Thu, 3 May 2001 15:37:36 +0100 (BST)
From: John Reid <jkr@rl.ac.uk>
Message-Id: <200105031437.PAA03102@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Re: Interp F90/204
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"


WG5,
    Here is a draft response for interp. F90/190. Comments,
please, preferably to me in private, before I send this to J3.
If anyone has a copy of 95-253 item 85, please will you send it
to me? I could not find it on the server or in any of my email
archives.

John Reid. 


                                                       J3/01-xxx

Date:    3 May 2001
To:      J3
From:    John Reid
Subject: Interpretation F90/000204 (Meaning of "same variable"
         description of MVBITS)

Here is a new draft response.  I have altered section number in the
question to that of the Fortran 95 standard. The old answer was
<possible response in 95-253 item 85>. This is entirely new.

NUMBER: F90/000204
TITLE: Meaning of "same variable" description of MVBITS
KEYWORDS: MVBITS
DEFECT TYPE: Erratum
STATUS: J3 consideration in progress

QUESTION: Section 13.14.75 states "TO ... may be the same
variable as FROM".  Given the following statements, which
pairs of variables are the same?

              INTEGER :: I(10), J(10)
              EQUIVALENCE (I,J)
              INTEGER, TARGET :: T(2:11)
              INTEGER, POINTER :: P1(:), P2(:)
              P1 => T
              P2 => T(2:11)

              I and I                P1 and T
              I(1) and I(1)          P1 and T(2:11)
              I(1:10) and I(1:10)    P2 and T
              I(1:1) and I(1:1:-1)   P2 and T(2:11)
              I and I(1:10)          P1 and P2
              I and J
              I(1) and J(1)
              I(1:10) and J(1:10)
              I(1:1) and J(1:1:-1)
              I and J(1:10)

ANSWER:

The quoted wording was intended to make clear that calls with the same
actual argument for FROM and TO, such as
   CALL MVBITS(DATA,2,2,DATA,0) ! Overwrite bits 0,1 by bits 2,3 
are permitted.

The wording later in the same paragraph:
  TO is defined by copying the sequence of bits of length LEN, starting
  at position FROMPOS of FROM to position TOPOS of TO.  No other bits
  of TO are altered.  On return, the LEN bits of TO starting at TOPOS
  are equal to the value that the LEN bits of FROM starting at FROMPOS
  had on entry.
makes it clear that the effect is as if a copy of the value of FROM were
made on entry and bits were extracted from this copy. This means that 
MVBITS is applicable with far more generality than the words 
'may be the same variable' suggest. 

Although the present wording is not incorrect, it suggests to the
reader that more general kinds of overlaps might not be permitted. The
edit corrects this.

EDIT: In subclause 13.14.75, in the second line of the paragraph that
defines the effect of TO [258:21] delete 'and may be the same variable
as FROM'.

SUBMITTED BY: /jor in response to IBM public comments
HISTORY: 95-299 m135 submitted

