]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try to access removed...
authorJan Hubicka <hubicka@ucw.cz>
Thu, 11 Sep 2014 06:48:23 +0000 (08:48 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 11 Sep 2014 06:48:23 +0000 (06:48 +0000)
* varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try
to access removed nodes.

From-SVN: r215150

gcc/ChangeLog
gcc/varpool.c

index 242704859b927a807fa0ff3880dd390cc40c9e74..40f912ab9d2910b908ac806d3f0c827e5e394867 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-10  Jan Hubicka  <hubicka@ucw.cz>
+
+       * varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try
+       to access removed nodes.
+
 2014-09-10  Jan Hubicka  <hubicka@ucw.cz>
 
        PR tree-optimization/63186
index 72971d61b53e70cacb466a280e0569484b633dd0..14ef0896eac21594d55c2beb4d866aff92d9e02b 100644 (file)
@@ -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))