From 7c46e07ba46a9a508f45092f681d228330539d80 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 11 Sep 2014 08:48:23 +0200 Subject: varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try to access removed nodes. * varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try to access removed nodes. From-SVN: r215150 --- gcc/ChangeLog | 5 +++++ gcc/varpool.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2427048..40f912a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-09-10 Jan Hubicka + * varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try + to access removed nodes. + +2014-09-10 Jan Hubicka + PR tree-optimization/63186 * ipa-split.c (test_nonssa_use): Skip nonforced labels. (mark_nonssa_use): Likewise. diff --git a/gcc/varpool.c b/gcc/varpool.c index 72971d6..14ef089 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -316,6 +316,11 @@ varpool_node::ctor_useable_for_folding_p (void) && !real_node->lto_file_data) return false; + /* Avoid attempts to load constructors that was not streamed. */ + if (flag_ltrans && DECL_INITIAL (real_node->decl) == error_mark_node + && real_node->body_removed) + return false; + /* Vtables are defined by their types and must match no matter of interposition rules. */ if (DECL_VIRTUAL_P (decl)) -- cgit v1.1