https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127748
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Venkataramanan Kumar <[email protected]>: https://gcc.gnu.org/g:39a6434dcc6d7af501459d8a6104c3ea22e3acc4 commit r17-5428-g39a6434dcc6d7af501459d8a6104c3ea22e3acc4 Author: Reshma Roy <[email protected]> Date: Thu Oct 8 11:15:57 2026 +0530 Fix incorrect identification of POPCOUNT pattern [PR127748] r17-489-g8ca1e887847e2f captured the low half of the final add as @step_4 and the shifted temporary as @step4. Those are different captures, so (other & 0xffff) + (x >> 16) was folded to .POPCOUNT(x) and the other operand was dropped. Use @step4 for both operands so the masked value and the shifted value must be the same temporary. gcc/ChangeLog: PR tree-optimization/127748 * match.pd: Fix incorrect POPCOUNT identification in the first 32-bit Hacker's Delight matcher. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/popcount11.c: New test.
