Is there any Pragma optimization techniques available for ARM as like #pragma optimize_off in Blackfin/SHARC?
There is a GCC-specific set of pragmas are available from the below link:
#pragma GCC push_options
#pragma GCC optimize ("O0")
#pragma GCC pop_options
The optimization options that can be put into the pragma (or used on the command line) are documented here:
As well as here’s an alternative option that’s a bit neater for function level optimization only using an inline attribute.
The optimize attribute to the function can be as below:
static __attribute__((optimize("O0"))) int SomeFunc(void)