https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123803
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:8b7b9d5a0a0e4c749b40ab67ab219649625971a8 commit r16-7018-g8b7b9d5a0a0e4c749b40ab67ab219649625971a8 Author: Andrew Pinski <[email protected]> Date: Fri Jan 23 23:13:25 2026 -0800 SLSR: Wrong type sometimes for rhs2 with pointers [PR123803] I messed up one of the new gimple_convert when there is still a pointer type (with -fwrapv-pointer or -fno-strict-overflow). The newrhs2 should be converted into sizetype instead of the type of the lhs. Other places were already done correctly, it was just in replace_rhs_if_not_dup which was broken this way. Pushed as obvious after bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/123803 gcc/ChangeLog: * gimple-ssa-strength-reduction.cc (replace_rhs_if_not_dup): For pointer lhs use sizetype. gcc/testsuite/ChangeLog: * gcc.dg/pr123803-1.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
