------- Comment #1 from burnus at gcc dot gnu dot org 2008-11-01 22:38 ------- First valgrind error:
==21621== Invalid read of size 8 ==21621== at 0x46AAEA: gfc_resolve_expr (resolve.c:4248) That is: if (e->symtree == NULL || e->symtree->n.sym == NULL) I think e->expr_type == EXPR_FUNCTION, i.e. the access should be OK?!? Second valgrind error: ==21621== Address 0x65b2ef8 is 40 bytes inside a block of size 56 free'd ==21621== at 0x4C243AF: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==21621== by 0x482C6A: gfc_delete_symtree (symbol.c:2269) That's st0 = gfc_find_symtree (*root, name); st.name = gfc_get_string (name); gfc_delete_bbt (root, &st, compare_symtree); gfc_free (st0); // <<<< Line 2269 Seemingly, the recovery after detecting the error half deletes a symbol. I think the problem is the "foo" which exists not only as local symbol. Note: If one adds "IMPLICIT NONE" the ICE disappears. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37992