https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127052
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrea Pinski <[email protected]>: https://gcc.gnu.org/g:230d950810f378a16c47ab981e0b9cf88b700622 commit r17-4133-g230d950810f378a16c47ab981e0b9cf88b700622 Author: Andrea Pinski <[email protected]> Date: Tue Aug 25 13:28:49 2026 -0700 phiopt/cselim: Support constants for cond_store_replacement_limited [PR127052] So when I wrote this code I limited the middle store to only be a SSA name. This is too limited and we reject constants which the full cselim can handle just fine. This extends the check to support gimple min invariants too. Instead of the check for ssa name, reject clobbers instead. Changes since v1: * v2: Change the checks to reject clobbers instead of checking for min invariant/ssa names. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/127052 gcc/ChangeLog: * tree-ssa-phiopt.cc (cond_store_replacement_limited): Reject clobbers for the middle bb store. And Remove the check on ssa name for the rhs of the middle bb store. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/cselim-6.c: New test. * gcc.dg/tree-ssa/cselim-7.c: New test. Signed-off-by: Andrea Pinski <[email protected]>
