http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59941
--- Comment #7 from janus at gcc dot gnu.org --- Another variant with the same behavior (ICEs only with 4.7): module tao_random_numbers integer, dimension(10), private :: s_buffer integer, private :: s_buffer_end = size (s_buffer) end module module beam_structures private type :: beam_structure_t integer, dimension(:), allocatable :: smatrix contains procedure :: get_smatrix end type contains function get_smatrix (beam_structure) result (matrix) class(beam_structure_t), intent(in) :: beam_structure integer, dimension (size (beam_structure%smatrix)) :: matrix end function end module program p use tao_random_numbers use beam_structures end Everything in the modules is private, so the USE statements should not have any effect in principle. Btw, maybe a warning for all-private modules would be appropriate? A module without any public entities is not very useful, I guess ...