1.42 -munaligned-access, -mno-unaligned-access

Enables and disables unaligned accesses to data on ARM processors.

The compiler defines the __ARM_FEATURE_UNALIGNED macro when -munaligned-access is enabled.
The libraries include special versions of certain library functions designed to exploit unaligned accesses. When unaligned access support is enabled, using -munaligned-access, the compilation tools use these library functions to take advantage of unaligned accesses. When unaligned access support is disabled, using -mno-unaligned-access, these special versions are not used.

Default

-munaligned-access is the default for architectures that support unaligned accesses to data. This applies to all architectures supported by ARM Compiler 6, except ARMv6-M and ARMv8-M.baseline.

Usage

-munaligned-access
Use this option on processors that support unaligned accesses to data, to speed up accesses to packed structures.

Note

For ARMv6-M and ARMv8-M.baseline architectures, compiling with this option generates an error.
-mno-unaligned-access
If unaligned access is disabled, words in packed data structures are accessed one byte at a time.
Related reference
5.1 Predefined macros
Related information
ARM C Language Extensions 2.0
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.