GCC 4.1.2 Compile Error
Submitted by Joshua Warr
Assigned to Nobody
Link to original bugzilla bug (#1367)
Version: 3.3 (current stable)
Platform: PPC - general
Description
I am seeing a compile error with a VxWorks distribution of GCC 4.1.2. I am cross-compiling: the host is Linux x86_64, the target is VxWorks PPC604. This issue only occurs when I use the -O2 compile flag. I am getting the following compile error:
/home/advtech1/jwarr/kkass/git/hera/build/dependencies/eigen-3.2.5/eigen-3.2.5/include/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h:119: sorry, unimplemented: inlining failed in call to 'static void Eigen::internal::gebp_madd_selector<CJ, T, T, T, T>::run(const CJ&, T&, T&, T&, T&) [with CJ = Eigen::internal::conj_helper<double, double, false, false>, T = double]': function not considered for inlining
The culprit is the EIGEN_ALWAYS_INLINE macro. In <src/core/util/Macros.h>, there is a fix/hack for this compile problem for GCC versions prior to 4.0:
// FIXME with the always_inline attribute,
// gcc 3.4.x reports the following compilation error:
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
// : function body not available
#if EIGEN_GNUC_AT_LEAST(4,0)
#define EIGEN_ALWAYS_INLINE attribute((always_inline)) inline
#else
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
#endif
However, I am seeing the noted compile error with GCC 4.1.2. Looks like the GCC minimum version for using the always_inline attribute needs to be 4.2 (or possibly higher?). If I make that change (I changed #if EIGEN_GNUC_AT_LEAST(4,0) to #if EIGEN_GNUC_AT_LEAST(4,2) ), my compile succeeds.