Enables or 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 default applies to all architectures supported by Arm Compiler 6, except Armv6‑M, and Armv8‑M without the Main Extension.
Usage
-munaligned-access
Use this option on processors that support unaligned accesses to data, to
speed up accesses to packed structures.
Note:
Compiling with this option generates an error for the following architectures:
Armv6‑M.
Armv8‑M without the Main Extension.
-mno-unaligned-access
If unaligned access is disabled, any unaligned data that is wider than 8 bits is accessed 1 byte at a time. For example, fields wider than 8 bits, in packed data structures, are always accessed 1 byte at a time even if they are aligned.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.