On Mon, Jul 29, 2013 at 2:00 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Jul 29, 2013 at 1:14 PM, Richard Smith<br>
<<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>> wrote:<br>
> Author: rsmith<br>
> Date: Mon Jul 29 15:14:16 2013<br>
> New Revision: 187374<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=187374&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=187374&view=rev</a><br>
> Log:<br>
> PR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if<br>
> corresponding 'operator new' was actually emitted as a function marked 'nobuiltin'.<br>
<br>
</div>There's a similar bug involving LTO; consider the following:<br>
<br>
a.cpp:<br>
using size_t = decltype(sizeof(0));<br>
<div class="im">void *operator new(size_t) __attribute__((alias("something")));<br>
<br>
</div>b.cpp:<br>
int *pr16715 = new int;<br>
<br>
If I link these two together with llvm-link, I get exactly the same error.<br>
<br>
Overall, this seems like a very fragile constraint; maybe we can relax<br>
it somehow?</blockquote><div><br></div><div>It would seem reasonable to me for the verifier to allow the 'builtin' attribute on calls to functions declared without 'nobuiltin'. Patch attached.</div></div>