[EMAIL PROTECTED] cat radiimod.f90
module SortedRadii
implicit none
integer::Nr
real(kind=8),dimension(5)::aux2
contains
function GetEpsR(i) result (x)
integer,intent(in)::i
real(kind=8),dimension(Nr)::x
x=1
end function GetEpsR
end module SortedRadii
[EMAIL PROTECTED] gfortran -c radiimod.f90
[EMAIL PROTECTED] cat acmod.f90
module AC
use SortedRadii
implicit none
contains
function Emax(Jtot,j,omega) result (Em)
integer,intent(in)::Jtot,j,omega
real(kind=8)::Em
integer::n,ri
n=5
aux2(1:n)=GetEpsR(j)+(/(ri,ri=1,n)/)
end function Emax
end module
[EMAIL PROTECTED] gfortran -v -c acmod.f90
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=fortran
Thread model: posix
gcc version 4.2.0 20070501 (prerelease)
/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/f951 acmod.f90 -quiet
-dumpbase acmod.f90 -mtune=generic -auxbase acmod -version -I
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/finclude -o /tmp/ccDqZ5yW.s
GNU F95 version 4.2.0 20070501 (prerelease) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.2.0 20070501 (prerelease).
GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=112193
acmod.f90: In function emax:
acmod.f90:11: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:863
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
I suspect the problem comes from the fact that the size of the vector returned
by GetEpsR is comes from Nr in SortedRadii while the others come from n in AC.
(It's up to the caller to make sure these are the same before Emax is called.)
The ICE goes away if the 'n's in the aux2 assignment line are changed to 5s or
'Nr's.
--
Summary: ICE with arrays and vector valued functions from a used
module
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: terry at chem dot gu dot se
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32343