From 760e1bb7e2d0dd045c8aac2320fd073eebe9e93d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 24 Sep 2015 11:01:14 +0000 Subject: [PATCH] re PR lto/67699 (ICE (segfault) compiling a const array with -flto) 2015-09-24 Richard Biener PR lto/67699 * lto-cgraph.c (compute_ltrans_boundary): Do not stream abstract origins. * g++.dg/pr67699.C: New testcase. From-SVN: r228084 --- gcc/ChangeLog | 6 ++++++ gcc/lto-cgraph.c | 15 --------------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr67699.C | 8 ++++++++ 4 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/g++.dg/pr67699.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bc8e91855b..ed7224fa3a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-24 Richard Biener + + PR lto/67699 + * lto-cgraph.c (compute_ltrans_boundary): Do not stream + abstract origins. + 2015-09-24 Thomas Schwinge * tree-object-size.c (plus_stmt_object_size) diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index d70537dbd07..51f31c8cd2b 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -895,14 +895,6 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder) add_node_to (encoder, node, true); lto_set_symtab_encoder_in_partition (encoder, node); create_references (encoder, node); - /* For proper debug info, we need to ship the origins, too. */ - if (DECL_ABSTRACT_ORIGIN (node->decl)) - { - struct cgraph_node *origin_node - = cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (node->decl)); - origin_node->used_as_abstract_origin = true; - add_node_to (encoder, origin_node, true); - } } for (lsei = lsei_start_variable_in_partition (in_encoder); !lsei_end_p (lsei); lsei_next_variable_in_partition (&lsei)) @@ -914,13 +906,6 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder) lto_set_symtab_encoder_in_partition (encoder, vnode); lto_set_symtab_encoder_encode_initializer (encoder, vnode); create_references (encoder, vnode); - /* For proper debug info, we need to ship the origins, too. */ - if (DECL_ABSTRACT_ORIGIN (vnode->decl)) - { - varpool_node *origin_node - = varpool_node::get (DECL_ABSTRACT_ORIGIN (vnode->decl)); - lto_set_symtab_encoder_in_partition (encoder, origin_node); - } } /* Pickle in also the initializer of all referenced readonly variables to help folding. Constant pool variables are not shared, so we must diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe4f67f7000..02dc90256e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-24 Richard Biener + + PR lto/67699 + * g++.dg/pr67699.C: New testcase. + 2015-09-24 Richard Earnshaw PR libgcc/67624 diff --git a/gcc/testsuite/g++.dg/pr67699.C b/gcc/testsuite/g++.dg/pr67699.C new file mode 100644 index 00000000000..c9ff591939a --- /dev/null +++ b/gcc/testsuite/g++.dg/pr67699.C @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-require-effective-target lto } +// { dg-options "-flto" } + +template class foo { + foo() { int const bar[2] = {1, 1}; } +}; +template class foo; -- 2.30.2