https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106293
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:4e0b504f26f78ff02e80ad98ebbf8ded3aa6ffa1 commit r13-5092-g4e0b504f26f78ff02e80ad98ebbf8ded3aa6ffa1 Author: Richard Biener <rguent...@suse.de> Date: Tue Jan 10 13:48:51 2023 +0100 tree-optimization/106293 - missed DSE with virtual LC PHI Degenerate virtual PHIs can break DSEs fragile heuristic as to what defs it can handle for further processing. The following enhances it to look through degenerate PHIs by means of a worklist, processing the degenerate PHI defs uses to the defs array. The rewrite of virtuals into loop-closed SSA caused this to issue appear more often. The patch itself is mostly re-indenting the new loop body. PR tree-optimization/106293 * tree-ssa-dse.cc (dse_classify_store): Use a worklist to process degenerate PHI defs. * gcc.dg/tree-ssa/ssa-dse-46.c: New testcase.