aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 1613a74..650942e 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -1913,8 +1913,25 @@ mio_array_ref (gfc_array_ref * ar)
gfc_internal_error ("mio_array_ref(): Unknown array ref");
}
- for (i = 0; i < ar->dimen; i++)
- mio_integer ((int *) &ar->dimen_type[i]);
+ /* Unfortunately, ar->dimen_type is an anonymous enumerated type so
+ we can't call mio_integer directly. Instead loop over each element
+ and cast it to/from an integer. */
+ if (iomode == IO_OUTPUT)
+ {
+ for (i = 0; i < ar->dimen; i++)
+ {
+ int tmp = (int)ar->dimen_type[i];
+ write_atom (ATOM_INTEGER, &tmp);
+ }
+ }
+ else
+ {
+ for (i = 0; i < ar->dimen; i++)
+ {
+ require_atom (ATOM_INTEGER);
+ ar->dimen_type[i] = atom_int;
+ }
+ }
if (iomode == IO_INPUT)
{