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

--- Comment #7 from G. Steinmetz <gs...@t-online.de> ---

Yes, call s(z) is valid in z1, but is necessary to trigger
the ICE somehow with -std=legacy and null().

Yes, 15.4.2.2(3) was it, explicit interface of the callee with
all the characteristics of that procedure(subr/func) and dummies.

Two things are mixed here.. The following is e.g. handled correctly,
with a different error, but rejected without an explicit interface:

$ cat z3.f90
program p
   call s(null())
end

$ cat z3c.f90
program p
   call s(null())
contains
   subroutine s(x)
      integer, pointer :: x
   end
end

$ cat z3i.f90
program p
   interface
      subroutine s(x)
         integer, pointer :: x
      end
   end interface
   call s(null())
end

$ gfortran -c z3c.f90
$ gfortran -c z3i.f90
$ gfortran -c z3.f90
z3.f90:2:10:

    2 |    call s(null())
      |          1
Error: MOLD argument to NULL required at (1)

Reply via email to