Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False clang-scan warning in _mm_loadu_si64 #423

Open
gperciva opened this issue Dec 3, 2021 · 0 comments
Open

False clang-scan warning in _mm_loadu_si64 #423

gperciva opened this issue Dec 3, 2021 · 0 comments
Labels
Not a problem False warnings from compilers or analysis tools

Comments

@gperciva
Copy link
Member

gperciva commented Dec 3, 2021

clang-scan 13.0.0 complaints about

y = _mm_loadu_si64(a);

in cpusupport/Build/cpusupport-X86-AESNI.c.

Clang's <emmintrin.h> header looks ok to me:

1649 | /// Loads a 64-bit integer value to the low element of a 128-bit integer
1650 | ///    vector and clears the upper element.
1651 | ///
1652 | /// \headerfile <x86intrin.h>
1653 | ///
1654 | /// This intrinsic corresponds to the <c> VMOVQ / MOVQ </c> instruction.
1655 | ///
1656 | /// \param __a
1657 | ///    A pointer to a 64-bit memory location. The address of the memory
1658 | ///    location does not have to be aligned.
1659 | /// \returns A 128-bit vector of [2 x i64] containing the loaded value.
1660 | static __inline__ __m128i __DEFAULT_FN_ATTRS
1661 | _mm_loadu_si64(void const *__a)
1662 | {
1663 |   struct __loadu_si64 {
1664 |     long long __v;
1665 |   } __attribute__((__packed__, __may_alias__));
1666 |   long long __u = ((const struct __loadu_si64*)__a)->__v;
1667 |   return __extension__ (__m128i)(__v2di){__u, 0LL};
1668 | }

clang-scan complains about 1666 in particular.

Future work: take a look at their bug tracker to see if this is a known bug in clang-scan.

@gperciva gperciva added the Not a problem False warnings from compilers or analysis tools label Jan 25, 2022
gperciva added a commit that referenced this issue May 4, 2022
The clang analyzer claims that _mm_loadu_si64() has
    Assigned value is garbage or undefined
but it looks ok to me.

#423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not a problem False warnings from compilers or analysis tools
Development

No branches or pull requests

1 participant