http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45968
Summary: ICE: tree code 'template_type_parm' is not supported in gimple streams with -flto Product: gcc Version: lto Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: scov...@gmail.com The following minimal test case makes x86_64-unknown-linux-gnu-gcc-4.5.1 ICE when the -flto flag is supplied: $ cat > lto-bug.h <<EOF #pragma interface template<class T> struct foo; template<class T> struct foo<T*&> : foo<T&> { foo<T*&>(T* t) : foo<T&>(*t) { } }; EOF $ cat > lto-bug.C <<EOF #pragma implementation "lto-bug.h" #include "lto-bug.h" EOF $ gcc-4.5.1 -flto lto-bug.C In file included from lto-bug.C:2:0: lto-bug.h:6:2: internal compiler error: tree code ‘template_type_parm’ is not supported in gimple streams Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Removing anything at all makes the ICE disappear This seemed similar to bug #45959, but applying the patch mentioned there to gcc-4.5.1-src/gcc/cp/pt.c:11322 does not help so I'm filing a new bug for this.