From: Kyrylo Tkachov Date: Wed, 14 Jun 2023 16:08:03 +0000 (+0100) Subject: aarch64: Fix -Werror=sign-compare bootstrap failure X-Git-Tag: basepoints/gcc-15~8316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5eeff09a74391add05f609761bdc62c98476017a;p=thirdparty%2Fgcc.git aarch64: Fix -Werror=sign-compare bootstrap failure 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. --- diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc index 9b766ffa8170..95b4cb8a9433 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc @@ -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; } }