https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823
--- Comment #10 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:1d63e50467f140b4749065afb1c1b3f94c819de8 commit r17-313-g1d63e50467f140b4749065afb1c1b3f94c819de8 Author: Andrew Pinski <[email protected]> Date: Fri Mar 27 22:57:18 2026 -0700 phiprop: skip over clobbers [PR116823] Like the already approved patch at https://inbox.sourceware.org/gcc-patches/[email protected]/ but reworked to fit into the new simplified code and also fixed a bug noticed for aggregates. Aggregates include a store when doing phiprop so we need to check if there are also loads between the original store/load and the clobber we are skipping. Like the skipping of the store case, I didn't see this happening enough to add the extra checks. I did add a testcase (phiprop-5.C) which checks this. changes since v2: * v3: treat aggregates special earlier and don't duplicate code. * v2: adapt to can_handle_load instead of inline. PR tree-optimization/116823 gcc/ChangeLog: * tree-ssa-phiprop.cc (can_handle_load): Skip past clobbers for !aggregate. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/phiprop-2.C: New test. * g++.dg/tree-ssa/phiprop-4.C: New test. * g++.dg/tree-ssa/phiprop-5.C: New test. Signed-off-by: Andrew Pinski <[email protected]>
