This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix thinko in early bail out in tree-switch-conversion.


On 8/30/19 2:41 AM, Martin Liška wrote:
> Hi.
> 
> Thanks to Jakub, the patch addresses one memory leak in
> bit_test_cluster::find_bit_tests (allocation of output).
> And moreover, it implements proper guard when clustering
> is not successful. In such situation we want a quick bail out.
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-08-29  Martin Liska  <mliska@suse.cz>
> 
> 	* tree-switch-conversion.c (jump_table_cluster::find_jump_tables):
> 	Bail out when we'll end up with the same number of clusters as
> 	at the beginning.
> 	(bit_test_cluster::find_bit_tests): Likewise for bit tests.
> 	(jump_table_cluster::can_be_handled): Remove the guard
> 	as it's already handled in ::is_enabled.  Allocate output
> 	after early bail out.
> ---
>  gcc/tree-switch-conversion.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> 
OK
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]