8.152 --pointer_alignment=num

Specifies unaligned pointer support required for an application.

Syntax

--pointer_alignment=num

Where num is one of:

1

Accesses through pointers have an alignment of one, that is, byte-aligned or unaligned.

2

Accesses through pointers have an alignment of at most two, that is, at most halfword aligned.

4

Accesses through pointers have 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.

If numis unspecified, the compiler faults use of --pointer_alignment.

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 processors 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 processors 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.

Related reference
10.12 __packed
10.95 #pragma pack(n)
5.32 Compiler storage of data objects by natural byte alignment
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.