[Bug fortran/80467] Function Without Arguments Fails to Generate Error When Declared Later
jeffrey.armstrong at approximatrix dot com
gcc-bugzilla@gcc.gnu.org
Tue May 2 13:32:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80467
--- Comment #5 from Jeffrey Armstrong <jeffrey.armstrong at approximatrix dot com> ---
It's actually easy to trigger the ICE with a small change. The following
causes an internal compiler error wiht GCC 6.3 under MinGW-W64:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
program noargs
implicit none
Print *, "Testing..."
Call TestArgs
Print *, "Done."
contains
Subroutine TestArgs
implicit none
Real::compareTo
Integer::i
compareTo = GetValue
do i=1,10
if(Real(i) > GetValue) Then
Print *, "bigger"
end if
end do
End Subroutine TestArgs
Function GetValue()
implicit none
Real::GetValue
GetValue = 3.0
End Function GetValue
end program noargs
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
In this case, the user is repeatedly and incorrectly calling GetValue without
arguments. The compiler output is:
test.f90:10:0:
Subroutine TestArgs
internal compiler error: in convert_move, at expr.c:268
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <...> for instructions.
Error(E42): Last command making (build\test.o) returned a bad status
Error(E02): Make execution terminated
More information about the Gcc-bugs
mailing list