https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122848
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eikansh Gupta <[email protected]>: https://gcc.gnu.org/g:ece564fdaa15a0da008cedd881afcd3f0f4dbd5a commit r17-2824-gece564fdaa15a0da008cedd881afcd3f0f4dbd5a Author: Eikansh Gupta <[email protected]> Date: Wed Jun 3 15:46:29 2026 +0530 MATCH: Simplify zero/sign extension bit operations [PR122848] Fold bitwise operations involving zero and sign extensions from the same low-precision value. The AND case folds to the zero extension, and the OR case folds to the sign extension. PR tree-optimization/122848 gcc/ChangeLog: * match.pd (zero_extend & sign_extend -> zero_extend): New pattern. (zero_extend | sign_extend -> sign_extend): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr122848.c: New test. Signed-off-by: Eikansh Gupta <[email protected]>
