Forum Stats

  • 3,851,381 Users
  • 2,263,969 Discussions
  • 7,904,691 Comments

Discussions

C++ compiler option -misalign

Can someone help me understand the performance implication of this option? Specifically, I would like to know if "very conservative loads and stores" are used for ALL data accesses in the program, not just misaligned data accesses.

The following is quoted from the compiler's user's guide:

-misalign

SPARC: Permits misaligned data, which would otherwise generate an error, in memory. This is shown in the following
code:

char b[100];
int f(int * ar) {
return *(int *) (b +2) + *ar;
}

Very conservative loads and stores must be used for the data, that is, one byte at a time. Using this option can cause
significant degradation in performance when you run the program.

Warnings

If possible, do not link aligned and misaligned parts of the program
This discussion has been closed.