This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69636] ICE(s) on using option -fmodule-private
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Feb 2016 18:07:46 +0000
- Subject: [Bug fortran/69636] ICE(s) on using option -fmodule-private
- Auto-submitted: auto-generated
- References: <bug-69636-4 at http dot gcc dot gnu dot org/bugzilla/>
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