misaligned_mem_access

Controls how the compiler copies structures that are not aligned to 4-byte boundaries.

Syntax
#pragma misaligned_mem_access on | off | reset
  
Remarks

When this pragma is on , the compiler uses 4-byte load and store instructions to copy structures that are not aligned to 4-byte boundaries. By using these misaligned load and store instructions, the compiler improves runtime performance and reduces code size.

When this pragma is off , the compiler uses 1-, 2-, and 4-byte load and store instructions to copy structures that are aligned on corresponding boundaries.

However, misaligned load and store instructions on some Power Architecture processors give poor performance or even generate processor exceptions. For these processors, turn this pragma off. Desktop variants of the Power Architecture processor family do not have this limitation.

Consult the processor manufacturer's documentation for information on the processor's behavior when loading and storing 4-byte values that are not aligned to 4-byte boundaries.

The default for this pragma is on for processors that allow misaligned memory access. The default is off for processors that have limited misaligned memory access performance or generate an exception.