This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/58007] ICE -- free_pi_tree(): Unresolved fixup, depends on order of module inclusion


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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Created attachment 30567
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30567&action=edit
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]