]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/121362 - fixup thinko in earlier change
authorRichard Biener <rguenther@suse.de>
Mon, 11 Aug 2025 08:46:12 +0000 (10:46 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 11 Aug 2025 13:42:07 +0000 (15:42 +0200)
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.

gcc/tree-ssa-sccvn.cc

index ccd80806263bb8cdc0374b139364345080eb71d1..866d49c15a104d523001dd798ab7ec1a02637ee8 100644 (file)
@@ -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;