https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82801
Bug ID: 82801 Summary: Internal compiler error with Eigen and __attribute__((always_inline, flatten)) Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: awllee at gmail dot com Target Milestone: --- Created attachment 42519 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42519&action=edit compressed compiler_error.ii This internal compiler error involves a minimal call to the Eigen-3.3.4 template library. It works using clang and homebrewed GCC 7.2.0 on OSX, but fails on Linux with GCC 7.2.0. It works using ICC on Linux. Exact version of GCC: 7.2.0 System type: Linux, Ubuntu 16.04 GCC configure options: --enable-languages=c,c++ --disable-multilib the complete command line that triggers the bug: g++ -g -O1 -I/home/al17824/local/eigen-3.3.4 compiler_error.cpp -o compiler_error compiler output: compiler_error.cpp:31:1: internal compiler error: Segmentation fault } ^ 0xb1272f crash_signal /home/al17824/objdir/../gcc-7.2.0/gcc/toplev.c:337 0x1168f51 ipa_inline /home/al17824/objdir/../gcc-7.2.0/gcc/ipa-inline.c:2422 0x1168f51 execute /home/al17824/objdir/../gcc-7.2.0/gcc/ipa-inline.c:2845 preprocessed file attached. Code is fairly simple; most changes lead to the compiler succeeding. #include <Eigen/Core> #include <iostream> class A { public: virtual double bar() const = 0; }; class B : public A { public: double bar() const; }; __attribute__((always_inline, flatten)) inline double B::bar() const { Eigen::Matrix<double, 1, 1> v; return 0.0; } inline double foo(const B& c) { return c.bar(); } void testError() { B model; std::cout << foo(model) << std::endl; } int main() { testError(); }