public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
@ 2015-10-09 12:13 ` dominiq at lps dot ens.fr
  2015-10-09 12:23 ` john.donners at surfsara dot nl
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09 12:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-10-09
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
With gfortran 4.8 up to trunk (6.0) I get the following output

 Actual argument, allocatable, lbound=           3          10          16
 Dummy argument, lbound=           1           1           1
 Actual argument, lbound=           3          10          16
 Dummy argument, lbound=           1           1           1

What is your expectation?

Note that I get the same output if I replace

  real,dimension(..) :: a

with

  real,dimension(:,:,:) :: a

Note that I don't understand the rationale of

> except that when the actual argument is assumed-size, the upper bound of the 
> last dimension of the dummy argument is 2 less than the lower bound of
> that dimension.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
  2015-10-09 12:13 ` [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument dominiq at lps dot ens.fr
@ 2015-10-09 12:23 ` john.donners at surfsara dot nl
  2015-10-09 12:31 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: john.donners at surfsara dot nl @ 2015-10-09 12:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

--- Comment #2 from John Donners <john.donners at surfsara dot nl> ---
Hello Dominique,

thank you for your reaction. Yes, I should have added the output and my
expectation. I expected to see the following:

 Actual argument, allocatable, lbound=           3          10          16
 Dummy argument, lbound=           3           10           16
 Actual argument, lbound=           3          10          16
 Dummy argument, lbound=           3           10          16

because the standard says that the bounds of the actual and the dummy argument
are the same for assumed-rank arrays.

Indeed, I'm equally puzzled about the last part of that paragraph in the
standard, but I included it for completeness. I don't think it applies here,
because the actual argument is not assumed-size.

(just as a remark: the Cray compiler gives me the expected answer, while the
Intel compiler returns '3 10 16' in the former case and '1 1 1' in the latter
case.)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
  2015-10-09 12:13 ` [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument dominiq at lps dot ens.fr
  2015-10-09 12:23 ` john.donners at surfsara dot nl
@ 2015-10-09 12:31 ` dominiq at lps dot ens.fr
  2015-10-09 12:56 ` john.donners at surfsara dot nl
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09 12:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> ... I expected to see the following:
>
>  Actual argument, allocatable, lbound=           3          10          16
>  Dummy argument, lbound=           3           10           16
>  Actual argument, lbound=           3          10          16
>  Dummy argument, lbound=           3           10          16
>
> because the standard says that the bounds of the actual and the dummy argument
> are the same for assumed-rank arrays.

I read the standard the same way and I was expecting the same output for
assumed-size too.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-10-09 12:31 ` dominiq at lps dot ens.fr
@ 2015-10-09 12:56 ` john.donners at surfsara dot nl
  2015-10-09 13:00 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: john.donners at surfsara dot nl @ 2015-10-09 12:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

--- Comment #4 from John Donners <john.donners at surfsara dot nl> ---
I think that you meant an assumed-shape array with

  real,dimension(:,:,:) :: a

The assumed-shape array is described in section 5.5.8.3 of the draft standard
and it explicitly says that the lower bound is 1, unless specified for the
dummy argument. 

There is no such remark in section 5.5.8.7 for the assumed-rank entity. It
wouldn't be possible to specify the lower bound, since the number of dimensions
is unknown in this case.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-10-09 12:56 ` john.donners at surfsara dot nl
@ 2015-10-09 13:00 ` dominiq at lps dot ens.fr
  2015-10-09 13:03 ` john.donners at surfsara dot nl
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09 13:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I think that you meant an assumed-shape array with ...

Indeed! Thanks for the pointer.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-10-09 13:00 ` dominiq at lps dot ens.fr
@ 2015-10-09 13:03 ` john.donners at surfsara dot nl
  2015-10-09 13:20 ` dominiq at lps dot ens.fr
  2015-10-09 18:31 ` mikael at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: john.donners at surfsara dot nl @ 2015-10-09 13:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

--- Comment #6 from John Donners <john.donners at surfsara dot nl> ---
I did have a look at the gcc code to see if I could change this, but I don't
know where to start. I did see the tests for the assumed rank bounds and I
could help to change those.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-10-09 13:03 ` john.donners at surfsara dot nl
@ 2015-10-09 13:20 ` dominiq at lps dot ens.fr
  2015-10-09 18:31 ` mikael at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09 13:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
AFAICT the (l\u)bound have been set by r190098. Mikael CCed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument
       [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-10-09 13:20 ` dominiq at lps dot ens.fr
@ 2015-10-09 18:31 ` mikael at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu.org @ 2015-10-09 18:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67894

--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #7)
> AFAICT the (l\u)bound have been set by r190098. Mikael CCed.

I think that revision just made scalarization work.
For the calls with the dim= argument, I don't think it changed anything.
But it's about PR48820, and in the previous change for that PR, namely in
r189743, there is this interesting comment:

      /* Take care of the lbound shift for assumed-rank arrays, which are
         nonallocatable and nonpointers. Those has a lbound of 1.  */


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-09 18:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-67894-4@http.gcc.gnu.org/bugzilla/>
2015-10-09 12:13 ` [Bug fortran/67894] bounds of assumed-rank dummy argument not equal to actual argument dominiq at lps dot ens.fr
2015-10-09 12:23 ` john.donners at surfsara dot nl
2015-10-09 12:31 ` dominiq at lps dot ens.fr
2015-10-09 12:56 ` john.donners at surfsara dot nl
2015-10-09 13:00 ` dominiq at lps dot ens.fr
2015-10-09 13:03 ` john.donners at surfsara dot nl
2015-10-09 13:20 ` dominiq at lps dot ens.fr
2015-10-09 18:31 ` mikael at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).