https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89670
--- Comment #15 from Jörn Engel <joern at purestorage dot com> --- > int foo (int x) { return __builtin_ctz (x); } > > Without -mbmi, gcc emits: > xorl %eax, %eax > rep bsfl %edi, %eax > ret That example convinces me. Code would be broken with a zero-argument, but if the compiler cannot decide whether that is possible and the programmer can, it makes sense to generate less/faster code. Thank you!