This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] mark all statics and externals needed
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 29 Dec 2007 20:33:46 -0800
- Subject: [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. */