This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizing of explicit temporary storage
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!