This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50173] New: ICE when allocating derived type with allocatable component(s) and specifying lower bound
- From: "jpr at csc dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Aug 2011 04:54:22 +0000
- Subject: [Bug fortran/50173] New: ICE when allocating derived type with allocatable component(s) and specifying lower bound
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50173
Bug #: 50173
Summary: ICE when allocating derived type with allocatable
component(s) and specifying lower bound
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jpr@csc.fi
With the following piece of code, current trunk gfortran ICEs for me on a
i386-linux. The trobule must be only a few days old:
SUBROUTINE c(n)
INTEGER :: i,n
TYPE t
INTEGER, ALLOCATABLE :: g(:)
END TYPE t
TYPE(t), ALLOCATABLE :: buf(:)
ALLOCATE( buf(1:n) )
END SUBROUTINE c
works if:
a) using POINTER instead of ALLOCATABLE for g(:)
b) making upper bound constant: ALLOCATE(buf(1:4))
c) omitting the lower bound in allocation: ALLOCATE(buf(n))
As written produces this:
% gfortran -v -c t.f90
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/wrk/jpr/gcc-4.7/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,c++,fortran
--disable-bootstrap --prefix=/wrk/jpr/gcc-4.7 --with-gmp=/wrk/jpr/extralib
--with-mpfr=/wrk/jpr/extralib
Thread model: posix
gcc version 4.7.0 20110823 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=generic' '-march=pentiumpro'
/home/wrk/jpr/gcc-4.5/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.0/f951 t.f90
-quiet -dumpbase t.f90 -mtune=generic -march=pentiumpro -auxbase t -version
-fintrinsic-modules-path
/home/wrk/jpr/gcc-4.7/bin/../lib/gcc/i686-pc-linux-gnu/4.7.0/finclude -o
/tmp/cccpGv05.s
GNU Fortran (GCC) version 4.7.0 20110823 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-11), GMP
version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.7.0 20110823 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-11), GMP
version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Regards, Juha