Re: [PATCH] rs6000: Fix memory leak in rs6000_density_test

2021-10-14 Thread David Edelsohn via Gcc-patches
On Thu, Oct 14, 2021 at 9:00 AM Richard Sandiford wrote: > > rs6000_density_test has an early exit test between a call > to get_loop_body and the corresponding free. This would > lead to a memory leak if the early exit is taken. > > Tested on powerpc64le-linux-gnu. It's obvious that moving the

[PATCH] rs6000: Fix memory leak in rs6000_density_test

2021-10-14 Thread Richard Sandiford via Gcc-patches
rs6000_density_test has an early exit test between a call to get_loop_body and the corresponding free. This would lead to a memory leak if the early exit is taken. Tested on powerpc64le-linux-gnu. It's obvious that moving the test avoids the leak, but there are multiple ways to write it, so: OK