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!
Bug 799 - MSVC Internal Compiler Errors in SparseCore
Summary: MSVC Internal Compiler Errors in SparseCore
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3.3
  Show dependency treegraph
 
Reported: 2014-04-19 02:15 UTC by Jeffrey Bush
Modified: 2015-09-02 11:10 UTC (History)
1 user (show)



Attachments

Description Jeffrey Bush 2014-04-19 02:15:02 UTC
The problem is partially documented in SparseTranspose.h:29 however not all instances of it are addressed. I list the other places I have found where changes are needed (in not-quite-patch format).

On SparseTranspose.h:43-44
-    typename TransposeImpl<MatrixType,Sparse>::Index row() const { return Base::col(); }
+    typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }

On SparseTranspose.h:57-58
-    typename TransposeImpl<MatrixType,Sparse>::Index row() const { return Base::col(); }
+    typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }

On SparseCwiseBinaryOp.h:76
-    EIGEN_STRONG_INLINE InnerIterator(const CwiseBinaryOpImpl& binOp, Index outer)
+    EIGEN_STRONG_INLINE InnerIterator(const CwiseBinaryOpImpl& binOp, typename Lhs::Index outer)
Comment 1 Jeffrey Bush 2014-04-19 02:15:56 UTC
OOPS! Copy-paste error!

On SparseTranspose.h:43-44
-    Index row() const { return Base::col(); }
+    typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }

On SparseTranspose.h:57-58
-    Index row() const { return Base::col(); }
+    typename TransposeImpl<MatrixType,Sparse>::Index col() const { return Base::row(); }

On SparseCwiseBinaryOp.h:76
-    EIGEN_STRONG_INLINE InnerIterator(const CwiseBinaryOpImpl& binOp, Index outer)
+    EIGEN_STRONG_INLINE InnerIterator(const CwiseBinaryOpImpl& binOp, typename Lhs::Index outer)
Comment 2 Gael Guennebaud 2014-06-27 15:26:16 UTC
Applied there:  https://bitbucket.org/eigen/eigen/commits/522938e55e62/

I only applied it to the 3.2 branch because the expression template engine will be completely different in 3.3 but it would be nice to be able to check for regressions. To this end we would need a code snippet that triggers these ICEs as I'm not able to reproduce them.
Comment 3 Jeffrey Bush 2014-06-30 03:48:31 UTC
The example was from some of the examples/demos in CGAL and I don't remember which. Additionally, trying to compile them now with the 'old' version of Eigen doesn't elucidate the errors. So, I really don't know what caused it to happen. However, I know originally that those changes did allow me to compile after not being able to. I am sorry this is so unhelpful... in general I have found the MSVC greatly prefers very verbose types when it comes to templates (compared with more robust compilers like GCC).

In this particular case, it could have been because due to some set of optional features I had enabled, there was a global-ish type/alias/instance called "Index". I have seen problems before with MSVC where MSVC will pick up a global identifier over something more local (like an enclosing or base class) for types in templates. If that global identifier is a type, then you will get type problems, and presumably if that identifier is not a type you will get an ICE.

Note that this was in MSVC 2010, although it looks like you set the comments to imply 2012.
Comment 4 Gael Guennebaud 2015-09-02 11:10:30 UTC
there is no reason that this ICE still exists in default branch as Index is now a global typedef.

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