New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.Before reporting a bug, please make sure that your Eigen version is up-to-date!

In a typical use of multiple inheritance in Eigen:
class CwiseBinaryOp : internal::no_assignment_operator, public CwiseBinaryOpImpl<...>
sometimes the dummy class (no_assignment_operator) comes first, which leads to suboptimal code generation by Intel Compiler. Every time it needs type casting (which is always) it injects code for null-pointer adjustment, ( if (this==1) this = 0; ) even for stack variables. Simply by reordering the inheritance order such that the dummy class is the last, this problem goes away (and there's a small but noticeable reduction in generated code size).

We could check things like
CwiseBinaryOp<...> A(...);
CwiseBinaryImpl<...> Abase = A;
VERIFY((void*)(& A) == (void*)(& Abase)));
However, on gcc this always succeeded, independently of the inheritance order (even after I added a dummy variable into no_assignment_operator), so either this test does not work, or GCC just optimizes empty classes away more aggressively than ICC.

Note

You need to
log in
before you can comment on or make changes to this bug.