Sun Studio 12: Fortran User's Guide

3.4.149 –xmemalign[=<a><b>]

(SPARC) Specify maximum assumed memory alignment and behavior of misaligned data accesses.

For memory accesses where the alignment is determinable at compile time, the compiler will generate the appropriate load/store instruction sequence for that data alignment.

For memory accesses where the alignment cannot be determined at compile time, the compiler must assume an alignment to generate the needed load/store sequence.

The -xmemalign flag allows the user to specify the maximum memory alignment of data to be assumed by the compiler for those indeterminate situations. It also specifies the error behavior at runtime when a misaligned memory access does take place.

The value specified consists of two parts: a numeric alignment value, <a>, and an alphabetic behavior flag, <b>.

Allowed values for alignment, <a>, are:


Assume at most 1-byte alignment.


Assume at most 2-byte alignment.


Assume at most 4-byte alignment.


Assume at most 8-byte alignment.


Assume at most 16-byte alignment.

Allowed values for error behavior on accessing misaligned data, <b>, are:


Interpret access and continue execution


Raise signal SIGBUS


On 64–bit platforms, raise signal SIGBUS only for alignments less or equal to 4, otherwise interpret access and continue execution. On other platforms f is equivalent to i.

The defaults when compiling without -xmemalign specified are:

The default for -xmemalign appearing without a value is 1i for all platforms.

Note that -xmemalign itself does not force any particular data alignment to take place. Use -dalign or -aligncommon to force data alignment.

The -dalign option is a macro:

-dalign is a macro for: -xmemalign=8s -aligncommon=16

See 3.4.2 –aligncommon[={1|2|4|8|16}] for details.