Skip to content

Instantly share code, notes, and snippets.

@spaghetti-source
Created July 19, 2013 10:43
Show Gist options
  • Select an option

  • Save spaghetti-source/6038261 to your computer and use it in GitHub Desktop.

Select an option

Save spaghetti-source/6038261 to your computer and use it in GitHub Desktop.
Runtime error (Eigen 3.1.1) if compile with "g++ -O3 main.cc". if -O2 instead of -O3, runtime error.does not arise.
// Runtime error if compile with "g++ -O3 main.cc"
#include <iostream>
#include <Eigen/Eigen>
using namespace std;
using namespace Eigen;
void f() {
MatrixXd U(2,2);
U = U*U; // runtime error
}
int main() {
MatrixXd U(2,2);
U = U*U; // ok
f();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment