This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [FORTRAN PATCH] Fix type punning problem in mio_array_ref
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Jan 2007 09:38:19 -0800
- Subject: Re: [FORTRAN PATCH] Fix type punning problem in mio_array_ref
- References: <1287.68.35.10.103.1169313279.squirrel@mail.eyesopen.com>
On Sat, Jan 20, 2007 at 10:14:39AM -0700, Roger Sayle wrote:
>
> 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.
>
OK, with one comment below.
> ! /* This is equivalent to "mio_integer ((int *) &ar->dimen_type[i]);". */
3 years from now someone might see this comment and change everything
back. Can you expand the comment to include a statement about the
type punning problem of the enumerated type?
> ! if (iomode == IO_OUTPUT)
> ! {
> ! for (i = 0; i < ar->dimen; i++)
--
Steve