Re: [PATCH 7/8] libstdc++: Fix -Wsign-compare issue

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:51, Matthias Kretz via Libstdc++
 wrote:
>
>

OK for all branches.

> Signed-off-by: Matthias Kretz 
>
> libstdc++-v3/ChangeLog:
>
> * include/experimental/bits/simd_builtin.h (_S_set): Compare as
> int. The actual range of these indexes is very small.
> ---
>  libstdc++-v3/include/experimental/bits/simd_builtin.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> --
> ──
>  Dr. Matthias Kretz   https://mattkretz.github.io
>  GSI Helmholtz Centre for Heavy Ion Research   https://gsi.de
>  stdₓ::simd
> ──


[PATCH 7/8] libstdc++: Fix -Wsign-compare issue

2023-02-23 Thread Matthias Kretz via Gcc-patches


Signed-off-by: Matthias Kretz 

libstdc++-v3/ChangeLog:

* include/experimental/bits/simd_builtin.h (_S_set): Compare as
int. The actual range of these indexes is very small.
---
 libstdc++-v3/include/experimental/bits/simd_builtin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
──
 Dr. Matthias Kretz   https://mattkretz.github.io
 GSI Helmholtz Centre for Heavy Ion Research   https://gsi.de
 stdₓ::simd
──diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstdc++-v3/include/experimental/bits/simd_builtin.h
index 0e75f941288..30bbfa7d478 100644
--- a/libstdc++-v3/include/experimental/bits/simd_builtin.h
+++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h
@@ -2875,7 +2875,7 @@ _S_bit_xor(const _SimdWrapper<_Tp, _Np>& __x, const _SimdWrapper<_Tp, _Np>& __y)
 		__k = __generate_from_n_evaluations<_Np,
 		__vector_type_t<_Tp, _Np>>(
 		  [&](auto __j) _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA {
-		if (__i == __j)
+		if (__i == static_cast(__j))
 		  return _Tp(-__x);
 		else
 		  return __k[+__j];