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?

Reply via email to