This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fortran, patch] PR17741 ICE in gfc_free_namespace, at fortran/symbol.c:2208
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 28 Oct 2006 20:24:30 -0700
- Subject: [fortran, patch] PR17741 ICE in gfc_free_namespace, at fortran/symbol.c:2208
The attached patch is trivial. The refs count in current_ns was not being
bumped up for initial function declarations. So when an error occurs and we
bail out early, we were getting an assert in gfc_free_namespace when the
statement is rejected.
Putting the added line in gfc_match_function_decl () instead also solves the
problem.
Regression tested on i686-linux.
OK for 4.3?
Regards,
Jerry
2006-10-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/17741
* decl.c (get_proc_name): Bump current namespace refs count.
Index: decl.c
===================================================================
*** decl.c (revision 118121)
--- decl.c (working copy)
*************** get_proc_name (const char *name, gfc_sym
*** 642,647 ****
--- 642,648 ----
rc = gfc_get_symbol (name, gfc_current_ns->parent, result);
sym = *result;
+ gfc_current_ns->refs++;
if (sym && !sym->new && gfc_current_state () != COMP_INTERFACE)
{