https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106586
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is a testcase which shows a similar issue where bseti is not used (ignore the 1<<31 being undefined/unspecified issue): int f(int a, int b) { b = 31; int tt = sizeof(b)*8 - 1; return a | (((__typeof__(b))1) << (b & tt)); }