Fix Libreoffice LTO build failure

Jan Hubicka hubicka@ucw.cz
Thu Sep 11 06:49:00 GMT 2014


Hi,
Libreoffice fails to build because ltrans tries to fetch in variable constructor
that is not shipped there.  Fixed thus.

Bootstrapped/regtested x86_64-linux.

Honza

	* varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try
	to access removed nodes.

Index: varpool.c
===================================================================
--- varpool.c	(revision 215100)
+++ varpool.c	(working copy)
@@ -316,6 +316,11 @@ varpool_node::ctor_useable_for_folding_p
       && !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))



More information about the Gcc-patches mailing list