https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119274
--- Comment #8 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:6470b4d749a0b9896b985858ee6eae095cd8a37a commit r15-8050-g6470b4d749a0b9896b985858ee6eae095cd8a37a Author: Richard Biener <rguent...@suse.de> Date: Fri Mar 14 10:01:20 2025 +0100 tree-optimization/119274 - improve VN optimistic dominance query The following improves how VN performs its dominance queries to determine availability, exploiting edges considered unreachable. The function already contains code to handle the leader block forking the CFG, but that looks like a situation that won't help the dominance query ever. The following adds handling of the more useful case where this block forwards to a CFG merge with the forwarder being the only executable entry. This helps optimizing the code so the spurious array diagnostic does no longer appear. PR tree-optimization/119274 * tree-ssa-sccvn.cc (dominated_by_p_w_unex): Handle the top block being the only executable forwarder to a CFG merge. * g++.dg/opt/pr119274.C: New testcase.