This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25262] New: compiler dies, explicit interface, array valued function
- From: "jpr at csc dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2005 11:26:36 -0000
- Subject: [Bug fortran/25262] New: compiler dies, explicit interface, array valued function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi!
The test program (below) kills latest gfortran:
[jpr@dhcp-38 fem]$ gfortran -v test.f90
Driving: gfortran -v test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i386-linux
Configured with: ../gcc/configure --prefix=/tmp/gfortran-20051205/irun
--enable-languages=c,fortran --host=i386-linux
Thread model: posix
gcc version 4.2.0 20051205 (experimental)
/home/wrk/jpr/irun/bin/../libexec/gcc/i386-linux/4.2.0/f951 test.f90 -quiet
-dumpbase test.f90 -auxbase test -version -o /tmp/ccZbxhvU.s
GNU F95 version 4.2.0 20051205 (experimental) (i386-linux)
compiled by GNU C version 4.0.2 (Debian 4.0.2-2).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
test.f90: In function 'sub':
test.f90:14: internal compiler error: in gfc_trans_arrayfunc_assign, at
fortran/trans-expr.c:2637
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
platform:
uname --all
Linux dhcp-38.csc.fi 2.4.20-43.9.legacysmp #1 SMP Sat Apr 30 19:07:33 EDT 2005
i686 i686 i386 GNU/Linux
test program:
PROGRAM test
REAL, POINTER :: Quant(:)
REAL :: Ind(2)
INTERFACE
FUNCTION x_InsideResidual( Quant ) RESULT(Indicator)
REAL :: Quant(:), Indicator(2)
END FUNCTION x_InsideResidual
END INTERFACE
NULLIFY( Quant )
! print*, x_InsideResidual( Quant ) ! works
! ind = x_InsideResidual( Quant ); print*,ind ! works
CALL sub( Quant,x_InsideResidual )
CONTAINS
SUBROUTINE sub( Quant, InsideResidual )
REAL :: Quant(:)
INTERFACE
FUNCTION InsideResidual( Quant ) RESULT(Indicator)
REAL :: Quant(:), Indicator(2)
END FUNCTION InsideResidual
END INTERFACE
REAL :: Ind(2)
! EXTERNAL InsideResidual ! both cases below work, if you uncomment this.
! Other compilers seem to agree that you can't
have it...
ind = InsideResidual( Quant ); print*,Ind ! compiler dies
! print*,InsideResidual( Quant ) ! seg fault at runtime
END SUBROUTINE sub
END PROGRAM Test
FUNCTION x_InsideResidual( quant ) RESULT( Indicator )
REAL :: Quant(:), Indicator(2)
Indicator = 1.0d0
END FUNCTION x_InsideResidual
BTW. Great progress with gfortran in recent months!
Regards, Juha
--
Summary: compiler dies, explicit interface, array valued
function
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jpr at csc dot fi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25262