From: Jan Hubicka Date: Thu, 11 Sep 2014 06:48:23 +0000 (+0200) Subject: varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try to access removed... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c46e07ba46a9a508f45092f681d228330539d80;p=gcc.git 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 --- 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))