diff options
author | Jan Hubicka <jh@suse.cz> | 2020-11-23 16:52:36 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-11-23 16:53:25 +0100 |
commit | 54af3008b6f05985d378a48d337d9c70c708ecff (patch) | |
tree | c31e53f785aa5d8c97068be67ec8e3cce2c9a655 /gcc/tree-ssa.c | |
parent | 204b61b906f2f806eec2f7bb72d4dd79c88d688a (diff) | |
download | gcc-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.c | 7 |
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. */ |