+2018-11-07 Richard Biener <rguenther@suse.de>
+
+ PR lto/87906
+ * tree-streamer-in.c (lto_input_ts_block_tree_pointers): Fixup
+ BLOCK_ABSTRACT_ORIGIN to be the ultimate origin.
+
2018-11-07 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/87874
+2018-11-07 Richard Biener <rguenther@suse.de>
+
+ PR lto/87906
+ * g++.dg/lto/pr87906_0.C: New testcase.
+ * g++.dg/lto/pr87906_1.C: Likewise.
+
2018-11-07 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/87874
--- /dev/null
+// { dg-lto-do link }
+// { dg-lto-options { { -O -fPIC -flto } } }
+// { dg-extra-ld-options "-shared -nostdlib" }
+
+namespace com {
+namespace sun {
+namespace star {}
+} // namespace sun
+} // namespace com
+namespace a = com::sun::star;
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+class a {
+public:
+ ~a();
+};
+
+class b {
+public:
+ ~b();
+ a c;
+};
+class c {
+ b e;
+};
+class RuntimeException : b {};
+} // namespace uno
+} // namespace star
+} // namespace sun
+} // namespace com
+template <typename> void d(int) { throw a::uno::RuntimeException(); }
+int f;
+void g() { d<a::uno::b>(f); }
--- /dev/null
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+class a {
+public:
+ ~a();
+};
+class b {
+public:
+~b();
+ a c;
+};
+class RuntimeException : b {};
+} // namespace uno
+class C : uno::RuntimeException {};
+} // namespace star
+} // namespace sun
+} // namespace com
+using com::sun::star::C;
+using com::sun::star::uno::RuntimeException;
+void d() { throw RuntimeException(); }
+void e() { C(); }
BLOCK_SUPERCONTEXT (expr) = stream_read_tree (ib, data_in);
BLOCK_ABSTRACT_ORIGIN (expr) = stream_read_tree (ib, data_in);
+ /* We may end up prevailing a decl with DECL_ORIGIN (t) != t here
+ which breaks the invariant that BLOCK_ABSTRACT_ORIGIN is the
+ ultimate origin. Fixup here.
+ ??? This should get fixed with moving to DIE references. */
+ if (DECL_P (BLOCK_ORIGIN (expr)))
+ BLOCK_ABSTRACT_ORIGIN (expr) = DECL_ORIGIN (BLOCK_ABSTRACT_ORIGIN (expr));
/* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information
for early inlined BLOCKs so drop it on the floor instead of ICEing in
dwarf2out.c. */