http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50622
Bug #: 50622 Summary: ICE: verify_gimple failed for std::complex<double> Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: vincenzo.innoce...@cern.ch NOTE; ok with -std=gnu++0x cat ice47.cc #include <complex> template <typename Value> struct LorentzVector { template <typename ValueB> LorentzVector<Value> & operator+=(const LorentzVector<ValueB> & a) { theX += a.theX; theY += a.theY; theZ += a.theZ; theT += a.theT; return *this; } Value theX; Value theY; Value theZ; Value theT; }; template <typename ValueA, typename ValueB> inline LorentzVector<ValueA> operator+(LorentzVector<ValueA> a, const LorentzVector<ValueB> & b) { return a += b; } std::complex<double> evaluate() { LorentzVector<std::complex<double> > v1; LorentzVector<std::complex<double> > veca = v1 + v1; return veca.theT; } Macintosh-203:ctest innocent$ c++ -O2 -c ice47.cc ice47.cc: In function ‘std::complex<double> evaluate()’: ice47.cc:26:22: error: invalid rhs for gimple memory store a$_M_value v1$_M_value # .MEM_14 = VDEF <.MEM_12> a$_M_value = v1$_M_value; ice47.cc:26:22: error: invalid rhs for gimple memory store a$16$_M_value v1$theY$_M_value # .MEM_15 = VDEF <.MEM_14> a$16$_M_value = v1$theY$_M_value; ice47.cc:26:22: error: invalid rhs for gimple memory store a$32$_M_value v1$32$_M_value # .MEM_16 = VDEF <.MEM_15> a$32$_M_value = v1$32$_M_value; ice47.cc:26:22: error: invalid rhs for gimple memory store a$48$_M_value v1$theT$_M_value # .MEM_17 = VDEF <.MEM_16> a$48$_M_value = v1$theT$_M_value; ice47.cc:26:22: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Macintosh-203:ctest innocent$ c++ -O2 -c ice47.cc -std=gnu++0x Macintosh-203:ctest innocent$