[Bug fortran/32801] USE of ISO_C_BINDING, ONLY: C_LOC causes compiler seg fault

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jul 18 11:24:00 GMT 2007



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-07-18 11:24 -------
Backtrace on x86_64-linux:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000459311 in resolve_symbol (sym=0xf0bb90)
    at ../../../trunk3/gcc/fortran/resolve.c:7284
7284      if (sym->ts.type == BT_DERIVED && sym->ts.derived->components == NULL
(gdb) where
#0  0x0000000000459311 in resolve_symbol (sym=0xf0bb90)
    at ../../../trunk3/gcc/fortran/resolve.c:7284
#1  0x0000000000463d87 in traverse_ns (st=0xf09930, 
    func=0x458a90 <resolve_symbol>)
    at ../../../trunk3/gcc/fortran/symbol.c:2846
#2  0x0000000000455480 in resolve_types (ns=0xf0ae80)
    at ../../../trunk3/gcc/fortran/resolve.c:8330
#3  0x0000000000458a6d in gfc_resolve (ns=0xf0bb90)
    at ../../../trunk3/gcc/fortran/resolve.c:8409
#4  0x000000000044b528 in gfc_parse_file ()

(gdb) p sym->ts
$3 = {type = BT_DERIVED, kind = 0, derived = 0x0, cl = 0x0, is_c_interop = 0, 
  is_iso_c = 0, f90_type = BT_UNKNOWN}

sym->ts has type BT_DERIVED, but yet sym->ts.derived is NULL. Maybe this should
be set earlier, or maybe the test on (sym->ts.type == BT_DERIVED &&
sym->ts.derived->components == NULL) just needs changing into (sym->ts.type ==
BT_DERIVED && sym->ts.derived && sym->ts.derived->components == NULL).

Christopher, any idea if this sym node is correct?


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-07-18 05:44:38         |2007-07-18 11:24:34
               date|                            |


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



More information about the Gcc-bugs mailing list