This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH,fortran]: fix bind(c) common block alignment
On Mon, Aug 06, 2007 at 11:17:01AM -0600, Christopher D. Rickett wrote:
>
> currently, the patch only changes the alignment if the common block is
> bind(c), which means the compiler should have already verified that the
> common block fields interop with C.
>
> as to why we weren't seeing it before, i do not know. the
> bind_c_coms.f90/bind_c_coms_driver.c illustrates on x86 linux that there
> is a difference in the alignment. the generated assembly shows it, but
> the linker didn't complain.
>
> if it is acceptable for all common blocks to choose a C compatible
> alignment, then the patch is trivial to change to do this. is that what
> people prefer?
>
One thing to keep in mind is derived types that appear in
common blocks. These have SEQUENCE, and I suspect the
current alignment guarantees that SEQUENCE gives expected
results.
--
Steve