aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-11-23 16:52:36 +0100
committerJan Hubicka <jh@suse.cz>2020-11-23 16:53:25 +0100
commit54af3008b6f05985d378a48d337d9c70c708ecff (patch)
treec31e53f785aa5d8c97068be67ec8e3cce2c9a655 /gcc/tree-ssa.c
parent204b61b906f2f806eec2f7bb72d4dd79c88d688a (diff)
downloadgcc-54af3008b6f05985d378a48d337d9c70c708ecff.zip
gcc-54af3008b6f05985d378a48d337d9c70c708ecff.tar.gz
gcc-54af3008b6f05985d378a48d337d9c70c708ecff.tar.bz2
Do not leak SSANAMES in lto streamer
* lto-streamer-in.c (input_cfg): Do not init ssa operands. (input_function): Do not init tree_ssa and set in_ssa_p. (input_ssa_names): Do it here. * tree-ssa.c (init_tree_ssa): Add additional SIZE parameter, default to 0 * tree-ssanames.c (init_ssanames): Do not round size up to 50, allocate precisely. * tree-ssa.h (init_tree_ssa): Update prototype.
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index b44361f..a575979 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1218,15 +1218,16 @@ err:
# pragma GCC diagnostic pop
#endif
-/* Initialize global DFA and SSA structures. */
+/* Initialize global DFA and SSA structures.
+ If SIZE is non-zero allocated ssa names array of a given size. */
void
-init_tree_ssa (struct function *fn)
+init_tree_ssa (struct function *fn, int size)
{
fn->gimple_df = ggc_cleared_alloc<gimple_df> ();
fn->gimple_df->default_defs = hash_table<ssa_name_hasher>::create_ggc (20);
pt_solution_reset (&fn->gimple_df->escaped);
- init_ssanames (fn, 0);
+ init_ssanames (fn, size);
}
/* Deallocate memory associated with SSA data structures for FNDECL. */