This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16861] segfault with doubly used module
- From: "paul dot richard dot thomas at cea dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2004 10:38:36 -0000
- Subject: [Bug fortran/16861] segfault with doubly used module
- References: <20040803172636.16861.yosef@phys.utb.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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