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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.8.0

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-31 
06:19:12 UTC ---
I think one needs something like the following. It needs some refining as the
symtree name might be mangled for modules (_<serial>_<common name>, cf.
match.c's gfc_get_common).

--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2890,6 +2890,9 @@ gfc_undo_symbols (void)
                 needs to be removed to stop the resolver looking
                 for a (possibly) dead symbol.  */

+             if (p->common_block->head == p && !p->common_next)
+               gfc_delete_symtree (&p->ns->common_root,
p->common_block->name);
+
              if (p->common_block->head == p)
                p->common_block->head = p->common_next;
              else

Reply via email to