https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102738
Bug ID: 102738 Summary: Failure to optimize right shift of 128-bit value after it's already been shifted by 127 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- int a(__int128 f, int g) { return (f >> 127) >> g; } This can be optimized to `return f >> 127;`. This optimization is done by LLVM, but not by GCC.