https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95971
--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> --- while(!a.isZero()); that doesn't look like something you would find in real code. Are you waiting for a different thread to modify a? Then you should use an atomic operation. Are you waiting for the hardware to change something? Use volatile. Do you really want an infinite loop? Spell it out if(!a.isZero())for(;;);