Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑no_unaligned_access

In this section:
Syntax

‑‑no_unaligned_access

Description

Use this option to make the compiler avoid unaligned accesses. Data accesses are usually performed aligned for improved performance. However, some accesses, most notably when reading from or writing to packed data structures, might be unaligned. When using this option, all such accesses will be performed using a smaller data size to avoid any unaligned accesses. This option is only useful for Armv6 architectures and higher.

For the architectures Armv7-M, Armv8-A, and Armv8-M.mainline, the hardware support for unaligned access can be controlled by software. There are variants of library routines for these architectures that are faster when unaligned access is supported in hardware (symbols with the prefix __iar_unaligned_). The IAR linker will not use these variants if any of the input modules does not allow unaligned access.

See also

Alignment.

Caution

To set this option, use Project>Options>C/C++ Compiler>Extra Options.