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 init_reload memory leak


On 01/21/2013 07:36 AM, Jakub Jelinek wrote:
Hi!

While working on the multiversioning patch I've just posted,
I've noticed that on say:
void foo ();
void foo () __attribute__((target ("avx")));
void foo () __attribute__((target ("default")));
__attribute__((target ("default"))) void foo ()
{
}
__attribute__((target ("avx"))) void foo ()
{
}
void (*fn) () = foo;
we leak memory, because init_reload is called several times (due to target
attribute) and it never destroys reload_obstack already created before
initializing a new one.  Fixed by initializing it just once.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2013-01-21 Jakub Jelinek <jakub@redhat.com>

	* reload1.c (init_reload): Only initialize reload_obstack
	during the first call.
OK.
jeff


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