Commit 570e71f8 by H.J. Lu Committed by H.J. Lu

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.

From-SVN: r194359
parent 4bcc5786
2012-12-10 H.J. Lu <hongjiu.lu@intel.com>
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 <rguenther@suse.de> 2012-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/55107 PR tree-optimization/55107
...@@ -443,10 +443,6 @@ lto_symtab_merge_decls_1 (symtab_node first) ...@@ -443,10 +443,6 @@ lto_symtab_merge_decls_1 (symtab_node first)
symtab_prevail_in_asm_name_hash (prevailing); 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. */ /* Diagnose mismatched objects. */
for (e = prevailing->symbol.next_sharing_asm_name; for (e = prevailing->symbol.next_sharing_asm_name;
e; e = e->symbol.next_sharing_asm_name) e; e = e->symbol.next_sharing_asm_name)
......
...@@ -1766,7 +1766,6 @@ lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl) ...@@ -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)); ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
rest_of_decl_compilation (decl, 1, 0); rest_of_decl_compilation (decl, 1, 0);
vec_safe_push (lto_global_var_decls, decl);
} }
/* If this variable has already been declared, queue the /* If this variable has already been declared, queue the
...@@ -3380,6 +3379,8 @@ lto_main (void) ...@@ -3380,6 +3379,8 @@ lto_main (void)
do_whole_program_analysis (); do_whole_program_analysis ();
else else
{ {
struct varpool_node *vnode;
timevar_start (TV_PHASE_OPT_GEN); timevar_start (TV_PHASE_OPT_GEN);
materialize_cgraph (); materialize_cgraph ();
...@@ -3397,6 +3398,10 @@ lto_main (void) ...@@ -3397,6 +3398,10 @@ lto_main (void)
this. */ this. */
if (flag_lto_report) if (flag_lto_report)
print_lto_report_1 (); print_lto_report_1 ();
/* Record the global variables. */
FOR_EACH_DEFINED_VARIABLE (vnode)
vec_safe_push (lto_global_var_decls, vnode->symbol.decl);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment