https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113895
--- Comment #11 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:5fd1cbfd65ef2b6dd87cd78ce6509e7d561981ac commit r14-9029-g5fd1cbfd65ef2b6dd87cd78ce6509e7d561981ac Author: Richard Biener <rguent...@suse.de> Date: Fri Feb 16 10:08:43 2024 +0100 tree-optimization/113895 - consistency check fails in copy_reference_ops_from_ref The following addresses consistency check fails in copy_reference_ops_from_ref when we are handling out-of-bound array accesses (it's almost impossible to identically mimic the get_ref_base_and_extent behavior). It also addresses the case where an out-of-bound constant offset computes to a -1 off which is the special value for "unknown". This patch basically turns off verification in those cases. PR tree-optimization/113895 * tree-ssa-sccvn.cc (copy_reference_ops_from_ref): Disable consistency checking when there are out-of-bound array accesses. Allow -1 off when from an array reference with constant index. * gcc.dg/torture/pr113895-2.c: New testcase. * gcc.dg/torture/pr113895-3.c: Likewise. * gcc.dg/torture/pr113895-4.c: Likewise.