4.22 Compiler eight-byte alignment features

The compiler has the following eight-byte alignment features:

  • The Procedure Call Standard for the ARM Architecture (AAPCS) requires that the stack is eight-byte aligned at all external interfaces. The compiler and C libraries preserve the eight-byte alignment of the stack. In addition, the default C library memory model maintains eight-byte alignment of the heap.

  • Code is compiled in a way that requires and preserves the eight-byte alignment constraints at external interfaces.

  • If you have assembly language files, or legacy objects, or libraries in your project, it is your responsibility to check that they preserve eight-byte stack alignment, and correct them if required.

  • In RVCT v2.0 and later, and in ARM Compiler 4.1 and later, double and long long data types are eight-byte aligned for compliance with the Application Binary Interface for the ARM Architecture (AEABI). This enables efficient use of the LDRD and STRD instructions in ARMv5TE and later.

  • The default implementations of malloc(), realloc(), and calloc() maintain an eight-byte aligned heap.

  • The default implementation of alloca() returns an eight-byte aligned block of memory.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.