From f2c28d6b80106b068f8c58b88f3b3ff8adec75ee Mon Sep 17 00:00:00 2001 From: hjl Date: Mon, 10 Dec 2012 14:43:54 +0000 Subject: [PATCH] Record the global variables if WPA isn't enabled PR lto/55466 * lto-symtab.c (lto_symtab_merge_decls_1): Don't record the prevailing variable. * lto.c (lto_register_var_decl_in_symtab): Don't record static variables. (lto_main): Record the global variables if WPA isn't enabled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194359 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/lto-symtab.c | 4 ---- gcc/lto/lto.c | 7 ++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 00c7fef..f36d841 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2012-12-10 H.J. Lu + + PR lto/55466 + * lto-symtab.c (lto_symtab_merge_decls_1): Don't record the + prevailing variable. + * lto.c (lto_register_var_decl_in_symtab): Don't record static + variables. + (lto_main): Record the global variables if WPA isn't enabled. + 2012-12-10 Richard Biener PR tree-optimization/55107 diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 0b0cdac..295fd37 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -443,10 +443,6 @@ lto_symtab_merge_decls_1 (symtab_node first) symtab_prevail_in_asm_name_hash (prevailing); - /* Record the prevailing variable. */ - if (TREE_CODE (prevailing->symbol.decl) == VAR_DECL) - vec_safe_push (lto_global_var_decls, prevailing->symbol.decl); - /* Diagnose mismatched objects. */ for (e = prevailing->symbol.next_sharing_asm_name; e; e = e->symbol.next_sharing_asm_name) diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 376af85..915303e 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1766,7 +1766,6 @@ lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl) ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label)); rest_of_decl_compilation (decl, 1, 0); - vec_safe_push (lto_global_var_decls, decl); } /* If this variable has already been declared, queue the @@ -3380,6 +3379,8 @@ lto_main (void) do_whole_program_analysis (); else { + struct varpool_node *vnode; + timevar_start (TV_PHASE_OPT_GEN); materialize_cgraph (); @@ -3397,6 +3398,10 @@ lto_main (void) this. */ if (flag_lto_report) print_lto_report_1 (); + + /* Record the global variables. */ + FOR_EACH_DEFINED_VARIABLE (vnode) + vec_safe_push (lto_global_var_decls, vnode->symbol.decl); } } -- 2.7.4