<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On Apr 11, 2013, at 9:05 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">On Tue, Apr 9, 2013 at 8:48 AM, Evan Cheng <span dir="ltr"><<a href="mailto:evan.cheng@apple.com" target="_blank" class="cremed">evan.cheng@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">How do other compilers handle this? Requiring -fno-builtins doesn't seem user friendly.<br>
</blockquote><div><br></div><div style="">I don't know of other compilers that handle this, my suspicion is that they just don't optimize operator new effectively.</div><div style=""><br></div><div style="">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.)</div></div></div></div></div></blockquote><div><br></div>We received report of a miscompilation when a developer overrode new with one that clears memory and has code that depends on the behavior. <div><br></div><div>An slightly less unfriendly solution would be -fno-builtin-new. </div><div><br></div><div>Evan</div><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div style=""><br></div><div style="">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: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3537.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3537.html</a></div>
<div><br></div></div></div></div>
</div></blockquote></div></body></html>