The attached source file, when compiled with GNU Fortran 95 (GCC 4.1.0 20050715 (experimental)) /home/eschnett/gcc /bin/gfortran -ftrapv -fwrapv -march=pentium4 -malign-double -g3 -Wall -Wshadow -c -o HarmExactEvol_ExactADM.F90.o HarmExactEvol_ExactADM.f90 leads to the error message /home/eschnett/Calpha/Cactus/arrangements/Abigel/HarmExactEvol/src/HarmExactEvol _ExactADM.F90:154: internal compiler error: tree check: expected class 'type', h ave 'exceptional' (^O¶ÂÁà^F^E<80><9B><80>x ^A^O<85>0^B) in build_array_type , at tree.c:4845 Note that the error message itself is corrupted.
Created attachment 9281 [details] Failing gzipped source code
Confirmed. There seems to be some memory corruption. With the command line arguments "--param ggc-min-expand=0 --param ggc-min-heapsize=0" I get a plain segfault. The segfault can be reproduced with the following testcase (compile with "gfortran --param ggc-min-expand=0 --param ggc-min-heapsize=0"): ======================================== subroutine FOO end subroutine FOO subroutine BAR integer :: I if (any ((/ I /) .eq. 0) ) I = 0 end subroutine BAR ======================================== The problem appeared in gcc 4.0.1 (reduced and original testcase). Btw, one has to strip the "use" commands from the original testcase in order to compile it.
The "ANY" function isn't the culprit. Building arrays with (/ /) causes the problem: ======================= subroutine FOO end subroutine FOO subroutine BAR integer :: J(1) J = (/ 1 /) end subroutine BAR =======================
Zdenek, this was caused by your patch http://gcc.gnu.org/ml/fortran/2005-05/msg00178.html Could you please have a look?
Steven, your patch http://gcc.gnu.org/ml/gcc-cvs/2005-07/msg01042.html seems to fix this PR on mainline. Is this an appropriate fix for the 4.0 branch, too? Would you mind adding a testcase? Btw, your patch changes trans-types.c, but the ChangeLog does not mention the change. Could you please fix that?
Fortran is not release-critical; removing target milestone.
Taking care of the backport to the 4.0 branch.
Subject: Bug 22502 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: reichelt@gcc.gnu.org 2005-09-10 21:40:00 Modified files: gcc/fortran : ChangeLog trans-types.h Log message: PR fortran/22502 Backport: 2005-07-29 Steven Bosscher <stevenb@suse.de> * trans-types.h (gfc_array_range_type): Add missing GTY decl for this. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.116&r2=1.335.2.117 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-types.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.9&r2=1.9.14.1
Now also fixed on the 4.0 branch.