[Bug fortran/59450] [OOP] ICE for Array Valued Function combined with Deferred Specification Function
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 10 16:06:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59450
--- Comment #2 from janus at gcc dot gnu.org ---
Draft patch which fixes the error (not regtested):
Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c (revision 205857)
+++ gcc/fortran/module.c (working copy)
@@ -3358,12 +3358,24 @@ mio_expr (gfc_expr **ep)
{
e->value.function.name
= mio_allocated_string (e->value.function.name);
- flag = e->value.function.esym != NULL;
+ if (e->value.function.esym)
+ flag = 1;
+ else if (e->ref)
+ flag = 2;
+ else
+ flag = 0;
mio_integer (&flag);
- if (flag)
- mio_symbol_ref (&e->value.function.esym);
- else
- write_atom (ATOM_STRING, e->value.function.isym->name);
+ switch (flag)
+ {
+ case 1:
+ mio_symbol_ref (&e->value.function.esym);
+ break;
+ case 2:
+ mio_ref_list (&e->ref);
+ break;
+ default:
+ write_atom (ATOM_STRING, e->value.function.isym->name);
+ }
}
else
{
@@ -3372,10 +3384,15 @@ mio_expr (gfc_expr **ep)
free (atom_string);
mio_integer (&flag);
- if (flag)
- mio_symbol_ref (&e->value.function.esym);
- else
+ switch (flag)
{
+ case 1:
+ mio_symbol_ref (&e->value.function.esym);
+ break;
+ case 2:
+ mio_ref_list (&e->ref);
+ break;
+ default:
require_atom (ATOM_STRING);
e->value.function.isym = gfc_find_function (atom_string);
free (atom_string);
More information about the Gcc-bugs
mailing list