http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49648
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-05 17:14:31 UTC --- At some point, the array spec seems to got lost: COMPLEX,SAVE,ALLOCATABLE::P(:) COMPLEX:: PM(SIZE(P),SIZE(P)) We have: (gdb) p expr->expr_type $1 = EXPR_VARIABLE (gdb) p expr->symtree->n.sym->name $2 = 0x2aaaaab42fb8 "p" (gdb) p expr->ref->type $4 = REF_ARRAY (gdb) p expr->ref->u.ar $5 = {type = AR_FULL, dimen = 0, [...] as = 0x0, [...]} And in gfc_walk_variable_expr's switch (ar->type): case AR_FULL: [...] newss->data.info.dimen = ar->as->rank; which is a NULL pointer access. The question is: Why is ar->as == NULL?