aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2007-01-20 20:19:30 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2007-01-20 20:19:30 +0000
commit70fadd09be30c98ab6fccf3a97eede5f5c253c1e (patch)
tree6761c0a1edbdc2743b289ae4519f7e7a5a2004a7 /gcc/fortran
parentb01e2f88ef92c331a9df908212f7ec5ecd537908 (diff)
downloadgcc-70fadd09be30c98ab6fccf3a97eede5f5c253c1e.zip
gcc-70fadd09be30c98ab6fccf3a97eede5f5c253c1e.tar.gz
gcc-70fadd09be30c98ab6fccf3a97eede5f5c253c1e.tar.bz2
module.c (mio_array_ref): The dimen_type fields of an array ref are an enumerated type and can't be...
* module.c (mio_array_ref): The dimen_type fields of an array ref are an enumerated type and can't be read/written directly with a call to mio_integer. Instead loop over and cast each element. From-SVN: r121011
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/module.c21
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f13d6f8..c20c42c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
2007-01-20 Roger Sayle <roger@eyesopen.com>
+ * module.c (mio_array_ref): The dimen_type fields of an array ref
+ are an enumerated type and can't be read/written directly with a
+ call to mio_integer. Instead loop over and cast each element.
+
+2007-01-20 Roger Sayle <roger@eyesopen.com>
+
* dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL,
i.e. that the ARRAY_REF doesn't mention components.
* trans-array.c (gfc_constant_array_constructor_p): Export external
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)
{