5 ms·
No, the generated code seems to be mostly the same as the manual version: https://gcc.godbolt.org/z/aK8orbKE8 https://gcc.godbolt.org/z/aK8orbKE8 The main diff
by pbsd 11mo ago
No, the generated code seems to be mostly the same as the manual version: https://gcc.godbolt.org/z/aK8orbKE8 https://gcc.godbolt.org/z/aK8orbKE8
The main difference there seems to be that GCC treats the if() as unlikely to be taken while the for() as likely.