Is there some compile-time (of gcc) or run-time option that controls whether "empty loops" are optimized away to nothing? Or did something change to explicitly detect delay loops?
I was looking at some code recently that contained one of the usual delay loops:
for(int i=0; i<900000; i++){} //Run a few cycles doing nothing
and with the same optimization level (-Os), some versions of gcc produce code that implements the empty loop (arm-8-2019-q3. from ARM), and some versions (7-2017-q4-major, from Arduino) just remove it (as I'm used to on AVR and etc.)