<div dir="ltr">FYI, commented on Alexey's patch that I mildly prefer that source change to fix this. (Shoulf have said that here, but I hadn't actually looked at the patch, mea culpa.)</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 9, 2015 at 3:46 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I've just encountered the same problem - it seems to be the last failure in UBSan bootstrap of check-llvm testsuite (and mailed <a href="http://reviews.llvm.org/D6908" target="_blank">http://reviews.llvm.org/D6908</a>).</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Jan 8, 2015 at 2:06 PM, Artem Belevich <span dir="ltr"><<a href="mailto:tra@google.com" target="_blank">tra@google.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>I've attached the patch.</div><div><br></div><div>The issue is that ubsan spotted a case where we extract 21 bits from a negative signed addend value in order to encode it into binary representation of reloc.</div><div><br></div><div>While behavior is harmless in this case, technically it does fall under undefined behavior. The patch extracts relevant bits into an unsigned variable first and then uses that unsigned value to shift bits around.</div><div><br></div><div>--Artem</div><div><br></div><div class="gmail_extra"><span><div class="gmail_quote">On Thu, Jan 8, 2015 at 1:46 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI, could you attach the patch file rather than including it inline, or post it using Phabricator[1]?<div><br></div><div>[1]: <a href="http://llvm.org/docs/Phabricator.html" target="_blank">http://llvm.org/docs/Phabricator.html</a></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote"><br></div></div></div></div></blockquote></div></span><span><font color="#888888">-- <br><div><div dir="ltr">--Artem Belevich</div></div>
</font></span></div></div>
<br></div></div><span class="">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</font></span></div>
</blockquote></div><br></div>