This code is Too Clever By Half(TM) but sometimes you need it
You can get this kind of thing even without optimizations - I forget the details now, but I once had to dig through some code for running an experiment that was originally written for PowerPC macs and was now being run on Intel macs and there was a Too Clever By Half(TM) bit that, it turned out, only worked properly on PowerPC.
Though note that as of 7.1, GCC’s documentation describes __attribute__((optimize(...))) as “[to] be used for debugging purposes only…not suitable in production code” (and given that the corresponding pragma is described in terms of the attribute, the same would presumably apply to it as well).
#pragma optimizeor function attributesThough note that as of 7.1, GCC’s documentation describes
__attribute__((optimize(...)))as “[to] be used for debugging purposes only…not suitable in production code” (and given that the corresponding pragma is described in terms of the attribute, the same would presumably apply to it as well).