doubles might be aligned on a 4 bytes boundary on win32
@ggael
Submitted by Gael GuennebaudAssigned to Nobody
Link to original bugzilla bug (#1003)
Version: 3.2
Operating system: Windows
Description
According to this thread: https://forum.kde.org/viewtopic.php?f=74&t=125884&sid=ee8bc135815a4e1fd1c79accd3937209, and some new unit tests (http://manao.inria.fr/CDash/viewTest.php?onlyfailed&buildid=19166), and in contrast to what I read everywhere else, MSVC/win32 fail to align doubles on the stack a 8 bytes boundary.
This means that if someone map a statically allocated buffer of doubles, then all our strategies to extract the first aligned entry will fail.
The easiest fix would be to set packet_traits<double>::AlignedOnScalar to false on win32. The downside is a loss of performance for objects allocated by Eigen and heap allocated buffers.
Another solution would to detect such cases at runtime. I already have a fix for sliced evaluation there: https://forum.kde.org/viewtopic.php?f=74&t=125884&sid=ee8bc135815a4e1fd1c79accd3937209#p333129, but there might be other places where such a fix would be needed. If go with that approach, then we can also wonder whether such runtime detection should be enabled all the time, or only for win32 with sizeof(Scalar)>4 ??