https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108369
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
Reduced testcase
PROGRAM FM509
IMPLICIT CHARACTER*27 (C)
CHARACTER C1N001(6)*10
DATA C1N001 /'FIRST-AID:','SECONDRATE','THIRD-TERM',
1 'FOURTH-DAY','FIFTHROUND','SIXTHMONTH'/
CVCOMP = ' '
CALL SN512(C1N001(5)(2:9),CVCOMP)
END
SUBROUTINE SN512(C1D001,CVD001)
CHARACTER C1D001(6)*8,CVD001*8
CVD001 = C1D001(1)
END
gfcx -w -o z y.f
y.f:10:17:
10 | CALL SN512(C1N001(5)(2:9),CVCOMP)
| 1
Error: Actual argument contains too few elements for dummy argument 'c1d001'
(19/48) at (1)
Normally, this comes down to type, kind type parameter, and rank (TKR)
matching of the actual and dummy arguments.
In the call to sn512, c1n001(5)(2:9) is a substring of length
8 of the fifth element of the array c1n001. The subroutine is
expecting to receive a 6-element array with each element having
a length of 8.
15.5.2.4 Ordinary dummy variables
...
The dummy argument shall be type compatible with the actual
argument.
...
The kind type parameter values of the actual argument shall
agree with the corresponding ones of the dummy argument. The
length type parameter values of a present actual argument shall
agree with the corresponding ones of the dummy argument that
are not assumed, except for the case of the character length
parameter of an actual argument of type character with default
kind or C character kind (18.2.2) associated with a dummy
argument that is not assumed-shape or assumed-rank.
3.147.11
type compatible
compatibility of the type of one entity with respect to another for
purposes such as argument association, pointer association, and
allocation (7.3.2)
Hmmm, it appears the argument mismatch feature added under the
-fallow-argmument-mismatch option might be running afoul of the
standard.