如题,谢谢
1) For GCC, please try below method:
#pragma GCC push_options#pragma GCC optimize ("O0")
your code
#pragma GCC pop_optionsto disable optimizations since GCC 4.4.
2) For Microsoft compiler, it also supports below grammar:#pragma optimize( "[optimization-list]", {on | off} )3)For ARM AC5/AC6, I do a quick go through but I don't find it. Maybe I miss it. Anyway, you can try it as what GCC does.
4) The last method is to try a unnecessary "volatile" to your function.