Optimizing of explicit temporary storage
Robert Dewar
dewar@gnat.com
Tue Oct 12 11:59:00 GMT 2004
Mark Mitchell wrote:
> 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.
Yes, but the condition of not surprising programmers is different from
the condition of conforming to the standard. Strictly from a standards
conformance point of view, these kinds of optimization seem perfectly
valid, but of course the criterion of not surprising programmers is
indeed a reasonable one!
More information about the Gcc
mailing list