Sun Studio 12 Update 1: Fortran User's Guide

3.4.143 –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:

1

Assume at most 1-byte alignment.

2

Assume at most 2-byte alignment.

4

Assume at most 4-byte alignment.

8

Assume at most 8-byte alignment.

16

Assume at most 16-byte alignment.

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

i

Interpret access and continue execution

s

Raise signal SIGBUS

f

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.

You must also specify -xmemalign whenever you link to an object file that was compiled with a b value of either i or f.

The -dalign option is a macro:

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

Do not use -aligncommon=1 with -xmemalign as these declarations will conflict and could cause a segmentation fault on some platforms and configurations.

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