https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80467
--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> ---
The code is properly rejected e.g. by the Intel compiler:
pr80467.f90(16): error #6423: This name has already been used as an external
function name. [GETVALUE]
compareTo = GetValue
--------------------^
pr80467.f90(18): error #8497: Illegal use of a procedure name in an expression,
possibly a function call missing parenthesis. [GETVALUE]
if(Real(i) > GetValue) Then
-------------------------^
compilation aborted for pr80467.f90 (code 1)
or by the Sun compiler:
compareTo = GetValue
^
"pr80467.f90", Line = 16, Column = 21: ERROR: This reference to function
GETVALUE without an actual argument list is illegal.
if(Real(i) > GetValue) Then
^
"pr80467.f90", Line = 18, Column = 26: ERROR: This reference to function
GETVALUE without an actual argument list is illegal.
f90comp: 32 SOURCE LINES
f90comp: 2 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI
Thus: ICE on invalid code.
Personal recommendation: always use multiple compilers for enhanced checking
during code development.