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

2016-11-16 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44064

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.6.0

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

2010-08-05 Thread mikael at gcc dot gnu dot org


--- Comment #15 from mikael at gcc dot gnu dot org  2010-08-05 21:08 ---
Subject: Bug 44064

Author: mikael
Date: Thu Aug  5 21:08:36 2010
New Revision: 162921

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162921
Log:
2010-08-05  Mikael Morin  mik...@gcc.gnu.org
Janus Weil  ja...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
PR fortran/45151
* intrinsic.c (gfc_get_intrinsic_sub_symbol): Commit changed symbol. 
* symbol.c (gen_cptr_param, gen_fptr_param, gen_shape_param,
gfc_copy_formal_args, gfc_copy_formal_args_intr,
gfc_copy_formal_args_ppc, generate_isocbinding_symbol): Ditto.
(gfc_find_derived_vtab): Commit newly created symbols.
* parse.c (parse_derived_contains, parse_spec, parse_progunit): 
Call reject_statement in case of error. 
(match_deferred_characteritics): Call gfc_undo_symbols in case match
fails.


Modified:
branches/gcc-4_5-branch/gcc/fortran/ChangeLog
branches/gcc-4_5-branch/gcc/fortran/intrinsic.c
branches/gcc-4_5-branch/gcc/fortran/parse.c
branches/gcc-4_5-branch/gcc/fortran/symbol.c


-- 


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



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

2010-08-04 Thread janus at gcc dot gnu dot org


--- Comment #11 from janus at gcc dot gnu dot org  2010-08-04 12:17 ---
At r162860, I see only one problem left: A linker error (undefined reference to
`vtab$inner.1582') on the following variation of comment #5/#6:


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) :: this
end subroutine
end module

module module_mysubclass
implicit none
integer :: shit = 5
contains
subroutine init()
use module_myclass, only : myclass
type(myclass) :: this
call this%slice%set() ! XXX PROBLEM HERE
shit = shit + 1
end subroutine
end module

program test
end


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-05-15 20:02:24 |2010-08-04 12:17:08
   date||


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



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

2010-08-04 Thread mikael at gcc dot gnu dot org


--- Comment #12 from mikael at gcc dot gnu dot org  2010-08-04 14:17 ---
Subject: Bug 44064

Author: mikael
Date: Wed Aug  4 14:17:31 2010
New Revision: 162865

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162865
Log:
2010-08-04  Mikael Morin  mik...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
* symbol.c (changed_syms): Made static again.
(gfc_symbol_state): Don't conditionalize on GFC_DEBUG. 
Changed conditional internal error into assert.
Rename function to ...
(gfc_enforce_clean_symbol_state): ... this.
* gfortran.h (gfc_symbol_state, gfc_enforce_clean_symbol_state): 
Rename the former to the latter.
* parse.c (decode_statement, decode_omp_directive,
decode_gcc_attribute): Update callers accordingly. Don't conditionalize
on GFC_DEBUG.
(changed_syms): Remove declaration.
(next_statement): Use gfc_enforce_clean_symbol_state.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/symbol.c


-- 


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



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

2010-08-04 Thread janus at gcc dot gnu dot org


--- Comment #13 from janus at gcc dot gnu dot org  2010-08-04 19:49 ---
Subject: Bug 44064

Author: janus
Date: Wed Aug  4 19:49:19 2010
New Revision: 162879

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162879
Log:
2010-08-04  Janus Weil  ja...@gcc.gnu.org

PR fortran/42207
PR fortran/44064
PR fortran/44065
* class.c (gfc_find_derived_vtab): Do not generate vtabs for class
container types. Do not artificially increase refs. Commit symbols one
by one.
* interface.c (compare_parameter): Make sure vtabs are present before
generating module variables.
* resolve.c (resolve_allocate_expr): Ditto.


2010-08-04  Janus Weil  ja...@gcc.gnu.org

PR fortran/42207
PR fortran/44064
PR fortran/44065
* gfortran.dg/class_25.f03: New.
* gfortran.dg/class_26.f03: New.

Added:
trunk/gcc/testsuite/gfortran.dg/class_25.f03
trunk/gcc/testsuite/gfortran.dg/class_26.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/class.c
trunk/gcc/fortran/interface.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


-- 


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



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

2010-08-04 Thread janus at gcc dot gnu dot org


--- Comment #14 from janus at gcc dot gnu dot org  2010-08-04 19:57 ---
Comment #11 is fixed with r162879. I think we can finally close this one.


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



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

2010-08-02 Thread mikael at gcc dot gnu dot org


--- Comment #10 from mikael at gcc dot gnu dot org  2010-08-02 15:31 ---
Subject: Bug 44064

Author: mikael
Date: Mon Aug  2 15:30:47 2010
New Revision: 162821

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162821
Log:
2010-08-02  Mikael Morin  mik...@gcc.gnu.org
Janus Weil  ja...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
PR fortran/45151
* intrinsic.c (gfc_get_intrinsic_sub_symbol): Commit changed symbol. 
* symbol.c (gen_cptr_param, gen_fptr_param, gen_shape_param,
gfc_copy_formal_args, gfc_copy_formal_args_intr,
gfc_copy_formal_args_ppc, generate_isocbinding_symbol): Ditto.
* parse.c (parse_derived_contains, parse_spec, parse_progunit): 
Call reject_statement in case of error. 
(match_deferred_characteritics): Call gfc_undo_symbols in case match
fails.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/symbol.c


-- 


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



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

2010-07-31 Thread mikael at gcc dot gnu dot org


--- Comment #9 from mikael at gcc dot gnu dot org  2010-07-31 10:27 ---
Subject: Bug 44064

Author: mikael
Date: Sat Jul 31 10:27:36 2010
New Revision: 162776

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162776
Log:
2010-07-31  Mikael Morin  mik...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
* symbol.c (changed_syms): Made non-static.
* parse.c (changed_syms): Declare new external. 
(next_statement): Assert changed_syms is NULL at the beginning.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/symbol.c


-- 


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



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

2010-07-29 Thread mikael at gcc dot gnu dot org


--- Comment #7 from mikael at gcc dot gnu dot org  2010-07-29 11:23 ---
Subject: Bug 44064

Author: mikael
Date: Thu Jul 29 11:22:40 2010
New Revision: 162674

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162674
Log:
2010-07-29  Mikael Morin  mik...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
* class.c (gfc_find_derived_vtab): Accept or discard newly created
symbols before returning.

2010-07-29  Mikael Morin  mik...@gcc.gnu.org

PR fortran/42051
PR fortran/44064
* gfortran.dg/pr42051.f03: New testcase.


Added:
trunk/gcc/testsuite/gfortran.dg/pr42051.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/class.c
trunk/gcc/testsuite/ChangeLog


-- 


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



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

2010-07-29 Thread mikael at gcc dot gnu dot org


--- Comment #8 from mikael at gcc dot gnu dot org  2010-07-29 11:55 ---
With the link error being tracked as PR44065, I'm tempted to say that this is a
duplicate of PR42051.


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to work||4.6.0


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



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

2010-05-17 Thread janus at gcc dot gnu dot org


--- Comment #6 from janus at gcc dot gnu dot org  2010-05-17 21:02 ---
Another slight variation:


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) :: this
end subroutine
end module

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

program test
end


For this I get:

/tmp/ccsEnCku.o: In function `__module_mysubclass_MOD_init':
c5.f90:(.text+0x15): undefined reference to `vtab$inner.1570'
c5.f90:(.text+0x21): undefined reference to `vtab$inner.1570'
c5.f90:(.text+0x2a): undefined reference to `vtab$inner.1570'


I have no clue about the origin of this PR's failures yet, though I suspect
they're somehow related to the use, only clause. Removing the only kills
the errors.


-- 


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



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

2010-05-15 Thread janus at gcc dot gnu dot org


--- 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.
0x00550bb7 in gfc_find_symtree (st=0x1711, name=0x77f2aec0
vtype$inner) at /home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2393
2393  c = strcmp (name, st-name);
(gdb) bt
#0  0x00550bb7 in gfc_find_symtree (st=0x1711, name=0x77f2aec0
vtype$inner) at /home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2393
#1  0x00550b62 in gfc_delete_symtree (root=0x17af7e0,
name=0x77f2aec0 vtype$inner) at
/home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2374
#2  0x005517bd in gfc_undo_symbols () at
/home/jweil/gcc46/trunk/gcc/fortran/symbol.c:2845
#3  0x005139fd in decode_statement () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:271
#4  0x0051522c in next_free () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:722
#5  0x005155fc in next_statement () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:907
#6  0x0051999d in gfc_parse_file () at
/home/jweil/gcc46/trunk/gcc/fortran/parse.c:4220
#7  0x0055a36b in gfc_be_parse_file (set_yydebug=0) at
/home/jweil/gcc46/trunk/gcc/fortran/f95-lang.c:239
#8  0x00a1539f in compile_file () at
/home/jweil/gcc46/trunk/gcc/toplev.c:1049
#9  0x00a1769d in do_compile () at
/home/jweil/gcc46/trunk/gcc/toplev.c:2393
#10 0x00a17773 in toplev_main (argc=2, argv=0x7fffe2f8) at
/home/jweil/gcc46/trunk/gcc/toplev.c:2435
#11 0x005e262c in main (argc=2, argv=0x7fffe2f8) 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|-00-00 00:00:00 |2010-05-15 20:02:24
   date||


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



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

2010-05-11 Thread burnus at gcc dot gnu dot org


--- Comment #4 from burnus at gcc dot gnu dot org  2010-05-11 07:23 ---
(Cross reference: PR 44065 is the same, except using two files, which leads to
a linking error instead of an ICE.)

I get - as written at http://gcc.gnu.org/ml/fortran/2010-05/msg00099.html:

hjf.f90:37:0: internal compiler error: Segmentation fault

(37 is the XXX line.) valgrind shows:

==17205== Invalid read of size 8
==17205==at 0x53F166: gfc_delete_symtree (symbol.c:2374)
==17205==by 0x540176: gfc_undo_symbols (symbol.c:2845)
==17205==by 0x510786: decode_statement (parse.c:271)
==17205==by 0x511C8C: next_statement (parse.c:722)
==17205==by 0x5155DB: gfc_parse_file (parse.c:4220)
==17205==by 0x54CB27: gfc_be_parse_file (f95-lang.c:239)
==17205==by 0x8383A2: toplev_main (toplev.c:1053)
==17205==by 0x5EA1B7C: (below main) (in /lib64/libc-2.11.1.so)


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code


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



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

2010-05-10 Thread janus at gcc dot gnu dot org


--- Comment #3 from janus at gcc dot gnu dot org  2010-05-10 21:59 ---
For me, compiling the code in comment #0 in a single file seems to get stuck in
an endless loop (trunk rev. 159217 on x86_64-unknown-linux-gnu).


-- 


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