On Wed, Jan 9, 2013 at 5:33 PM, Ondřej Bílka wrote:
> On Wed, Jan 09, 2013 at 05:12:06PM +0100, Marc Glisse wrote:
>> 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 i
On Wed, Jan 09, 2013 at 05:12:06PM +0100, Marc Glisse wrote:
> 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
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
Hello,
gcc currently does not even optimize following fragment:
int foo(){
char *x=malloc(64);
free(x);
}
It should be possible to change malloc with small size and there is free
that dominates that malloc into alloca.
Also when size it is not known it could be (perhaps with profiling)
tur
On 18/11/2011 14:38, Alexandru Juncu wrote:
On Fri, Nov 18, 2011 at 1:24 PM, David Brown wrote:
On 18/11/2011 10:27, Alexandru Juncu wrote:
Hello!
I have a curiosity with something I once tested. I took a simple C
program and made an assembly file with gcc -S.
The C file looks something lik
On Fri, 18 Nov 2011 15:38:25 +0200 Alexandru Juncu wrote:
> Thank you for still answering. I apologize, but I looked at the lists
> and this one seemed the most generic. Can you redirect me to another
> list where this thread would be appropriate?
>
See 'gcc-help': http://gcc.gnu.org/lists.html
On Fri, Nov 18, 2011 at 1:24 PM, David Brown wrote:
> On 18/11/2011 10:27, Alexandru Juncu wrote:
>>
>> Hello!
>>
>> I have a curiosity with something I once tested. I took a simple C
>> program and made an assembly file with gcc -S.
>>
>> The C file looks something like this:
>> int main(void)
>>
On 18/11/2011 10:27, Alexandru Juncu wrote:
Hello!
I have a curiosity with something I once tested. I took a simple C
program and made an assembly file with gcc -S.
The C file looks something like this:
int main(void)
{
int a=1, b=2;
return 0;
}
The assembly instructions look like this
Hello!
I have a curiosity with something I once tested. I took a simple C
program and made an assembly file with gcc -S.
The C file looks something like this:
int main(void)
{
int a=1, b=2;
return 0;
}
The assembly instructions look like this:
subl$16, %esp
movl$1, -4(%ebp)
movl