[Bug fortran/16861] segfault with doubly used module
paul dot richard dot thomas at cea dot fr
gcc-bugzilla@gcc.gnu.org
Thu Dec 2 10:38:00 GMT 2004
------- Additional Comments From paul dot richard dot thomas at cea dot fr 2004-12-02 10:38 -------
The 11th November still gives this behaviour. However, if the USE FOO is
raised to the module level, all is well. For example, this slightly expanded
version compiles and runs fine.
module FOO
integer :: I=2
end module FOO
module BAR
use FOO
contains
subroutine BAZ(J)
integer, dimension(I) :: J
print * ,"BAZ: size(j) =", size(J)
end subroutine BAZ
end module BAR
subroutine QUUS()
use FOO
use BAR
end subroutine QUUS
program test_mod
use FOO
USE BAR
integer, dimension(I) :: j
I=3
call BAZ(j)
call QUUS(2)
print * ,"MAIN: size(j) =", size(J)
end program test_mod
(In reply to comment #4)
> Confirmed. Here's a shorter testcase:
> =====================================
> module FOO
> integer :: I
> end module FOO
> module BAR
> contains
> subroutine BAZ(J)
> use FOO
> integer, dimension(I) :: J
> end subroutine BAZ
> end module BAR
> subroutine QUUS()
> use FOO
> use BAR
> end subroutine QUUS
> =====================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16861
More information about the Gcc-bugs
mailing list