Bug ID: 85352
           Summary: Incorrect error diagnosed for dummy argument used in
                    specification expression to subprogram with ENTRY
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot
          Reporter: mecej4 at outlook dot com
  Target Milestone: ---

Created attachment 43912
fortran free form source code

There are some old codes (e.g., RMAT SWMOL3 - Molecule-Sweden code) in which
there are subroutines with ENTRY statements. A dummy argument to the ENTRY name
is allowed in specification expressions; F2003 says:

"If a dummy argument is used in a specification expression to specify an array
bound or character length of an object, the appearance of the object in a
statement that is executed during a procedure reference is permitted only if
the dummy argument appears in the dummy argument list of the procedure name
referenced and it is present ("

I constructed the example code to mimic the SWMOL3 code .

G95, Intel Fortran 18 and Lahey-Fujitsu 7.1 compile the example code with no
error messages. Gfortran 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC) says:

"sh-4.4$ gfortran -c bug.f90                                                  

       CALL acomp(Sabb,nuca)                                                 
Error: Variable 'nuc1', used in a specification expression, is referenced at
(1) before the ENTRY statement in which it is a parameter bug.f90:17:27: "

Reply via email to