https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108819
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:32b5875c911f80d551d006d7473e6f1f8705857a commit r13-6132-g32b5875c911f80d551d006d7473e6f1f8705857a Author: Jakub Jelinek <ja...@redhat.com> Date: Sat Feb 18 12:40:49 2023 +0100 reassoc: Fold some statements [PR108819] This spot in update_ops can replace one or both of the assign operands with constants, creating 1 & 1 and similar expressions which can confuse later passes until they are folded. Rather than folding both constants by hand and also handling swapping of operands for commutative ops if the first one is constant and second one is not, the following patch just uses fold_stmt_inplace to do that. I think we shouldn't fold more than the single statement because that could screw up the rest of the pass, we'd have to mark all those with uids, visited and the like. 2023-02-18 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/108819 * tree-ssa-reassoc.cc (update_ops): Fold new stmt in place. * gcc.dg/pr108819.c: New test.