Im no fortran coder but Im pretty sure this isnt valid: SUBROUTINE a(b) b(c) = 0 END SUBROUTINE a Using todays cvs: GNU Fortran 95 (GCC 4.0.0 20050313 (prerelease)) We ICE: /usr/local/ppc64-4.0/libexec/gcc/powerpc64-linux/4.0.0/f951 f.f90 -quiet -dumpbase f.f90 -m64 -auxbase f -version -o /tmp/cccadl1s.s (gdb) backtrace #0 resolve_formal_arglist (proc=0x105cfaa0) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/resolve.c:123 #1 0x10054bf0 in traverse_ns (st=0x105ba360, func=0x10041710 <find_arglists>) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/symbol.c:2298 #2 0x10054c18 in traverse_ns (st=0x105ba4f0, func=0x10041710 <find_arglists>) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/symbol.c:2301 #3 0x10046d9c in gfc_resolve (ns=0x105cf750) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/resolve.c:247 #4 0x1003db64 in gfc_parse_file () at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/parse.c:2612 #5 0x100570a8 in gfc_be_parse_file (set_yydebug=Variable "set_yydebug" is not available. ) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/fortran/f95-lang.c:265 #6 0x102d09c4 in toplev_main (argc=Variable "argc" is not available. ) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/toplev.c:996 #7 0x1007ae40 in main (argc=Variable "argc" is not available. ) at /scratch/anton/toolchain/new2/gcc-4.0/gcc/main.c:35 sym->result is NULL: (gdb) print sym->result $3 = (struct gfc_symbol *) 0x0 and line 123 is: /* Set the type of the RESULT, then copy. */ if (sym->result->ts.type == BT_UNKNOWN)
Confirmed, g77 gives the following error: t.f: In subroutine `a': t.f:1: SUBROUTINE a(b) 1 t.f:2: (continued): b(c) = 0 2 Invalid declaration of or reference to symbol `b' at (2) [initially seen at (1)]
Confirmed.
It looks like we try to evaluate b as a statement function, which is of course not valid. Investigating ...
Subject: Bug 20467 CVSROOT: /cvs/gcc Module name: gcc Changes by: tobi@gcc.gnu.org 2005-03-14 19:55:02 Modified files: gcc/fortran : ChangeLog symbol.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: stfunc_2.f90 Log message: fortran/ PR fortran/20467 * symbol.c (check_conflict): A dummy argument can't be a statement function. testsuite/ PR fortran/20467 * gfortran.dg/stfunc_2.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.352&r2=1.353 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&r1=1.26&r2=1.27 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5164&r2=1.5165 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/stfunc_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 20467 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tobi@gcc.gnu.org 2005-03-14 20:15:30 Modified files: gcc/fortran : ChangeLog symbol.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: stfunc_2.f90 Log message: fortran/ PR fortran/20467 * symbol.c (check_conflict): A dummy argument can't be a statement function. testsuite/ PR fortran/20467 * gfortran.dg/stfunc_2.f90: New test. 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.12&r2=1.335.2.13 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/symbol.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.26&r2=1.26.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.43&r2=1.5084.2.44 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/stfunc_2.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Fixed.