https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115388
--- Comment #5 from GCC 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:818e760528d436ea8f6c28ef620e2bb82d456ea1 commit r15-1163-g818e760528d436ea8f6c28ef620e2bb82d456ea1 Author: Richard Biener <rguent...@suse.de> Date: Mon Jun 10 11:29:43 2024 +0200 tree-optimization/115388 - wrong DSE in irreductible regions The following fixes a latent bug in DSE with regarding to variant array accesses where the code avoiding bogus DSE in loops fails to handle irreducible regions. For those we need to make sure backedges are marked and discover a header for the irreducible region to check invariantness. PR tree-optimization/115388 * tree-ssa-dse.cc (dse_classify_store): Handle irreducible regions. (pass_dse::execute): Make sure to mark backedges. * gcc.dg/torture/pr115388.c: New testcase.