[LLVMdev] optimization assumes malloc return is non-null

Jonathan S. Shapiro shap at eros-os.com
Wed May 14 06:31:37 PDT 2008


One more question on this.

The substitution of malloc() is predicated on the assumption that the
compiler knows the implementation of malloc(), and the argument for that
seems to rest in part on the specification of the Standard C Library.

But I am not aware of any requirement that compliant C code must be
linked with the Standard C Library. If this requirement does not exist,
then no portion of the C library specification can be used to justify a
compile-time optimization unless we have some sort of compilation model
information that tells us the C library can be assumed.

Is there a requirement somewhere in the C *Language* Specification that
ties all of this together in the required way?


shap




More information about the llvm-dev mailing list