Adapting from my answer to this GCC question , you can try using the #pragma directives , for example:
#pragma GCC push_options #pragma GCC optimize ("align-functions=16")
The macros #pragma push_options and pop_options are used to control the scope of the optimize pragma. More information on these macros can be found in the GCC docs .
Alternatively, if you prefer GCC attribute syntax , you should do something like:
//add 5 to each element of the int array. __attribute__((optimize("align-functions=16"))) void add5(int a[20]) { int i = 19; for(; i > 0; i--) { a[i] += 5; } }
Philip conrad
source share