From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 79DD938983AD; Fri, 21 Jun 2024 10:49:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79DD938983AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718966950; bh=3gJQI9ZY4I6VzcIESXGsfqELqeoIHkvsB4Wfn6StMow=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fIy4+Whk5NlCmk4xgtYQNaJaWFP2QLPPuIf6y/VA2gWwY3mlXMx0MIoiMV5DTZrsq ljJboDKER1xi9mQLNAsbEEHYFQrPmeDCTKhfp55Wq/K+PoRhb/yUgRftjjRHjcaeTw piof9JgRNqm4r3BvZLVznkA3Ge3s7Pdo6Ws5dCw4= From: "mkretz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/115575] experimental/simd/pr115454_find_last_set.cc FAILs Date: Fri, 21 Jun 2024 10:49:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mkretz at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mkretz at gcc dot gnu.org X-Bugzilla-Target-Milestone: 15.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115575 --- Comment #4 from Matthias Kretz (Vir) --- The test fails on x86_64 because the effective target selector 'avx512f' is always true. Thus on non-AVX512 systems the test fails with 'illegal instruction(s)'. That's a different issue than on SPARC, where it aborts wi= th a bogus value. On SPARC vectorization of SIMD is actually disabled. Thus an '' mas= k is a bitmask of 4 bits (a 'fixed_size_simd_mask'). Now, looking back at my fixed_size implementation, the mask stores a _SanitizedBitMask. IOW, it ass= umes the bit mask padding bits are always zero. Consequently, the memcpy in 'reduce2()' in the new test violates the invariant of fixed_size_simd_mask.= The test itself is the bug. necessary changes: 1. compile with '-march=3Dx86_64-v4' only with 'avx512f_runtime'. 2. add another constexpr-if condition in 'reduce2()' to skip fixed_size ABI= s=