http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54668
Bug #: 54668 Summary: [ICE] with ALLOCATE statement in which the value and rank is determined by reference to another object Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: xarthisius...@gmail.com Hi, following code gives ICE: program ala integer, dimension(3) :: a integer, dimension(:), allocatable :: b a = [1,2,3] allocate(b, source=a) print *, b deallocate(b) end I'm not 100% sure it's valid code so I'll leave keywords blank (though it works with ifort-13.0). It gives ICE with all version of gfortran >=4.6, following backtrace: #0 0x00007ffff771b5de in __gmpz_set () from /usr/lib64/libgmp.so.10 #1 0x000000000059d9fc in conformable_arrays (e2=0x14fcd10, e1=0x14fd530) at gcc/fortran/resolve.c:7056 #2 resolve_allocate_expr (code=0x14fd780, e=0x14fcd10) at gcc/fortran/resolve.c:7222 #3 resolve_allocate_deallocate (code=code@entry=0x14fd780, fcn=<optimized out>, fcn@entry=0xe19de9 "ALLOCATE") at gcc/fortran/resolve.c:7614 #4 0x00000000005a1117 in resolve_code (code=0x14fd780, ns=ns@entry=0x14f9230) at gcc/fortran/resolve.c:9793 #5 0x00000000005a2a5f in resolve_codes (ns=ns@entry=0x14f9230) at gcc/fortran/resolve.c:14310 #6 0x000000000059310c in gfc_resolve (ns=0x14f9230) at gcc/fortran/resolve.c:14337 #7 0x0000000000588eab in resolve_all_program_units (gfc_global_ns_list=0x14f9230) at gcc/fortran/parse.c:4398 #8 gfc_parse_file () at gcc/fortran/parse.c:4665 #9 0x00000000005c4ce6 in gfc_be_parse_file () at gcc/fortran/f95-lang.c:191 #10 0x000000000093a96c in compile_file () at gcc/toplev.c:546 #11 0x000000000093c58a in do_compile () at gcc/toplev.c:1863 #12 toplev_main (argc=2, argv=0x7fffffffdec8) at gcc/toplev.c:1939 #13 0x00007ffff6c6a6e5 in __libc_start_main () from /lib64/libc.so.6 #14 0x000000000051d731 in _start () was produced with: Configured with: /var/tmp/portage/sys-devel/gcc-4.8.0_pre9999/work/gcc-4.8.0-9999/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-pre9999 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/python --enable-checking=yes --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.0_pre9999' Thread model: posix gcc version 4.8.0-pre9999 20120922 (experimental) commit f09a218261ba473738ad45f2c643957523019a17 (Gentoo 4.8.0_pre9999)