------- Comment #5 from stevenj at alum dot mit dot edu 2007-02-01 23:00 ------- (In reply to comment #4) > This is really a glibc bug and needs to be fixed. The C standard says that > malloc allocates that the right alignment so this is a glibc bug.
The C standard does not cover SIMD instructions, so it is not a violation of the C standard for malloc to return 8-byte aligned memory (which works fine with all standard C code). Moreover, in C there is the memalign function if you want to allocate aligned memory, whereas in Fortran you seem to be out of luck. This is especially sad since numerical code is the main application of Fortran, and SIMD instructions are important for maximum numerical performance on all recent x86 architectures. Note that xlf provides a -qipa=malloc16 flag to make allocations 16-byte aligned; I haven't been able to find out what ifort does, but I'm sure it either does 16-byte alignment of allocate by default or provides a flag, since that's needed to call their own MKL libraries. Moral: gfortran should either provide a compiler flag to make allocate 16-byte aligned, or do it by default, or provide a non-standard allocate function. You can't push this problem off on glibc. -- stevenj at alum dot mit dot edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stevenj at alum dot mit dot | |edu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24261