From: Richard Biener Date: Mon, 11 Aug 2025 08:46:12 +0000 (+0200) Subject: tree-optimization/121362 - fixup thinko in earlier change X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45a56f42b4909e2ae0d1ad35dab05c5c092a14bc;p=thirdparty%2Fgcc.git tree-optimization/121362 - fixup thinko in earlier change The following fixes the index guards on the component stripping loops, I swapped them it seems. PR tree-optimization/121362 * tree-ssa-sccvn.cc (vn_reference_lookup_3): Swap index guards on component stripping loops. --- diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index ccd80806263..866d49c15a1 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -3573,7 +3573,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, try finding a match in one of the outer components and continue stripping there. This happens when addresses of components get forwarded into dereferences. */ - if (j > 0) + if (i > 0) { int temi = i - 1; extra_off = vr->operands[i].off; @@ -3598,7 +3598,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, temi--; } } - if (!found && i > 0) + if (!found && j > 0) { int temj = j - 1; extra_off = -lhs_ops[j].off;