RFC/Patch for PR fortran/17675
Paul Brook
paul@codesourcery.com
Tue Jan 4 22:41:00 GMT 2005
On Tuesday 04 January 2005 22:26, Steve Ellcey wrote:
> > From: ja2morri@csclub.uwaterloo.ca (James A. Morrison)
> >
> > Since you have everything aligned already, you could put an assert
> > in build_field like:
> > gcc_assert (known_align >= desired_align || !STRICT_ALIGNMENT);
>
> This patch doesn't gaurentee that everything is aligned so I don't think
> this assert would work, the code tries its best to align things but a
> given set of equivelences can result in data that cannot be completely
> aligned. Like:
>
> real r1(5)
> double precision d1, d2
> equivalence (r1(1), d1)
> equivalence (r1(2), d2)
>
> For machines where real is 4 byte aligned and 4 bytes in size and double
> precision is 8 byte aligned and 8 bytes in size, then either d1 or d2
> has to be misaligned.
We should throw an error in this case, like g77 does.
I'm working on your patch, but have hit some complications. I don't think your
patch is sufficient (there are cases like the above it misses), and there are
bugs in the existing implementation (when equivalences and common blocks are
combined).
Paul
More information about the Fortran
mailing list