[PATCH] Fix memory leaks

2022-03-24 Thread Richard Biener via Gcc-patches
When changing the predcom pass to use auto_vec leaks were introduced by failing to replace deallocation with C++ delete. The following does this. It also fixes leaks in vectorization and range folding. Boostrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-03-24 Richard Biener

[PATCH] fix memory leaks

2021-02-02 Thread Richard Biener
This fixes various vec<> memory leaks as discovered compiling 521.wrf_r. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-02-02 Richard Biener * gimple-loop-interchange.cc (prepare_data_references): Release vectors. * gimple-loop-jam.c (tree_loop_unrol

Re: [PATCH] Fix memory leaks in sbitmap.c selftests

2018-01-23 Thread Richard Biener
On Mon, Jan 22, 2018 at 8:51 PM, David Malcolm wrote: > "make selftest-valgrind" shows a few leaks in sbitmap.c's selftests; > this patch fixes them. > > Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. > OK for trunk? Ok. > gcc/ChangeLog: > * sbitmap.c (selftest::test_set_range

[PATCH] Fix memory leaks in sbitmap.c selftests

2018-01-22 Thread David Malcolm
"make selftest-valgrind" shows a few leaks in sbitmap.c's selftests; this patch fixes them. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * sbitmap.c (selftest::test_set_range): Fix memory leaks. (selftest::test_bit_in_range): Likewise. ---

Re: [PATCH] Fix memory leaks in libstdc++ ABI tests

2017-07-10 Thread Jonathan Wakely
On 10/07/17 14:32 -0400, David Edelsohn wrote: The memory leak cleanup has introduced a testsuite failure on AIX: /nasfarm/edelsohn/src/src/libstdc++-v3/testsuite/abi/pr42230.cc: In function 'int main()': /nasfarm/edelsohn/src/src/libstdc++-v3/testsuite/abi/pr42230.cc:15: error: 'free' is not a

Re: [PATCH] Fix memory leaks in libstdc++ ABI tests

2017-07-10 Thread David Edelsohn
The memory leak cleanup has introduced a testsuite failure on AIX: /nasfarm/edelsohn/src/src/libstdc++-v3/testsuite/abi/pr42230.cc: In function 'int main()': /nasfarm/edelsohn/src/src/libstdc++-v3/testsuite/abi/pr42230.cc:15: error: 'free' is not a member of 'std' compiler exited with status 1

[PATCH] Fix memory leaks in libstdc++ tests

2017-07-06 Thread Jonathan Wakely
This fixes some more ASan errors in the testsuite. The first one is a simple leak. The second one is mroe complicated, the test created loads of variables to hold either a strup'd string or "", in order to restore the original environment. Since the test exits after that function, we don't care ab

[PATCH] Fix memory leaks in libstdc++ ABI tests

2017-07-06 Thread Jonathan Wakely
These tests don't bother to free memory before exit, but that means we get ASan errors for them. Fixed like so. * testsuite/abi/pr42230.cc: Free memory. * testsuite/util/testsuite_abi.cc (demangle): Return std::string instead of pointer that might need freeing. * t

Re: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337).

2017-02-02 Thread Jeff Law
redhat-linux and survives regression tests. Ready to be installed? Martin From 08a3ecda47d9d52cd4bb6435aaf18b5b099ef683 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 2 Feb 2017 11:13:13 +0100 Subject: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337). gcc/ChangeLog: 2017-02-02 Martin Lisk

Re: [PATCH] Fix memory leaks in gimple-ssa-sprintf.c (PR tree-optimization/79339).

2017-02-02 Thread Jeff Law
-opt.patch From 627ea01882a2a307b107e5e4aa8de6dc60530a81 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 2 Feb 2017 12:25:32 +0100 Subject: [PATCH] Fix memory leaks in gimple-ssa-sprintf.c (PR tree-optimization/79339). gcc/ChangeLog: 2017-02-02 Martin Liska PR tree-optimization/79339

Re: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337).

2017-02-02 Thread Martin Liška
sue where ipa_free_all_node_params destroys a >> symbol_summary (living in GGC memory) and dtor >> is called for second time via ggc release mechanism. >> >> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. >> >> Ready to be installed?

Re: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337).

2017-02-02 Thread Martin Jambor
> Ready to be installed? > Martin > From 08a3ecda47d9d52cd4bb6435aaf18b5b099ef683 Mon Sep 17 00:00:00 2001 > From: marxin > Date: Thu, 2 Feb 2017 11:13:13 +0100 > Subject: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337). > > gcc/ChangeLog: > > 2017-02-02

[PATCH] Fix memory leaks in gimple-ssa-sprintf.c (PR tree-optimization/79339).

2017-02-02 Thread Martin Liška
017 12:25:32 +0100 Subject: [PATCH] Fix memory leaks in gimple-ssa-sprintf.c (PR tree-optimization/79339). gcc/ChangeLog: 2017-02-02 Martin Liska PR tree-optimization/79339 * gimple-ssa-sprintf.c (format_floating_max): Call mpfr_clear. (format_floating): Likewise. --- gcc/gimple-

[PATCH] Fix memory leaks in IPA CP (PR ipa/79337).

2017-02-02 Thread Martin Liška
u, 2 Feb 2017 11:13:13 +0100 Subject: [PATCH] Fix memory leaks in IPA CP (PR ipa/79337). gcc/ChangeLog: 2017-02-02 Martin Liska PR ipa/79337 * ipa-prop.c (ipa_node_params_t::insert): Remove current implementation. (ipa_node_params_t::remove): Likewise. * ipa-prop.h (ipa_node_params::ip

Re: [PATCH] Fix memory leaks in tree-vect-data-refs.c

2015-12-09 Thread Richard Biener
On Wed, Dec 9, 2015 at 12:14 PM, Martin Liška wrote: > Hi. > > This is simple follow-up of the previous patch that fixes last remaining > leak in vectorizer. > > Patch can regbootstrap on x64_64-linux-gnu. > > Ready for trunk? Ok. Richard. > Martin

[PATCH] Fix memory leaks in tree-vect-data-refs.c

2015-12-09 Thread Martin Liška
ect: [PATCH] Fix memory leaks in tree-vect-data-refs.c gcc/ChangeLog: 2015-12-09 Martin Liska * tree-vect-data-refs.c: Free an overwritten dataref. --- gcc/tree-vect-data-refs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c in

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-26 Thread Bernd Schmidt
On 11/26/2015 09:53 PM, Martin Liška wrote: Is the patch still candidate to be merged in current stage3, or should I leave it to the next stage1? What about the first patch or the patch, where I just applied replacement of whitespaces? As I said previously, the one to just replace whitespace is

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-26 Thread Martin Liška
On 11/20/2015 12:15 PM, Martin Liška wrote: On 11/20/2015 03:14 AM, Bernd Schmidt wrote: BTW, I'm with whoever said absolutely no way to the idea of making automatic changes like this as part of a commit hook. I think the whitespace change can go in if it hasn't already, but I think the other

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-20 Thread Martin Liška
On 11/20/2015 03:14 AM, Bernd Schmidt wrote: > BTW, I'm with whoever said absolutely no way to the idea of making automatic > changes like this as part of a commit hook. > > I think the whitespace change can go in if it hasn't already, but I think the > other one still has enough problems that I

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-19 Thread Bernd Schmidt
BTW, I'm with whoever said absolutely no way to the idea of making automatic changes like this as part of a commit hook. I think the whitespace change can go in if it hasn't already, but I think the other one still has enough problems that I'll say - leave it for the next stage 1. @@ -178,8

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-19 Thread Jeff Law
On 11/19/2015 06:58 AM, Bernd Schmidt wrote: On 11/19/2015 11:16 AM, Martin Liška wrote: You are right, however as the original coding style was really broken, it was much easier to use the tool and clean-up fall-out. Waiting for thoughts related to v2. Better, but still some oddities. I hope

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-19 Thread Martin Liška
On 11/19/2015 02:58 PM, Bernd Schmidt wrote: > On 11/19/2015 11:16 AM, Martin Liška wrote: >> You are right, however as the original coding style was really broken, >> it was much easier >> to use the tool and clean-up fall-out. >> >> Waiting for thoughts related to v2. > > Better, but still some

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-19 Thread Bernd Schmidt
On 11/19/2015 11:16 AM, Martin Liška wrote: You are right, however as the original coding style was really broken, it was much easier to use the tool and clean-up fall-out. Waiting for thoughts related to v2. Better, but still some oddities. I hope you won't get mad at me if I suggest doing t

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-19 Thread Martin Liška
On 11/19/2015 01:50 AM, Joseph Myers wrote: I don't think all the reformattings here are things we want to do globally for most source files. E.g. @@ -75,18 +74,17 @@ get_mask_first_set_bit (unsigned mask) static bool has_undefined_value_p (tree t) { - return (ssa_undefined_value_p (t)

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-18 Thread Bernd Schmidt
On 11/19/2015 01:50 AM, Joseph Myers wrote: I don't think all the reformattings here are things we want to do globally for most source files. While I do appreciate the sentiment behind the patch, I agree with all of Joseph's points. Especially the clearly incorrect changes should be reverted

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-18 Thread Joseph Myers
I don't think all the reformattings here are things we want to do globally for most source files. E.g. > @@ -75,18 +74,17 @@ get_mask_first_set_bit (unsigned mask) > static bool > has_undefined_value_p (tree t) > { > - return (ssa_undefined_value_p (t) > - || (possibly_undefined_nam

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-18 Thread Jeff Law
? Thanks, Martin 0001-Fix-memory-leaks-in-tree-ssa-uninit.c.patch From 54851503251dee7a8bd074485db262715e628728 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 13 Nov 2015 12:23:22 +0100 Subject: [PATCH] Fix memory leaks in tree-ssa-uninit.c gcc/ChangeLog: 2015-11-13 Martin Liska * tree

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-18 Thread Martin Liška
6_64-linux-gnu. >>>> Ready for trunk? >>>> >>>> Thanks, >>>> Martin >>>> >>>> >>>> 0001-Fix-memory-leaks-in-tree-ssa-uninit.c.patch >>>> >>>> >>>> From 54851503251dee7a8bd074485db262715e62

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-13 Thread Jeff Law
54851503251dee7a8bd074485db262715e628728 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 13 Nov 2015 12:23:22 +0100 Subject: [PATCH] Fix memory leaks in tree-ssa-uninit.c gcc/ChangeLog: 2015-11-13 Martin Liska * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Fix GNU coding style

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-13 Thread Martin Liška
0001-Fix-memory-leaks-in-tree-ssa-uninit.c.patch >> >> >> From 54851503251dee7a8bd074485db262715e628728 Mon Sep 17 00:00:00 2001 >> From: marxin >> Date: Fri, 13 Nov 2015 12:23:22 +0100 >> Subject: [PATCH] Fix memory leaks in tree-ssa-uninit.c >> >> gcc/ChangeLog: >> >>

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-13 Thread Jeff Law
12:23:22 +0100 Subject: [PATCH] Fix memory leaks in tree-ssa-uninit.c gcc/ChangeLog: 2015-11-13 Martin Liska * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Fix GNU coding style. (find_def_preds): Use auto_vec. (destroy_predicate_vecs): Change signature

Re: [PATCH] Fix memory leaks in tree-ssa-uninit.c

2015-11-13 Thread Martin Liška
Hello. Patch survives regbootstrap on x86_64-linux-gnu. Ready for trunk? Thanks, Martin >From 54851503251dee7a8bd074485db262715e628728 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 13 Nov 2015 12:23:22 +0100 Subject: [PATCH] Fix memory leaks in tree-ssa-uninit.c gcc/ChangeLog: 2015-11

Re: [PATCH] Fix memory leaks and use a pool_allocator

2015-11-09 Thread Richard Biener
On Mon, Nov 9, 2015 at 2:26 PM, Martin Liška wrote: > On 11/09/2015 01:11 PM, Richard Biener wrote: >> On Mon, Nov 9, 2015 at 12:22 PM, Martin Liška wrote: >>> Hi. >>> >>> This is follow-up of changes that Richi started on Friday. >>> >>> Patch can bootstrap on x86_64-linux-pc and regression test

Re: [PATCH] Fix memory leaks and use a pool_allocator

2015-11-09 Thread Martin Liška
On 11/09/2015 01:11 PM, Richard Biener wrote: > On Mon, Nov 9, 2015 at 12:22 PM, Martin Liška wrote: >> Hi. >> >> This is follow-up of changes that Richi started on Friday. >> >> Patch can bootstrap on x86_64-linux-pc and regression tests are running. >> >> Ready for trunk? > > * tree-ssa

Re: [PATCH] Fix memory leaks and use a pool_allocator

2015-11-09 Thread Trevor Saunders
On Mon, Nov 09, 2015 at 01:11:48PM +0100, Richard Biener wrote: > On Mon, Nov 9, 2015 at 12:22 PM, Martin Liška wrote: > > Hi. > > > > This is follow-up of changes that Richi started on Friday. > > > > Patch can bootstrap on x86_64-linux-pc and regression tests are running. > > > > Ready for trunk

Re: [PATCH] Fix memory leaks and use a pool_allocator

2015-11-09 Thread Richard Biener
On Mon, Nov 9, 2015 at 12:22 PM, Martin Liška wrote: > Hi. > > This is follow-up of changes that Richi started on Friday. > > Patch can bootstrap on x86_64-linux-pc and regression tests are running. > > Ready for trunk? * tree-ssa-dom.c (free_edge_info): Make the function extern. ...

[PATCH] Fix memory leaks and use a pool_allocator

2015-11-09 Thread Martin Liška
100 Subject: [PATCH] Fix memory leaks and use a pool_allocator gcc/ChangeLog: 2015-11-09 Martin Liska * gcc.c (record_temp_file): Release name string. * ifcvt.c (noce_convert_multiple_sets): Release temporaries vector. * lra-lives.c (free_live_range_list): Utilize lra_live_range_pool

Re: [PATCH] Fix memory leaks

2015-11-06 Thread Richard Biener
On Fri, 6 Nov 2015, Richard Biener wrote: > > A few, spotted with valgrind. One is even mine ;) > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. And this is what I committed (one extra leak in postreload-gcse). Richard. 2015-11-06 Richard Biener * tree-ssa-sccvn.c (

[PATCH] Fix memory leaks

2015-11-06 Thread Richard Biener
A few, spotted with valgrind. One is even mine ;) Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2015-11-06 Richard Biener * tree-ssa-sccvn.c (class sccvn_dom_walker): Add destructor. * lra.c (init_reg_info): Truncate copy_vec instead of re-allo

Re: [PATCH] Fix memory leaks in ldist_gen (PR middle-end/56461)

2013-03-04 Thread Richard Biener
On Fri, 1 Mar 2013, Jakub Jelinek wrote: > Hi! > > When merging partitions together, we remove them from partitions vector, > thus don't free them at all. Fixed thusly, bootstrapped/regtested on > x86_64-linux and i686-linux, ok for trunk? Ok. Thanks, Richard. > 2013-03-01 Jakub Jelinek >

[PATCH] Fix memory leaks in ldist_gen (PR middle-end/56461)

2013-03-01 Thread Jakub Jelinek
Hi! When merging partitions together, we remove them from partitions vector, thus don't free them at all. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-03-01 Jakub Jelinek PR middle-end/56461 * tree-loop-distribution.c (ldist_gen): Ca

Re: [PATCH] Fix memory leaks in incpath.c

2013-02-26 Thread Joseph S. Myers
On Tue, 26 Feb 2013, Jakub Jelinek wrote: > Hi! > > Another file with memory leaks. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2013-02-26 Jakub Jelinek > > * incpath.c (add_standard_paths): Use reconcat instead of concat > where appropriate and

Re: [PATCH] Fix memory leaks in options handling

2013-02-26 Thread Joseph S. Myers
On Tue, 26 Feb 2013, Jakub Jelinek wrote: > The following patch attempts to fix that by allocating strings which we want > to keep allocated forever, and from time to time lose all the pointers > pointing to them, in an obstack. That could in theory make the allocations > tiny bit faster, but mor

[PATCH] Fix memory leaks in incpath.c

2013-02-26 Thread Jakub Jelinek
Hi! Another file with memory leaks. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-02-26 Jakub Jelinek * incpath.c (add_standard_paths): Use reconcat instead of concat where appropriate and avoid leaking memory. --- gcc/incpath.c.jj2013-01-11 0

[PATCH] Fix memory leaks in options handling

2013-02-26 Thread Jakub Jelinek
Hi! The memory leaks in the options handling, while they perhaps aren't that big, keep cluttering valgrind --leak-check=full outputs and make it harder to find other, more severe, bugs. The following patch attempts to fix that by allocating strings which we want to keep allocated forever, and fro