diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2012-12-10 14:43:54 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2012-12-10 06:43:54 -0800 |
commit | 570e71f8a0c70ccbbdc2f167a8debba09d198862 (patch) | |
tree | 600079d432d10777a0372663aba17b59c1136cbd /gcc/lto | |
parent | 4bcc5786cca9aa729d2f3a94448dae22fd5f114b (diff) | |
download | gcc-570e71f8a0c70ccbbdc2f167a8debba09d198862.zip gcc-570e71f8a0c70ccbbdc2f167a8debba09d198862.tar.gz gcc-570e71f8a0c70ccbbdc2f167a8debba09d198862.tar.bz2 |
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
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/lto.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); } } |