From 7c46e07ba46a9a508f45092f681d228330539d80 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 11 Sep 2014 08:48:23 +0200 Subject: [PATCH] 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(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 242704859b9..40f912ab9d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/varpool.c b/gcc/varpool.c index 72971d61b53..14ef0896eac 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)) -- 2.30.2