diff --git a/include/xsimd/arch/xsimd_neon.hpp b/include/xsimd/arch/xsimd_neon.hpp index 6acbe981a..4521f38da 100644 --- a/include/xsimd/arch/xsimd_neon.hpp +++ b/include/xsimd/arch/xsimd_neon.hpp @@ -518,7 +518,9 @@ namespace xsimd template = 0> XSIMD_INLINE batch_bool load_unaligned(bool const* mem, batch_bool, requires_arch) noexcept { - uint8x8_t tmp = vreinterpret_u8_u32(vset_lane_u32(*(unsigned int*)mem, vdup_n_u32(0), 0)); + uint32_t bits; + std::memcpy(&bits, mem, sizeof(bits)); + uint8x8_t tmp = vreinterpret_u8_u32(vset_lane_u32(bits, vdup_n_u32(0), 0)); auto const vmem = batch(vmovl_u16(vget_low_u16(vmovl_u8(tmp)))); auto const zero = batch { 0 }; return { (zero - vmem).data };