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)

-- 
           Summary: Bad fortran code causes ICE
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anton at samba dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20467

Reply via email to