https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115028
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|target |testsuite --- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So the extra xor is due to an extra register move in the IR and then RA decides to do slightly different register allocation. ``` /* PR middle-end/101950 */ /* { dg-do compile } */ /* { dg-options "-O2 -mlzcnt" } */ /* { dg-final { scan-assembler-not "call\[^\n\r]*__clrsb.i2" } } */ /* { dg-final { scan-assembler-times "\tlzcnt\[ql]\t" 2 } } */ /* { dg-final { scan-assembler-times "\txor\[ql]\t" 2 } } */ /* { dg-final { scan-assembler-times "\tsar\[ql]\t|\tcltd" 2 } } */ int foo (long *x) { return __builtin_clrsbl (*x); } int bar (int *x) { return __builtin_clrsb (*x); } ``` I am just goign to change the testcase to avoid the register allocation trouble.