diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr87906_0.C | 35 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr87906_1.C | 23 | ||||
-rw-r--r-- | gcc/tree-streamer-in.c | 6 |
5 files changed, 76 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d1fde63..a34bf51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 66a09d6..5b07259 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/testsuite/g++.dg/lto/pr87906_0.C b/gcc/testsuite/g++.dg/lto/pr87906_0.C new file mode 100644 index 0000000..08e7ed3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr87906_0.C @@ -0,0 +1,35 @@ +// { 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); } diff --git a/gcc/testsuite/g++.dg/lto/pr87906_1.C b/gcc/testsuite/g++.dg/lto/pr87906_1.C new file mode 100644 index 0000000..ee5849f --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr87906_1.C @@ -0,0 +1,23 @@ +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(); } diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index f1e8244..a1e67d6 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.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. */ |