2.1.97. --pointer_alignment=num

This option specifies the unaligned pointer support required for an application.

Syntax

--pointer_alignment=num

Where num is one of:

1

Treats accesses through pointers as having an alignment of one, that is, byte-aligned or unaligned.

2

Treats accesses through pointers as having an alignment of at most two, that is, at most halfword aligned.

4

Treats accesses through pointers as having an alignment of at most four, that is, at most word aligned.

8

Accesses through pointers have normal alignment, that is, at most doubleword aligned.

Usage

This option can help you port source code that has been written for architectures without alignment requirements. You can achieve finer control of access to unaligned data, with less impact on the quality of generated code, using the __packed qualifier.

Restrictions

De-aligning pointers might increase the code size, even on CPUs with unaligned access support. This is because only a subset of the load and store instructions benefit from unaligned access support. The compiler is unable to use multiple-word transfers or coprocessor-memory transfers, including hardware floating-point loads and stores, directly on unaligned memory objects.

Note

  • Code size might increase significantly when compiling for CPUs without hardware support for unaligned access, for example, pre-v6 architectures.

  • This option does not affect the placement of objects in memory, nor the layout and padding of structures.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential