Commit 50258c4d by Richard Biener Committed by Richard Biener

re PR lto/87906 (ICE in tree check: expected block, have function_decl in…

re PR lto/87906 (ICE in tree check: expected block, have function_decl in block_ultimate_origin, at tree.c:12326 since r264734)

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.

	* g++.dg/lto/pr87906_0.C: New testcase.
	* g++.dg/lto/pr87906_1.C: Likewise.

From-SVN: r265861
parent 59193b1b
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
......
// { 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); }
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(); }
......@@ -914,6 +914,12 @@ lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment