This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] mark all statics and externals needed


The patch below should be fairly self-explanatory and is necessary for
proper compilation of static variables on powerpc64-unknown-linux-gnu.

With this change, all C SPECint benchmarks build and run successfully on
powerpc64-unknown-linux-gnu in 64-bit mode.

Committed to the LTO branch.

-Nathan

2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>

	* lto-read.c (input_expr_operand): Mark static and external
	VAR_DECLs as needed.

Index: lto-read.c
===================================================================
--- lto-read.c	(revision 131223)
+++ lto-read.c	(working copy)
@@ -765,8 +765,11 @@ input_expr_operand (struct input_block *
     case VAR_DECL:
     case PARM_DECL:
       if (tag == LTO_var_decl1)
-	/* Static or externs are here.  */
-	result = data_in->var_decls [input_uleb128 (ib)];
+        {
+          /* Static or externs are here.  */
+          result = data_in->var_decls [input_uleb128 (ib)];
+	  varpool_mark_needed_node (varpool_node (result));
+        }
       else 
 	{
 	  /* Locals are here.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]