From 17f781605e695711a3383b0474e806ce8150cf49 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 15 Jan 2019 16:06:42 +0000 Subject: [PATCH] re PR debug/88046 (ICE in add_data_member_location_attribute at gcc/dwarf2out.c:19237 since r261885) 2019-01-15 Richard Biener PR debug/88046 * dwarf2out.c (gen_member_die): Do not generate inheritance DIEs late. * g++.dg/lto/pr88046_0.C: New testcase. From-SVN: r267940 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/lto/pr88046_0.C | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr88046_0.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14f0730a038..c3b9f14de52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-01-15 Richard Biener + + PR debug/88046 + * dwarf2out.c (gen_member_die): Do not generate inheritance + DIEs late. + 2019-01-15 Richard Biener PR tree-optimization/88855 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8b4f7bc95bf..a1b5a5eaf19 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -25046,7 +25046,7 @@ gen_member_die (tree type, dw_die_ref context_die) the TREE node representing the appropriate (containing) type. */ /* First output info about the base classes. */ - if (binfo) + if (binfo && early_dwarf) { vec *accesses = BINFO_BASE_ACCESSES (binfo); int i; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a5cfa7f6291..1b0689d5ea2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-15 Richard Biener + + PR debug/88046 + * g++.dg/lto/pr88046_0.C: New testcase. + 2019-01-15 Richard Biener PR tree-optimization/88855 diff --git a/gcc/testsuite/g++.dg/lto/pr88046_0.C b/gcc/testsuite/g++.dg/lto/pr88046_0.C new file mode 100644 index 00000000000..a254dd03586 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr88046_0.C @@ -0,0 +1,14 @@ +// { dg-lto-do link } +// { dg-lto-options { { -O2 -fPIC -flto } } } +// { dg-extra-ld-options "-shared -g" } + +class a {}; +class b : virtual a { +public: + void operator<<(bool); +}; +void c() try { + b d; + d << ""; +} catch (int) { +} -- 2.30.2