Alignment of gfortran allocated arrays

John Travers jtravs@gmail.com
Tue Aug 14 15:59:00 GMT 2007


Hi all,

Firstly thanks for all the great work on gfortran! It is shaping up to
be a really great compiler
and an essential alternative to expensive offerings from others,
especially for students like me.

Anyway, I'm trying to ensure that arrays I allocate in gfortran are 16
byte aligned for use with
fftw  < http://www.fftw.org/>. I notice that this issue was previously
discussed on this list:

http://gcc.gnu.org/ml/fortran/2007-05/msg00494.html

and the blame for sorting this out placed on libc malloc (via the bug report at:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24261

Has anything changed since this discussion? It didn't sound like the
libc guys were going to
change the default malloc behaviour. Has a compile switch been added
to ask for this or
perhaps an extension to gfortran to use one of the alternatives to
malloc which allows
alignment (posix_memalign or memalign)? If not, could one possibly be
added (I'll even try and
make up a patch, though I know nothing of gfortran internals and so it
may take me a while).
Basically is this issue likely to be solved or has it been solved in a
neat and official way, or
shall I go ahead and try and hack to get what I want.

Thanks for your time and help,
John Travers



More information about the Fortran mailing list