https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122981

--- Comment #10 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> ---
azoff at gcc dot gnu.org [Tuesday, 18 August 2026, 06:51:36 CEST]:
> I've added this on top of r17-2833-g32657f29f91871 and it fixes
> experimental/simd/pr109261_constexpr_simd.cc and
> experimental/simd/pr115454_find_last_set.cc tests on arm-none-eabi for me. I
> see no regression with this change.

I also modified the patch some more to remove the now unused __int_for_sizeof 
branches:

--- a/libstdc++-v3/include/experimental/bits/simd.h
+++ b/libstdc++-v3/include/experimental/bits/simd.h
@@ -608,16 +608,14 @@ struct __is_bitmask
   __int_for_sizeof()
   {
     static_assert(_Bytes > 0);
-    if constexpr (_Bytes == sizeof(int))
-      return int();
-    else if constexpr (_Bytes == sizeof(_SChar))
-      return _SChar();
-    else if constexpr (_Bytes == sizeof(short))
-      return short();
-    else if constexpr (_Bytes == sizeof(long))
-      return long();
-    else if constexpr (_Bytes == sizeof(_LLong))
-      return _LLong();
+    if constexpr (_Bytes == sizeof(int32_t))
+      return int32_t();
+    else if constexpr (_Bytes == sizeof(int8_t))
+      return int8_t();
+    else if constexpr (_Bytes == sizeof(int16_t))
+      return int16_t();
+    else if constexpr (_Bytes == sizeof(int64_t))
+      return int64_t();
   #ifdef __SIZEOF_INT128__
     else if constexpr (_Bytes == sizeof(__int128))
       return __int128();

I also saw no regressions on x86_64, aarch64, and arm-linux-gnueabi.

Do you want to post the new patch? Otherwise, I basically have it ready ...

> Also, the test that I created in comment 2 works with this change, but is
> the test worth keeping?

I'd not add a new test:
1. This is experimental and supposed to go away.
2. There's a very thorough 'make check-simd' target in the libstdc++/testsuite 
directory, which already covers it. Probably nobody but me runs it, though :)

Reply via email to