Forum Stats

  • 3,851,381 Users
  • 2,263,969 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:


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

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.


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