Bug 45859 - [Coarray, F2008, IR] Rejects valid actuals to coarray dummies
[Coarray, F2008, IR] Rejects valid actuals to coarray dummies
Status: UNCONFIRMED
Product: gcc
Classification: Unclassified
Component: fortran
4.6.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
: rejects-valid
Depends on:
Blocks: 39627 18918
  Show dependency treegraph
 
Reported: 2010-10-01 15:55 UTC by Tobias Burnus
Modified: 2011-08-25 14:28 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2010-10-01 15:55:28 UTC
The discussion has started at
   http://j3-fortran.org/pipermail/j3/2010-September/003862.html
and lead to the following interpretation request (no link as the mail archive lags behind).

The program
   interface
      subroutine sub (x)
         real x(10)[*]
      end subroutine
   end interface
   real :: x(100)[*]
   call sub (x(10))
   end

is supposed to be valid according the following IR. A modified program which uses
   call sub (x(10:))
is unambiguously valid. However, both programs are rejected by:

   call sub (x(10))
              1
Error: Actual argument to 'x' at (1) must be a coarray and thus shall not have an array designator

------------------------------------------------------
To: J3                                                     10-xxx
From: John Reid
Subject: F2008 interp re sequence association for coarrays
Date: 2010 October 1

NUMBER: F08/xxxx
TITLE:  Sequence association for coarrays
KEYWORDS: sequence association, coarrays
DEFECT TYPE: Erratum
STATUS: J3 consideration in progress

QUESTION:

Was the text in 12.5.2.8:
"If the dummy argument is an array coarray that has the CONTIGUOUS 
attribute or is not of assumed shape, the corresponding actual argument 
shall be simply contiguous." 
intended to disallow sequence association for coarrays, as 
illustrated by the example

   interface
      subroutine sub (x)
         real x(10)[*]
      end subroutine
   end interface
   ...
   real :: x(100)[*]
   ...
   call sub (x(10)) 

ANSWER:

No. This restriction contradicts 12.5.2.4 paragraph 13, which allows 
the example program. An edit is supplied to correct this.

EDIT:

In 12.5.2.8 Coarray dummy variables, at the end of paragraph 2, 
add "or an element of a simply contiguous array".

SUBMITTED BY: John Reid
Comment 1 Tobias Burnus 2011-03-27 16:03:41 UTC
See "F08/0040" at http://j3-fortran.org/doc/year/11/11-006A.txt
"STATUS: Passed by J3 letter ballot"
Comment 2 Tobias Burnus 2011-07-18 20:16:08 UTC
(In reply to comment #1)
> See "F08/0040" at http://j3-fortran.org/doc/year/11/11-006A.txt
> "STATUS: Passed by J3 letter ballot"

My comment is odd. First, the number is wrong. It's F08/0048. Secondly, the proposal was rejected at the voting.

It gets muddier if one looks at the details:
Meeting 193 ( http://j3-fortran.org/doc/meeting/193/ ):
- 10-229 has an edit which allows the program (cf. quote in comment 0)
- 10-229r1 and 10-229r2 has an edit which makes the program invalid
- The letter ballot (cf. 11-129 of meeting m194 and link of comment 1) rejected
  the 10-229r2 version - and suggested in comment the wording of 10-229.

The IR has seemingly not been picked up again for later meetings. I have now
asked at J3 for an update.
Comment 3 Tobias Burnus 2011-07-18 20:21:20 UTC
(In reply to comment #2)
> Meeting 193 ( http://j3-fortran.org/doc/meeting/193/ ):
> - 10-229 has an edit which allows the program (cf. quote in comment 0)
> - 10-229r1 and 10-229r2

Make those 10-226, 10-226r1 and 226r2.
Comment 4 Tobias Burnus 2011-08-25 14:28:03 UTC
(In reply to comment #0)
> is supposed to be valid according the following IR. A modified program which
> uses
>    call sub (x(10:))
> is unambiguously valid. However, both programs are rejected by:

With current gfortran 4.7, the "x(10:)" program is accepted and the other one is rejected for "x(10)" with "must be simply contiguous" (which is true). Thus, the result is OK and only depends on what J3/WG5 regard as correct.

TODO: Wait for the result of the IR.