This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fortran, complex types, and STRICT_ALIGNMENT
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: James Morrison <ja2morri at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 12 Jan 2005 11:27:03 -0800
- Subject: Re: Fortran, complex types, and STRICT_ALIGNMENT
- References: <20050112132654.1B595A85A9@perpugilliam.csclub.uwaterloo.ca>
On Wed, Jan 12, 2005 at 08:26:54AM -0500, James Morrison wrote:
>
> Right now in fortran/iresolve.c it is assumed that complex types can
> be used in places where integers twice the size of an element in the
> complex number can be used.
This sounds odd to me, and may indicate a bug. Can you be
more specific with regards to a location where this
assumption applies?
As far as alignment and padding, the only requirement
in the Fortran standard is that sizeof(REAL) == sizeof(INTEGER)
and sizeof(COMPLEX) == 2 * sizeof(REAL) for the default
kinds. AFAIK, the standard does not mandate anything about the
actual layout in memory. If sizeof(REAL)=4 bytes, then sizeof(COMPLEX)
is 8 bytes, but those do not need to be 8 consecutive bytes in
memory.
--
Steve