aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-02-05 15:23:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-02-05 15:23:36 +0000
commitf0f91770c34553275669df72794f5d478ae5fe7c (patch)
tree4b1c031686beae28ef49b51378b37ee5fa2a379a /gcc/lto
parent6fc595232b90a0f31a02087a152e2741fb0dee8f (diff)
downloadgcc-f0f91770c34553275669df72794f5d478ae5fe7c.zip
gcc-f0f91770c34553275669df72794f5d478ae5fe7c.tar.gz
gcc-f0f91770c34553275669df72794f5d478ae5fe7c.tar.bz2
lto.h (lto_global_var_decls): Remove.
2014-02-05 Richard Biener <rguenther@suse.de> lto/ * lto.h (lto_global_var_decls): Remove. * lto-lang.c (lto_init): Do not allocate lto_global_var_decls. (lto_write_globals): Do nothing in WPA stage, gather globals from the varpool here ... * lto.c (lto_main): ... not here. (materialize_cgraph): Do not call rest_of_decl_compilation on the empty lto_global_var_decls vector. (lto_global_var_decls): Remove. From-SVN: r207510
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog11
-rw-r--r--gcc/lto/lto-lang.c16
-rw-r--r--gcc/lto/lto.c14
-rw-r--r--gcc/lto/lto.h3
4 files changed, 23 insertions, 21 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 0f9e688..15610f2 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,14 @@
+2014-02-05 Richard Biener <rguenther@suse.de>
+
+ * lto.h (lto_global_var_decls): Remove.
+ * lto-lang.c (lto_init): Do not allocate lto_global_var_decls.
+ (lto_write_globals): Do nothing in WPA stage, gather globals from
+ the varpool here ...
+ * lto.c (lto_main): ... not here.
+ (materialize_cgraph): Do not call rest_of_decl_compilation
+ on the empty lto_global_var_decls vector.
+ (lto_global_var_decls): Remove.
+
2014-02-04 Jan Hubicka <hubicka@ucw.cz>
* lto-partition.c (get_symbol_class): Only unforced DECL_ONE_ONLY
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index b5e5d6a..0ef65cf 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -1075,11 +1075,20 @@ lto_getdecls (void)
static void
lto_write_globals (void)
{
- tree *vec = lto_global_var_decls->address ();
- int len = lto_global_var_decls->length ();
+ if (flag_wpa)
+ return;
+
+ /* Record the global variables. */
+ vec<tree> lto_global_var_decls = vNULL;
+ varpool_node *vnode;
+ FOR_EACH_DEFINED_VARIABLE (vnode)
+ lto_global_var_decls.safe_push (vnode->decl);
+
+ tree *vec = lto_global_var_decls.address ();
+ int len = lto_global_var_decls.length ();
wrapup_global_declarations (vec, len);
emit_debug_global_declarations (vec, len);
- vec_free (lto_global_var_decls);
+ lto_global_var_decls.release ();
}
static tree
@@ -1218,7 +1227,6 @@ lto_init (void)
#undef NAME_TYPE
/* Initialize LTO-specific data structures. */
- vec_alloc (lto_global_var_decls, 256);
in_lto_p = true;
return true;
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index a769f25..579c91c 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -50,8 +50,6 @@ along with GCC; see the file COPYING3. If not see
#include "context.h"
#include "pass_manager.h"
-/* Vector to keep track of external variables we've seen so far. */
-vec<tree, va_gc> *lto_global_var_decls;
static GTY(()) tree first_personality_decl;
@@ -3009,9 +3007,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
static void
materialize_cgraph (void)
{
- tree decl;
struct cgraph_node *node;
- unsigned i;
timevar_id_t lto_timer;
if (!quiet_flag)
@@ -3043,10 +3039,6 @@ materialize_cgraph (void)
current_function_decl = NULL;
set_cfun (NULL);
- /* Inform the middle end about the global variables we have seen. */
- FOR_EACH_VEC_ELT (*lto_global_var_decls, i, decl)
- rest_of_decl_compilation (decl, 1, 0);
-
if (!quiet_flag)
fprintf (stderr, "\n");
@@ -3309,8 +3301,6 @@ lto_main (void)
do_whole_program_analysis ();
else
{
- varpool_node *vnode;
-
timevar_start (TV_PHASE_OPT_GEN);
materialize_cgraph ();
@@ -3330,10 +3320,6 @@ lto_main (void)
this. */
if (flag_lto_report || (flag_wpa && flag_lto_report_wpa))
print_lto_report_1 ();
-
- /* Record the global variables. */
- FOR_EACH_DEFINED_VARIABLE (vnode)
- vec_safe_push (lto_global_var_decls, vnode->decl);
}
}
diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h
index bb8e2ed..3c3c326 100644
--- a/gcc/lto/lto.h
+++ b/gcc/lto/lto.h
@@ -41,9 +41,6 @@ extern tree lto_eh_personality (void);
extern void lto_main (void);
extern void lto_read_all_file_options (void);
-/* In lto-symtab.c */
-extern GTY(()) vec<tree, va_gc> *lto_global_var_decls;
-
/* In lto-elf.c or lto-coff.c */
extern lto_file *lto_obj_file_open (const char *filename, bool writable);
extern void lto_obj_file_close (lto_file *file);