[llvm] r179071 - c++ new operators are not malloc-like functions because they do not return uninitialized memory.

Chandler Carruth chandlerc at google.com
Thu Apr 11 21:05:50 PDT 2013


On Tue, Apr 9, 2013 at 8:48 AM, Evan Cheng <evan.cheng at apple.com> wrote:

> How do other compilers handle this? Requiring -fno-builtins doesn't seem
> user friendly.
>

I don't know of other compilers that handle this, my suspicion is that they
just don't optimize operator new effectively.

I agree that -fno-builtins isn't user friendly, but I'm not really sure how
to design a user friendly interface here because we've actually never seen
code that needed this. Can you give examples of the kinds of things you're
seeing users want to do here? (I'm happy with contrived examples, I
understand the actual code may not be sharable, but as long as the
fundamental optimization that ceases to apply is clear that should be
enough.)

I also have co-authored a paper for the C++ committee (and the C committee,
but I'm following that less) that may be relevant to folks with interest in
how we optimize allocation functions:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3537.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130411/75194a7f/attachment.html>


More information about the llvm-commits mailing list