3 ms·
There's a bunch listed (https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options.html https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options....), inclu
by prof_hobart 12y ago
There's a bunch listed (https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options.html https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options....), including
-O0 // Do Not Optimise
This sounds like it should do the trick (but I've not done C coding for quite some time, so I don't know if there's a nuance as to why it wouldn't), but would also presumably kill any other optimisation.
A better option may be to combine that with pragmas (https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-...) to switch optimisation levels within the code.
Anyone who's played with GCC recently know whether this would work or not?