[Bug fortran/61928] a fortran90 program compiles on hopper at NERSC but not under gfortran 4.9.0

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Sat Aug 2 18:17:00 GMT 2014


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

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #7 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Jerry DeLisle from comment #6)
> My thinking, right or wrong, is that the code is invalid because idamax is
> defined as an integer which conflicts with the subroutine name.
                                                 ^^^^^^^^^^ internal procedure

> Ifort gives the exact same error. (Ifort also insists that the end
> statements for the function and subroutine state "end function" and "end
> subroutine" but that is a separate issue.)

Also NAG agrees with you.  And NAG is almost always right ;-)

I tend do believe that F2008 section 12.2.2 applies here:

- The declaration in subroutine dgefa makes it an *external* procedure,

- The subprogram in the scope of main makes it a *internal* procedure.

Note that:

"... Internal subprograms are the same as external subprograms except
that the name of the internal procedure is not a global identifier,
an internal subprogram shall not contain an ENTRY statement, and the
internal subprogram has access to host entities by host association."

So gfortran, Ifort and NAG are right and the original code is invalid.


More information about the Gcc-bugs mailing list