This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] dead const/pure/alloca call removal
Jason Merrill <firstname.lastname@example.org> writes:
| On 10 Nov 2003 09:48:13 +0100, Gabriel Dos Reis <email@example.com> wrote:
| > As is, GCC does not provide an implementation for malloc, and a user
| > program that calls malloc has to take special actions (e.g. third
| > party library) to have it translated into a successful executable.
| It seems that many of us disagree, and nobody has agreed with you.
I see Geoff's suggestion less than a disagreement than a better
alternative of the "disagreement camp".
| Do you have a citation?
What exactly do we want for GCC? Just a compiler that compiles
supposed strictly conforming programs, or a compiler that supports
useful programs. My inclination is for the later, and since the
standard does not mandate useful compilers...
| The C standard specifies the behavior of library functions. If the
| compiler knows how to provide this behavior without actually calling into
| the system C library, it is allowed to. Both are parts of the
The point here is difference in behaviour: Does the compiler knows
how to provide that behaviour? The answer is "we don't know" if that
transformation for malloc were applied. The answer is "we don't know"
because the behaviour will be different depending on whether the
compiler hands off to third library or applies its own notion of malloc.
The net effect would be confusion in user programs because the same
call to function to not behave consistently.
Since very few (if any) useful programs are strictly conforming, I
believe this is an area of we should value usability and praticality
over abstract strict conformance.