This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimize malloc to stack allocation.
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 9 Jan 2013 17:12:06 +0100 (CET)
- Subject: Re: optimize malloc to stack allocation.
- References: <20130109155900.GA10541@domone.kolej.mff.cuni.cz>
- Reply-to: gcc at gcc dot gnu dot org
On Wed, 9 Jan 2013, Ondřej Bílka wrote:
gcc currently does not even optimize following fragment:
int foo(){
char *x=malloc(64);
free(x);
}
Yes it does.
(not that more optimizations aren't possible, but it does this one)
--
Marc Glisse