This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/69636] ICE(s) on using option -fmodule-private


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

--- Comment #5 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
The ICE with  associate_6.f03  and  -fmodule-private
depends on including "implicit none" in main program :


$ cat z3.f90
module m
  private
contains
  pure function func (n) result (f)
    integer, intent(in) :: n
    integer :: f(n)
    f = 0.0
  end function
end module

program p
  use m
  implicit none
  associate (arr => func (4))
    print *, arr(1)
  end associate
end


$ gfortran-6 -c z3.f90
z3.f90:14:20:

   associate (arr => func (4))
                    1
Error: Function 'func' at (1) has no IMPLICIT type
z3.f90:14:28:

   associate (arr => func (4))
                            1
Error: Symbol 'arr' at (1) has no IMPLICIT type
f951: internal compiler error: find_array_spec(): Missing spec

---


$ cat z3b.f90
module m
  private
contains
  pure function func (n) result (f)
    integer, intent(in) :: n
    integer :: f(n)
    f = 0.0
  end function
end module

program p
  use m
! implicit none
  associate (arr => func (4))
    print *, arr(1)
  end associate
end


$ gfortran-6 -c z3b.f90
z3b.f90:14:28:

   associate (arr => func (4))
                            1
Error: Associate-name 'arr' at (1) is used as array

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]