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: Alignment of gfortran allocated arrays


On Tuesday 14 August 2007, François-Xavier Coudert wrote:

Hi,

> > 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?
>
> No, not that I know of at least.

I had the same problem a while ago (see link above) while working on the 
Cell architecture. It turned out that the -m64 switch solved my Problem. 
If that is not an option and you work on a system which supports 
$LD_PRELOAD or something similar, you could just preload your own 
malloc(), which allocates SIZE+16 Bytes and returns an "allocated" 
pointer. But be carefull, you also need to LD_PRELOAD a modified version 
of free().

Regards,
Timo


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