[Bug fortran/44064] [OOP] ICE with file containing two modules and one program

janus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat May 15 20:02:00 GMT 2010



------- Comment #5 from janus at gcc dot gnu dot org  2010-05-15 20:02 -------
Here is a slightly reduced test case:


module module_myclass
    implicit none
    type :: inner
    contains
        procedure :: set
    end type
    type :: myclass
        type(inner) :: slice
    end type
contains
    subroutine set(this)
        class(inner), intent(inout) :: this
    end subroutine set
end module module_myclass

module module_mysubclass
    use module_myclass, only : myclass
    implicit none
contains
    subroutine init(this)
        class(myclass), intent(inout) :: this
        call this%slice%set() ! XXX PROBLEM HERE
    end subroutine init
end module module_mysubclass

program test
    use module_mysubclass
    implicit none
end program


For this I get a segfault with the following backtrace:


Program received signal SIGSEGV, Segmentation fault.
0x0000000000550bb7 in gfc_find_symtree (st=0x1711, name=0x7ffff7f2aec0
"vtype$inner") at /home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2393
2393          c = strcmp (name, st->name);
(gdb) bt
#0  0x0000000000550bb7 in gfc_find_symtree (st=0x1711, name=0x7ffff7f2aec0
"vtype$inner") at /home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2393
#1  0x0000000000550b62 in gfc_delete_symtree (root=0x17af7e0,
name=0x7ffff7f2aec0 "vtype$inner") at
/home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2374
#2  0x00000000005517bd in gfc_undo_symbols () at
/home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2845
#3  0x00000000005139fd in decode_statement () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:271
#4  0x000000000051522c in next_free () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:722
#5  0x00000000005155fc in next_statement () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:907
#6  0x000000000051999d in gfc_parse_file () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:4220
#7  0x000000000055a36b in gfc_be_parse_file (set_yydebug=0) at
/home/jweil/gcc46/trunk/gcc/fortran/f95-lang.c:239
#8  0x0000000000a1539f in compile_file () at
/home/jweil/gcc46/trunk/gcc/toplev.c:1049
#9  0x0000000000a1769d in do_compile () at
/home/jweil/gcc46/trunk/gcc/toplev.c:2393
#10 0x0000000000a17773 in toplev_main (argc=2, argv=0x7fffffffe2f8) at
/home/jweil/gcc46/trunk/gcc/toplev.c:2435
#11 0x00000000005e262c in main (argc=2, argv=0x7fffffffe2f8) at
/home/jweil/gcc46/trunk/gcc/main.c:35


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-15 20:02:24
               date|                            |


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



More information about the Gcc-bugs mailing list