Enables stack alignment.
This option should only be enabled when optimizing for speed (-opt speed or -opt nospace in the compiler command line).
If enabled when optimizing for size (-opt space or -opt nospeed), the option has no effect.
The S12Z compiler can optimize either for code size (default) or for execution speed. Since the S12Z CPU data bus operates
on 32-bit address boundaries, one way to improve execution time is to ensure that no stack access is such that the corresponding
data transfer needs to be split into two consecutive bus accesses. This can be accomplished by aligning the stack, i.e.
making sure that:
- all stack accesses to 64-bit data are aligned to 4 (the address is a multiple of 4);
- no stack access to 16-bit data is aligned to “4 + 3” (the address is not a ‘<multiple of 4> + 3’);
- no stack access to 24-bit data is aligned to either “4 + 2” or “4 + 3” (the address is not a ‘<multiple of 4> + 2’ or a ‘<multiple of 4> + 3’).
Note: When stack alignment is enabled, function parameters are no longer passed according to the default calling convention.
Padding will be inserted, if necessary, in order to (1) align the parameters that must be passed on stack and (2) make sure that,
following the function call, the stack pointer will be aligned to 4 (i.e. the stack effect is a multiple of 4).
A linker warning will be reported when mixing user code and library code that was not compiled with the same stack alignment
setting (on/off).