This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make internal libgfortran I/O structure layout independent of -malign-double


On 1/27/07, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
On Fri, Jan 26, 2007 at 04:41:50PM -0800, Brooks Moses wrote:
> Fortran patches should be cc'ed to fortran@gcc.gnu.org.  Otherwise, the
> relevant maintainers are unlikely to notice them.
>

Thanks Brooks, I would not have seen this patch otherwise.

> Erik Schnetter wrote:
> >The enclosed patch ensures that the I/O parameter structures in
> >gfortran's run-time library have the same size and alignment,
> >independent of whether -malign-double is used or not, at least on
> >machines with 4-byte pointers which also have 8-byte integers
> >available.
> >
> >        PR fortran/30594
> >        * libgfortran/io/io.h: Permute struct members so that they
> >        remain aligned when -malign-double is used.
> >        * fortran/ioparm.def: Likewise.
> >        * testsuite/gfortran.dg/PR30594.f: New testcase.
> >

First, I agree with Andrew Pinski's assessment of the problem.
Second, the patch is incomplete because it breaks compatibility
with previous libraries, so you'll also need to bump the
shared library version.  Note the version number was changed
on 17 Jan 07 and I'm not to thrilled with possibly bumping for
this and then again when library version comes into the tree.

As long as we don't release we don't need to bump the library version. (At least that is what we've done in the past, like for the allocator interface change).

As of the patch it should use a proper align attribute to ensure
alignment and not rely on nobody screwing it up again.  Note
that if nothing guarantees at least 8 byte alignment of the
whole structure there is no guarantee that an intermediate
field is aligned if it is aligned versus to the struct start.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]