https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96930
--- Comment #6 from Gabriel Ravier <gabravier at gmail dot com> --- For this exact code : unsigned f(unsigned a, unsigned b) { return a / (unsigned long long)(1U << b); } compiled with a trunk-based GCC built yesterday for x86-64-linux-gnu configured with: ../gcc-trunk-20210102/configure --prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap --enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada,d --enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto --enable-plugins --enable-threads=posix --with-pkgversion=Compiler-Explorer-Build with the specific compiler command line of `g++ -g -o /tmp/compiler-explorer-compiler202103-4524-15mdddx.f4b4g/output.s -masm=intel -S -fdiagnostics-color=always -O3 /tmp/compiler-explorer-compiler202103-4524-15mdddx.f4b4g/example.cpp`, I get: f(unsigned int, unsigned int): mov eax, edi mov ecx, esi shr rax, cl ret whereas LLVM uses `shr eax, cl` instead. See also https://godbolt.org/z/Gqza7v for the exact setup I used (in case I missed something and you rather avoid having to wait for me to answer).