]> git.ipfire.org Git - thirdparty/gcc.git/commit
DWARF: Don't expand hash table when no insertion is needed
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Dec 2018 13:49:16 +0000 (13:49 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Dec 2018 13:49:16 +0000 (13:49 +0000)
commite0c1c98768d5de5c0469b72355fe8d8c5721fc61
tree3e677886f5fd74a4e30f43e668a35c71ddc3f37f
parentbed69f867769f9cae987e6727ea95f1d113d51e4
DWARF: Don't expand hash table when no insertion is needed

dwarf2out_finish performs:

1. save_macinfo_strings
2. hash table traverse of index_string
3. output_macinfo -> output_macinfo_op
4. output_indirect_strings -> hash table traverse of output_index_string

find_slot_with_hash has

 if (insert == INSERT && m_size * 3 <= m_n_elements * 4)
    expand ();

which may expand hash table even if no insertion is neeed and change hash
table traverse order.  When output_macinfo_op is called, all index strings
have been added to hash table by save_macinfo_strings and we shouldn't
expand index string hash table.  Otherwise find_slot_with_hash will expand
hash table when hash table has the right size and hash table traverse of
output_index_string will have a different traverse order from index_string.

PR debug/79342
* dwarf2out.c (find_AT_string_in_table): Add insert argument
defaulting to INSERT and replace INSERT.
(find_AT_string): Likewise.
(output_macinfo_op): Pass NO_INSERT to find_AT_string.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267202 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dwarf2out.c