public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58356] New: ICE with finalization and type extension
@ 2013-09-07 20:20 abensonca at gmail dot com
  2013-09-15 11:41 ` [Bug fortran/58356] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: abensonca at gmail dot com @ 2013-09-07 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58356
           Summary: ICE with finalization and type extension
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abensonca at gmail dot com

The following causes an ICE in gfortran 4.9.0:

module ct
  type :: cfl
   contains
     final :: cfld
  end type cfl
  type, extends(cfl) :: cfde
   contains
  end type cfde
contains
  subroutine cfld(self)
    implicit none
    type(cfl), intent(inout) :: self    
    return
  end subroutine cfld
end module ct

$ gfortran -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-trunk/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/opt/gcc-trunk
--enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 4.9.0 20130808 (experimental) (GCC) 

$ gfortran -c bug.F90 -o bug.o
f951: internal compiler error: Segmentation fault
0x97d66f crash_signal
        ../../gcc-trunk/gcc/toplev.c:335
0x51dd10 generate_finalization_wrapper
        ../../gcc-trunk/gcc/fortran/class.c:1950
0x51dd10 gfc_find_derived_vtab(gfc_symbol*)
        ../../gcc-trunk/gcc/fortran/class.c:2398
0x51fc87 gfc_is_finalizable(gfc_symbol*, gfc_expr**)
        ../../gcc-trunk/gcc/fortran/class.c:2464
0x5954a7 resolve_fl_derived0
        ../../gcc-trunk/gcc/fortran/resolve.c:12368
0x594fcf resolve_fl_derived0
        ../../gcc-trunk/gcc/fortran/resolve.c:11992
0x594fcf resolve_fl_derived0
        ../../gcc-trunk/gcc/fortran/resolve.c:11980
0x59683f resolve_fl_derived0
        ../../gcc-trunk/gcc/fortran/resolve.c:12402
0x59683f resolve_fl_derived
        ../../gcc-trunk/gcc/fortran/resolve.c:12425
0x591559 resolve_symbol
        ../../gcc-trunk/gcc/fortran/resolve.c:12695
0x5a8133 do_traverse_symtree
        ../../gcc-trunk/gcc/fortran/symbol.c:3571
0x594582 resolve_types
        ../../gcc-trunk/gcc/fortran/resolve.c:14400
0x590430 gfc_resolve
        ../../gcc-trunk/gcc/fortran/resolve.c:14497
0x57d0af gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.c:4645
0x5b8ce5 gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

I can't currently test this with the most recent revision of gfortran due to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58350


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58356] ICE with finalization and type extension
  2013-09-07 20:20 [Bug fortran/58356] New: ICE with finalization and type extension abensonca at gmail dot com
@ 2013-09-15 11:41 ` burnus at gcc dot gnu.org
  2013-09-15 12:09 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-09-15 11:41 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Segfaults at:

    at ../../gcc/fortran/class.c:1884
1884              if (fini->proc_tree->n.sym->attr.elemental)

The problem is that fini != NULL but fini->proc_tree == NULL. Note that:
fini->proc_sym->name is available with the name cfld


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58356] ICE with finalization and type extension
  2013-09-07 20:20 [Bug fortran/58356] New: ICE with finalization and type extension abensonca at gmail dot com
  2013-09-15 11:41 ` [Bug fortran/58356] " burnus at gcc dot gnu.org
@ 2013-09-15 12:09 ` dominiq at lps dot ens.fr
  2013-09-16 18:02 ` burnus at gcc dot gnu.org
  2013-09-16 18:02 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-09-15 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-15
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed at revision 202590.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58356] ICE with finalization and type extension
  2013-09-07 20:20 [Bug fortran/58356] New: ICE with finalization and type extension abensonca at gmail dot com
  2013-09-15 11:41 ` [Bug fortran/58356] " burnus at gcc dot gnu.org
  2013-09-15 12:09 ` dominiq at lps dot ens.fr
@ 2013-09-16 18:02 ` burnus at gcc dot gnu.org
  2013-09-16 18:02 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-09-16 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Mon Sep 16 18:01:59 2013
New Revision: 202633

URL: http://gcc.gnu.org/viewcvs?rev=202633&root=gcc&view=rev
Log:
2013-09-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58356
        * class.c (generate_finalization_wrapper): Init proc_tree if
        not yet resolved.

2013-09-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58356
        * gfortran.dg/finalize_19.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/finalize_19.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/class.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/58356] ICE with finalization and type extension
  2013-09-07 20:20 [Bug fortran/58356] New: ICE with finalization and type extension abensonca at gmail dot com
                   ` (2 preceding siblings ...)
  2013-09-16 18:02 ` burnus at gcc dot gnu.org
@ 2013-09-16 18:02 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-09-16 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on the trunk (4.9) [no branch affected].

Thanks for the report!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-16 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-07 20:20 [Bug fortran/58356] New: ICE with finalization and type extension abensonca at gmail dot com
2013-09-15 11:41 ` [Bug fortran/58356] " burnus at gcc dot gnu.org
2013-09-15 12:09 ` dominiq at lps dot ens.fr
2013-09-16 18:02 ` burnus at gcc dot gnu.org
2013-09-16 18:02 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).