https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64858
Bug ID: 64858 Summary: [5 Regression] Libreoffice build failure caused by ICF crash Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: marxin at gcc dot gnu.org trippels@gcc2-power8 ~ % cat xpathobject.ii template <class reference_type> class A { reference_type *m_pBody; public: A (const A &) { m_pBody->acquire (); } }; class B; class C { protected: B *_pInterface; }; template <class interface_type> class I : C { public: I (interface_type *); }; class B { public: virtual void acquire (); }; class D { protected: void acquire (); }; template <class Ifc1> class J : D, public Ifc1 { void acquire () { D::acquire (); } }; class K : B { }; class L; class F { A<L> m_pDocument; F (A<L> const &, int &&); }; class XUnoTunnel; class XEventTarget; template <class, class> class WeakImplHelper3 : D, B { void acquire () { D::acquire (); } }; template <class> class G { public: void acquire () { WeakImplHelper3<XUnoTunnel, XEventTarget> (); } }; struct H { H () : mxAttribList (new J<B>), mxCurrentHandler (0), mxDocHandler (0), mxTokenHandler (0) { } I<J<B> > mxAttribList; I<int> mxCurrentHandler; I<int> mxDocHandler; I<int> mxTokenHandler; }; class L : public G<int> { }; class M : public J<K> { public: M (); }; template <class interface_type> I<interface_type>::I (interface_type *p1) { B *a = static_cast<B *> (static_cast<void *> (p1)); _pInterface = a; _pInterface->acquire (); } F::F (A<L> const &p1, int &&) : m_pDocument (p1) { I<K> (new M); } trippels@gcc2-power8 ~ % g++ -O2 -std=gnu++11 -c xpathobject.ii xpathobject.ii:90:66: internal compiler error: Segmentation fault F::F (A<L> const &p1, int &&) : m_pDocument (p1) { I<K> (new M); } ^ 0x10a141eb crash_signal ../../gcc/gcc/toplev.c:383 0x11070c88 tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/gcc/tree.h:2845 0x11070c88 ipa_icf::sem_function::init() ../../gcc/gcc/ipa-icf.c:786 0x11074923 ipa_icf::sem_item_optimizer::parse_nonsingleton_classes() ../../gcc/gcc/ipa-icf.c:1865 0x1107c353 ipa_icf::sem_item_optimizer::execute() ../../gcc/gcc/ipa-icf.c:1721 0x1107d173 ipa_icf_driver ../../gcc/gcc/ipa-icf.c:2461 0x1107d173 ipa_icf::pass_ipa_icf::execute(function*) ../../gcc/gcc/ipa-icf.c:2509 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.