https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124838
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #8 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
bsr has a _true_ dependency on the old value of the output operand (when input
is zero). popcnt/lzcnt/tzcnt have a _false_ dependency on some Intel CPUs
(out-of-order execution treating them as if they read from the output operand),
fixed in different generations for popcnt and lzcnt/tzcnt. Clang not avoiding
the false dependency is a known LLVM bug:
https://github.com/llvm/llvm-project/issues/33216
bar3 from comment #5 would be optimized to same code as bar2 if it returned
'int' instead of 'unsigned long'. GCC's pattern-matching fails when types
differ (please file a new bug if you'd like that to be improved).