float2half() has unnecessary call to _mm_setzero_si128 (I think)

Clang static analyzer warns:

warning: Value stored to 'o' during its initialization is never read

for this code https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/arch/SSE/PacketMath.h?ref_type=heads#L2282:

EIGEN_STRONG_INLINE __m128i float2half(__m128 f) {
  __m128i o = _mm_setzero_si128();
...

Indeed nothing reads o after, and it's overwritten about 30 lines later.

Before proposing an MR, I'd thought I'd check here if:

  • this call to _mm_setzero_si128 can just be removed
  • we just suppress it with (void)o
  • there's some actual bug here
Edited by Sean McBride