Optimizing of explicit temporary storage
Daniel Berlin
dberlin@dberlin.org
Wed Oct 13 03:42:00 GMT 2004
>>>
>> Yes, but that's rather a different situation due to the nature of Scheme.
>>
>> In C, even given just:
>>
>> (void) malloc(16);
>>
>> it would be surprising to most programmers to optimize away the call
>> because malloc *does* have side-effects on real systems. For example,
>> on UNIX, it is likely to call sbrk, which result in observable changes
>> in the process state.
>
> Well, yes, but
>
> int x[65536];
>
> also results in observable changes in the process state, and we don't
> hesitate to optimise it away.
I believe LLVM actually does all kinds of promotion that ends up removing
malloc calls. Maybe i'm just misremembering.
Chris, am i on crack?
--Dan
More information about the Gcc
mailing list