Suppress Warray-bounds warning in generic ploaduSegment, fix edge case for vectorized cast

Reference issue

What does this implement/fix?

g++ will produce the following warning when compiling the half_float test with -O2 -Warray-bounds -mavx2 (possibly other simd flags).

warning: ‘void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)’ forming offset [16, 17] is out of the bounds [0, 16] of object ‘aux’ with type ‘Scalar [8]’ {aka ‘Eigen::half [8]’} [-Warray-bounds=]

This warning can be suppressed with various asserts in smart_copy, or just replacing smart_copy with a loop, which I have done here.

This also fixes an (apparently unrelated) edge case when vectorizing casts involving partial packets.

Additional information

Edited by Charles Schlosser

Merge request reports

Loading