align_structs

Enables alignment of struct members.

Syntax

  -[no]align_structs

Arguments

None

Default

  -noalign_structs

Define

None

Scope

You should only enable this option 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.

Description

This option enables alignment of struct members.

he 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 accesses to struct members are such that, if the struct itself is aligned to a multiple of 4, the corresponding data transfer need not be split into two consecutive bus accesses. This can be accomplished by aligning the struct members, i.e. making sure that:
Note: If this option is enabled, the offsets of the struct members might change. If your application relies on the default offset values, it will no longer work as expected.