if-to-switch: fix memory leak in case merging
authorMartin Liska <mliska@suse.cz>
Wed, 10 Feb 2021 08:39:54 +0000 (09:39 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 10 Feb 2021 12:20:51 +0000 (13:20 +0100)
commit57d1b68d6582efec5a7ca63ea56a1cedbfe6e874
treeb8369683a8f68c196135dcd7814464e62629c366
parent72932511053596091ad291539022b51d9f2ba418
if-to-switch: fix memory leak in case merging

gcc/ChangeLog:

PR tree-optimization/99002
PR tree-optimization/99026
* gimple-if-to-switch.cc (if_chain::is_beneficial): Fix memory
leak when adjacent cases are merged.
* tree-switch-conversion.c (switch_decision_tree::analyze_switch_statement): Use
release_clusters.
(make_pass_lower_switch): Remove trailing whitespace.
* tree-switch-conversion.h (release_clusters): New.
gcc/gimple-if-to-switch.cc
gcc/tree-switch-conversion.c
gcc/tree-switch-conversion.h