http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60266
--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- It's caused by mixing -O0 and -O2 with LTO: markus@x4 ~S % cat TableCopyHelper.ii namespace com { namespace sun { namespace star {} } } namespace css = com::sun::star; namespace com { namespace sun { namespace star { class A {}; template <class interface_type> class C : A { public: interface_type *operator->(); }; } } typedef struct { } uno_Any; namespace sun { namespace star { class D : uno_Any {}; class B { virtual css::D m_fn1(); virtual void m_fn2(); virtual void m_fn3(); }; class F : css::B { virtual int m_fn4(); }; namespace sdb { namespace application { class XCopyTableWizard : css::F { public: virtual void m_fn5(); virtual void m_fn6(); }; } } } } using namespace com::sun::star; using namespace com::sun::star::sdb::application; void fn1(C<int> &&) try { C<XCopyTableWizard> a; a->m_fn6(); } catch (int &) { } } markus@x4 ~S % cat copytablewizard.ii namespace com { namespace sun { namespace star { class A {}; namespace sdb { namespace application { class XCopyTableWizard { virtual int m_fn1(); }; } } } } } class OPropertyArrayUsageHelper { public: virtual ~OPropertyArrayUsageHelper(); }; using com::sun::star::A; using com::sun::star::sdb::application::XCopyTableWizard; class CopyTableWizard : XCopyTableWizard, OPropertyArrayUsageHelper { ~CopyTableWizard(); }; CopyTableWizard::~CopyTableWizard() try {} catch (A &) { } markus@x4 ~S % g++ -flto -fPIC -O0 -c copytablewizard.ii markus@x4 ~S % g++ -flto -fPIC -std=gnu++11 -O2 -c TableCopyHelper.ii markus@x4 ~S % g++ -w -r -nostdlib -O2 TableCopyHelper.o copytablewizard.o lto1: internal compiler error: in ipa_get_parm_lattices, at ipa-cp.c:261 0x50c7ac ipa_get_parm_lattices ../../gcc/gcc/ipa-cp.c:261 0xc41824 ipa_get_parm_lattices ../../gcc/gcc/ipa-cp.c:261 0xc41824 propagate_constants_accross_call ../../gcc/gcc/ipa-cp.c:1443 0xc44308 propagate_constants_topo ../../gcc/gcc/ipa-cp.c:2231 0xc44308 ipcp_propagate_stage ../../gcc/gcc/ipa-cp.c:2327 0xc44308 ipcp_driver ../../gcc/gcc/ipa-cp.c:3705 0xc44308 execute ../../gcc/gcc/ipa-cp.c:3804 Please submit a full bug report, with preprocessed source if appropriate. (I think the ODR violation got introduced during reduction.)