<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 6, 2017, at 2:45 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Mar 6, 2017 at 2:36 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_msg" style="word-wrap: break-word;"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 6, 2017, at 2:21 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="gmail_msg m_-4545557477288325502Apple-interchange-newline"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Mar 6, 2017 at 1:17 PM Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Author: adrian<br class="gmail_msg">Date: Mon Mar  6 15:05:14 2017<br class="gmail_msg">New Revision: 297072<br class="gmail_msg"><br class="gmail_msg">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=297072&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=297072&view=rev</a><br class="gmail_msg">Log:<br class="gmail_msg">Verifier: Change Assert to AssertDI.<br class="gmail_msg">This error can be recovered from by stripping debug info.<br class="gmail_msg">This is NFC for +asserts builds.<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Is there no way in a +Asserts build to get the behavior of "if debug info doesn't verify, strip it"? That seems... bad (untestable codepath that someone's relying on?).</div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg" style="word-wrap: break-word;"><div class="gmail_msg"><div class="gmail_msg">The behavior is still there, but the assertion fires first :-)</div></div></div></blockquote><div class=""><br class=""></div><div class="">Schrodinger's behavior - it's untested, it might work, might not - who knows?</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_msg" style="word-wrap: break-word;"><div class="gmail_msg"><div class="gmail_msg">We treat debug info verification errors as recoverable by stripping the debug info. But when assertions are enabled, we assert that even the debug info is correct. This allows us to find, e.g., bitcode upgrade bugs with asserts-enabled compilers during compiler qualification.</div><div class="gmail_msg"><br class="gmail_msg"></div>It is true that we cannot test the stripping behavior with assertions enabled. I had a vague memory that there was a command line option to force the noasserts behavior for some tools, but I must have misremembered or didn't find it.</div></div></blockquote></div></div></div></blockquote><div><br class=""></div>Ha! I found it:</div><div><br class=""></div><div><div>cl::opt<bool> LTOStripInvalidDebugInfo(</div><div>    "lto-strip-invalid-debug-info",</div><div>    cl::desc("Strip invalid debug info metadata during LTO instead of aborting."),</div><div>#ifdef NDEBUG</div><div>    cl::init(true),</div><div>#else</div><div>    cl::init(false),</div><div>#endif</div><div>    cl::Hidden);</div><div class=""><br class=""></div><div class="">with that I should be able to create a testcase for this change, too.</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><div class=""><br class="">Please fix this or remove the fallback behavior. I'd personally prefer none of this goes behind an asserts modifier, but have a flag that makes it a "hard stop" or "silently drop" (is the hard stop behavior at all? Would a warning suffice? (a warning that could be promoted to error or demoted to silence would be ideal - but I realize LLVM's tools, etc, don't have that level of warning control, so depending on where/how this is all implemented that may not be practical))<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>That's pretty much the problem. This typically occurs during LTO where we don't have an amazing level of control, because it is in libLTO and driven by the linker.</div><div><br class=""></div><div>-- adrian</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><div class=""><br class="">- Dave<br class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_msg" style="word-wrap: break-word;"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-- adrian</div></div><div class="gmail_msg" style="word-wrap: break-word;"><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class="gmail_msg">Modified:<br class="gmail_msg">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/IR/Verifier.cpp<br class="gmail_msg"><br class="gmail_msg">Modified: llvm/trunk/lib/IR/Verifier.cpp<br class="gmail_msg">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=297072&r1=297071&r2=297072&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=297072&r1=297071&r2=297072&view=diff</a><br class="gmail_msg">==============================================================================<br class="gmail_msg">--- llvm/trunk/lib/IR/Verifier.cpp (original)<br class="gmail_msg">+++ llvm/trunk/lib/IR/Verifier.cpp Mon Mar  6 15:05:14 2017<br class="gmail_msg">@@ -2734,9 +2734,9 @@ void Verifier::verifyCallSite(CallSite C<br class="gmail_msg">   // do so causes assertion failures when the inliner sets up inline scope info.<br class="gmail_msg">   if (I->getFunction()->getSubprogram() && CS.getCalledFunction() &&<br class="gmail_msg">       CS.getCalledFunction()->getSubprogram())<br class="gmail_msg">-    Assert(I->getDebugLoc(), "inlinable function call in a function with debug "<br class="gmail_msg">-                             "info must have a !dbg location",<br class="gmail_msg">-           I);<br class="gmail_msg">+    AssertDI(I->getDebugLoc(), "inlinable function call in a function with "<br class="gmail_msg">+                               "debug info must have a !dbg location",<br class="gmail_msg">+             I);<br class="gmail_msg"><br class="gmail_msg">   visitInstruction(*I);<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg">_______________________________________________<br class="gmail_msg">llvm-commits mailing list<br class="gmail_msg"><a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div><br class=""></body></html>