[Godbolt](https://godbolt.org/z/b57EK93e3) and [GCC Bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120268) ``` void f0(unsigned char *ptr, unsigned long len){ for(unsigned long i = 0; i < len; ++i){ ptr[i] = 0; } } void f1(unsigned char *ptr, unsigned long len){ for(unsigned long i = 0; i < len; ++i){ while(ptr[i]) ptr[i]--; } } void f2(unsigned char *ptr){ while(ptr[0]) ptr[0]--; } ``` When flags are -O3, f1() compares if ptr[i] is zero before setting it to zero and f0() memset it to zero. When flags are -O3 and -march=icelake-client, f1() doesn't call memset like f0().