Re: gcc-10 Bug report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 05.10.19 um 15:12 schrieb Toon Moene:
On 10/3/19 10:01 PM, Thomas Koenig wrote:
If you use a slightly newer version, the error message will become
clearer:

sbdsvdx.f:777:39:

   420 |          CALL SCOPY( N, D, 1, WORK( IETGK ), 2 )
       |                              2
......
   777 |          CALL SCOPY( N*2, Z( 1,I ), 1, WORK, 1 )
       |                                       1
Fehler: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)

This is a violation of the Fortran standard by the Lapack code.
To allow this idiom, you can add the -fallow-argument-mismatch
argument to the OPTS variable in make.inc before building.

For simplicity I use the wording in the Fortran 77 Standard - I don't think subsequent Standards changed this or made it obsolescent.

<QUOTE>
15.9.3.3 Arrays as Dummy Arguments

Within a program unit, the array declarator given for an array provides all array declarator information needed for the array in an execution of the program unit. The number and size of dimensions in an actual argument array declarator may be different from the number and size of the dimensions in an associated dummy argument array declarator.

A dummy argument that is an array may be associated with an actual argument that is an array, array element, or array element substring.
<UNQUOTE>

Of course, you need to read much more of the F77 Standard to find the definitions of all these terms, but I think the last line quoted actually *allows* passing WORK( IETGK ) as an actual argument associated with an array dummy argument.

I wonder if this is still valid, and if the change (if any) is intentional.
From F18, 15.5.2.4 Ordinary dummy variables

14 If the actual argument is a noncoindexed scalar, the
corresponding dummy argument shall be scalar unless the actual
argument is default character, of type character with the
C character kind (18.2.2), or is an element or substring of an
element of an array that is not an assumed-shape, pointer, or
polymorphic array, the dummy argument has assumed-rank, or the
dummy argument is an assumed-type assumed-size array.
Hm, I think you're right.  I will submit a patch which corrects this.

Shoot me.

Aint gonna happen :-)

Thanks!

	Thomas





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux