From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12756 invoked by alias); 28 Jul 2013 16:45:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12663 invoked by uid 48); 28 Jul 2013 16:45:09 -0000 From: "shapero at uw dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/58007] ICE in free_pi_tree(): Unresolved fixup - resolve_fixups does not fixup component of __class_bsr_Bsr_matrix Date: Sun, 28 Jul 2013 16:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: major X-Bugzilla-Who: shapero at uw dot edu X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg01383.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58007 --- Comment #3 from shapero at uw dot edu --- (In reply to Tobias Burnus from comment #2) > Created attachment 30567 [details] > Reduced test case > > Reduced test case, which fails at least on my 86-64-gnu-linux system with a > recent GCC 4.9. Compile as: > > $ gfortran matrix.f90 ellpack.f90 bsr.f90 matrix_c.f90 > matrix_c.f90:4.8: > use bsr > 1 > Internal Error at (1): > free_pi_tree(): Unresolved fixup > > * * * > > The triggered assert is: > 221 free_pi_tree (pointer_info *p) > 222 { > 223 if (p == NULL) > 224 return; > 225 > 226 if (p->fixup != NULL) > 227 gfc_internal_error ("free_pi_tree(): Unresolved fixup"); > > For the failing case, one has: > > (gdb) p *p->fixup > $4 = {pointer = 0x1678e08, next = 0x16780a0} > > (gdb) p *p > $2 = {priority = 38379, left = 0x1609dd0, right = 0x1606b20, integer = 6, > type = P_COMPONENT, fixup = 0x1678f80, u = {pointer = 0x0, rsym = {sym = > 0x0, true_name = 0x0, module = 0x0, binding_label = 0x0, stfixup = 0x0, > symtree = 0x0, state = UNUSED, ns = 0, referenced = 0, renamed = 0, where = > {column = 0, line = 0, pos = 0}}, wsym = {sym = 0x0, state = UNREFERENCED}}} > > Here, *(p->fixup->pointer) == NULL and *p->fixup->next->pointer == NULL. > > > Debugging shows that p->fixup->pointer is the address of the "cp" argument > in the call to mio_pointer_ref in mio_component_ref for sym == > __class_bsr_Bsr_matrix and the component name "max_degreemio_pointer_ref". > > And p->fixup->next->pointer is sym='__class_bsr_Bsr_matrix' and component > name max_degreemio_pointer_ref > > (i.e. the same, except that "cp" has a different pointer address.) > > * * * > > read_cleanup takes care of resolve_fixups - but only for p->type == > P_SYMBOL. However, we have here a p->type == P_COMPONENT. I should have specified in my post but I'm using gfortran 4.7.2; your reduced test case also fails for me. Could it be due to the explicit shape of the return argument for bsr_get_neighbors? Also, in reply to your first comment: should I be getting a type mismatch error for the code I've written and my version of the compiler isn't working right, or is my code compliant and versions 4.8/4.9 have a problem?