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

           Summary: support ATTRIBUTES ALIGN in gfortran
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: stev...@alum.mit.edu


Please add support for a ATTRIBUTES ALIGN compiler directive to gfortran,
similar to the Intel Fortran compiler:
  
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/fortran/mac/lref_for/source_files/rfattali.htm

Note in particular that this should also apply to allocatable arrays:
   http://software.intel.com/en-us/forums/showthread.php?t=78361

Currently, there is no way to allocate 16-byte or 32-byte aligned memory in
gfortran.  16-byte aligned memory is needed for SSE/SSE2, and 32-byte aligned
memory is needed for upcoming AVX instructions.   This means that allocated
memory cannot be passed to optimized SIMD routines written in low-level
languages.

It seems reasonable to follow Intel's lead here rather than to invent an
incompatible GNU extension.

Note that Bug #41209 (which requests even more complete ATTRIBUTE support,
including ALIGN) depends on this one.

Previously, Bug #24261, which requested a way to get 16-byte alignment, was
closed based on the erroneous assertion that this is a glibc/malloc bug.  This
is false, because no standard C type requires more than 8-byte alignment (on
both 32-bit and 64-bit machines).  Hopefully this is even more obvious now that
there is a need in numerics for 32-byte alignment (AVX instructions), which is
even farther from requirements of standard C types.

Reply via email to