document the "wrong stack alignment" issue.

This commit is contained in:
Benoit Jacob
2009-06-21 17:25:57 +02:00
parent 7d48ed4be3
commit ac9680fb20
2 changed files with 61 additions and 1 deletions

View File

@@ -12,12 +12,13 @@ is explained here: http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html
**** READ THIS WEB PAGE !!! ****"' failed.
</pre>
There are 3 known causes for this issue. Please read on to understand them and learn how to fix them.
There are 4 known causes for this issue. Please read on to understand them and learn how to fix them.
\b Table \b of \b contents
- \ref c1
- \ref c2
- \ref c3
- \ref c4
- \ref explanation
\section c1 Cause 1: Structures having Eigen objects as members
@@ -64,6 +65,22 @@ then you need to read this separate page: \ref PassingByValue "Passing Eigen obj
Note that here, Eigen::Vector4d is only used as an example, more generally the issue arises for all \ref FixedSizeVectorizable "fixed-size vectorizable Eigen types".
\section c4 Cause 4: Compiler making a wrong assumption on stack alignment (for instance GCC on Windows)
This is a must-read for people using GCC on Windows (like MinGW or TDM-GCC). If you have this assertion failure in an innocent function declaring a local variable like this:
\code
void foo()
{
Eigen::Quaternionf q;
//...
}
\endcode
then you need to read this separate page: \ref WrongStackAlignment "Compiler making a wrong assumption on stack alignment".
Note that here, Eigen::Quaternionf is only used as an example, more generally the issue arises for all \ref FixedSizeVectorizable "fixed-size vectorizable Eigen types".
\section explanation General explanation of this assertion
\ref FixedSizeVectorizable "fixed-size vectorizable Eigen objects" must absolutely be created at 16-byte-aligned locations, otherwise SIMD instructions adressing them will crash.