https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122018
--- Comment #7 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- (In reply to uis from comment #5) > I posted code that probably would be easier for optimizer, more common > pattern I think would be > > #include <stdbool.h> > void g(); > void h(); > int f(int a, int b) { > if(a & (1 << b)) { > g(); > a = a | (1 << b); > } else > h(); > return a; > } For this one, bts in the if BB and could be not executed. replaced bt with bts may encounter overhead of register pressure.