]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Fix -Werror=sign-compare bootstrap failure
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 14 Jun 2023 16:08:03 +0000 (17:08 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 14 Jun 2023 16:08:03 +0000 (17:08 +0100)
Pushing to fix bootstrap.

gcc/ChangeLog:

* config/aarch64/aarch64-sve-builtins-base.cc (svlast_impl::fold):
Fix signed comparison warning in loop from npats to enelts.

gcc/config/aarch64/aarch64-sve-builtins-base.cc

index 9b766ffa8170cab966458e9d4e61130a5e426dbf..95b4cb8a9433444262f150ca5bbfa112d76d668e 100644 (file)
@@ -1088,7 +1088,7 @@ public:
        int step = f.type_suffix (0).element_bytes;
        int step_1 = gcd (step, VECTOR_CST_NPATTERNS (pred));
        int npats = VECTOR_CST_NPATTERNS (pred);
-       unsigned HOST_WIDE_INT enelts = vector_cst_encoded_nelts (pred);
+       unsigned enelts = vector_cst_encoded_nelts (pred);
        tree b = NULL_TREE;
        unsigned HOST_WIDE_INT nelts;
 
@@ -1130,13 +1130,13 @@ public:
                /* Restrict the scope of search to NPATS if vector is
                   variable-length for linear search later.  */
                nelts = npats;
-               for (i = npats; i < enelts; i += step_1)
+               for (unsigned j = npats; j < enelts; j += step_1)
                  {
                    /* If there are active elements in the repeated pattern of a
                       variable-length vector, then return NULL as there is no
                       way to be sure statically if this falls within the
                       Advanced SIMD range.  */
-                   if (!integer_zerop (VECTOR_CST_ENCODED_ELT (pred, i)))
+                   if (!integer_zerop (VECTOR_CST_ENCODED_ELT (pred, j)))
                      return NULL;
                  }
              }