Segfault with -fdump-parse-tree: type t end type type, extends(t) :: t2 end type t2 end
Confirmed and this is regression with repect to 4.4.0: [karma] f90/bug% gfc -fdump-parse-tree pr40045.f90 Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4) procedure name = MAIN__ symtree: MAIN__ Ambig 0 symbol MAIN__ (UNKNOWN 0)(PROGRAM UNKNOWN-INTENT PUBLIC UNKNOWN-PROC UNKNOWN SUBROUTINE) symtree: t Ambig 0 symbol t (UNKNOWN 0)(DERIVED UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC UNKNOWN) Procedure bindings: f951: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. PROCEDURE, [karma] f90/bug% [karma] f90/bug% gfc44 -fdump-parse-tree pr40045.f90 Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4) procedure name = MAIN__ symtree: MAIN__ Ambig 0 symbol MAIN__ (UNKNOWN 0)(PROGRAM UNKNOWN-INTENT PUBLIC UNKNOWN-PROC UNKNOWN SUBROUTINE) symtree: t Ambig 0 symbol t (UNKNOWN 0)(DERIVED UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC UNKNOWN) Procedure bindings: symtree: t2 Ambig 0 symbol t2 (UNKNOWN 0)(DERIVED UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC UNKNOWN) components: (t (DERIVED t) ()) Procedure bindings:
Regarding the segfault, valgrind shows: ==14376== Invalid read of size 1 ==14376== by 0x616A4F7: fprintf (in /lib64/libc-2.9.so) ==14376== by 0x4B4BF1: show_typebound (dump-parse-tree.c:693) The line is: fprintf (dumpfile, "PASS(%s)", st->n.tb->pass_arg); and the interesting question is: Why is it called? There are no type-bound procedures (and also no components [except of t2%t]. Thus why is if (!st->n.tb) return; not working? * * * Related problem: The following gives: show_code_node(): Bad statement code type t procedure(), nopass, pointer :: p end type t type(t) m !external bar !m%p => bar call m%p() end
(In reply to comment #2) > and the interesting question is: Why is it called? There are no type-bound > procedures (and also no components [except of t2%t]. If it's a regression it may be caused by Daniel's r146733 ("reworking type-bound procedures")?!? > Related problem: The following gives: show_code_node(): Bad statement code I will handle this in my PPC patch before committing.
Yes, that sounds like a problem caused by my patch; it did change the structure of storing the type-bounds, so maybe simply changing the if to the one shown by Tobias was wrong. I will look into this!
Subject: Bug 40045 Author: domob Date: Thu May 14 20:02:46 2009 New Revision: 147540 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147540 Log: 2009-05-14 Daniel Kraft <d@domob.eu> PR fortran/40045 * dump-parse-tree.c (show_typebound): Fix missing adaption to new type-bound procedure storage structure. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/dump-parse-tree.c
Fixed (not addressing the "related" part in comment #2, but Janus promised to work on it).