New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1367 - GCC 4.1.2 Compile Error
GCC 4.1.2 Compile Error
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: General
3.3 (current stable)
PPC - general Other
: Normal Compilation Problem
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-20 17:36 UTC by Joshua Warr
Modified: 2016-12-21 14:55 UTC (History)
4 users (show)



Attachments

Description Joshua Warr 2016-12-20 17:36:52 UTC
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.
Comment 1 Gael Guennebaud 2016-12-20 21:15:01 UTC
Cannot you update to a newer compiler? gcc 4.1 produces pretty bad code with advanced C++ as in Eigen, and we don't aim at supporting such old versions of gcc. Anyway, if this change is all you need, I'll happily apply it.
Comment 2 Gael Guennebaud 2016-12-20 21:19:05 UTC
https://bitbucket.org/eigen/eigen/commits/e5b9c7040bac/

backported to 3.3 and 3.2
Comment 3 Joshua Warr 2016-12-21 14:55:43 UTC
(In reply to Gael Guennebaud from comment #1)
> Cannot you update to a newer compiler? gcc 4.1 produces pretty bad code with
> advanced C++ as in Eigen, and we don't aim at supporting such old versions
> of gcc. Anyway, if this change is all you need, I'll happily apply it.

We have constraints on some legacy products require us to use certain tool sets.  Thank you for addressing this issue.

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