<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Quentin Colombet via llvm-commits" <llvm-commits@lists.llvm.org><br><b>To: </b>"Krzysztof Parzyszek" <kparzysz@codeaurora.org><br><b>Cc: </b>"Benjamin Kramer" <benny.kra@gmail.com>, "Chandler Carruth via llvm-commits" <llvm-commits@lists.llvm.org><br><b>Sent: </b>Friday, May 20, 2016 1:21:42 PM<br><b>Subject: </b>Re: [llvm] r269969 - When looking for a spill slot in reg scavenger,  find one that matches RC<br><br>
<br class=""><div><blockquote class=""><div class="">On May 20, 2016, at 9:11 AM, Krzysztof Parzyszek via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">Getting to this particular place in register scavenger is an indication of a problem.  That should not happen under any conditions, so it qualifies for llvm_unreachable.  There is nothing that the user can do to remedy this situation once it happens.  That ties to your comment about when to use unreachable vs report_fatal_error.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">I was under impression that llvm_unreachable expands to nothing in release mode---turns out it is not true.  I'd rather remove the report_fatal_error and keep the unreachable in this case.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""></div></blockquote><div><br class=""></div><div>My bad, llvm_unreachable does generate a call to abort. I could have swear I saw unreachable just being dropped.</div><div id="DWT4402"><br class=""></div></div></blockquote><br>It depends on what kind of build you have:<br><br>#ifndef NDEBUG<br>#define llvm_unreachable(msg) \<br>  ::llvm::llvm_unreachable_internal(msg, __FILE__, __LINE__)<br>#elif defined(LLVM_BUILTIN_UNREACHABLE)<br>#define llvm_unreachable(msg) LLVM_BUILTIN_UNREACHABLE<br>#else<br>#define llvm_unreachable(msg) ::llvm::llvm_unreachable_internal()<br>#endif<br><br>where:<br><br> /// This function calls abort(), and prints the optional message to stderr.<br>  /// Use the llvm_unreachable macro (that adds location info), instead of<br>  /// calling this function directly.<br>  LLVM_ATTRIBUTE_NORETURN void<br>  llvm_unreachable_internal(const char *msg=nullptr, const char *file=nullptr,<br>                            unsigned line=0);<br><br><br> -Hal<br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div></div><br class=""><blockquote class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">-Krzysztof</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">On 5/20/2016 11:01 AM, Benjamin Kramer wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">report_fatal_error produces user-visible errors, I don't think<br class="">including stack traces there is in any way helpful and will only cause<br class="">confusion. If a compiler dev doesn't like using a debugger they can<br class="">still grep for the error message and quickly find where it's coming<br class="">from ...<br class=""><br class="">On Fri, May 20, 2016 at 5:51 PM, Krzysztof Parzyszek<br class=""><<a href="mailto:kparzysz@codeaurora.org" class="" target="_blank">kparzysz@codeaurora.org</a>> wrote:<br class=""><blockquote class="">On 5/20/2016 10:43 AM, Benjamin Kramer wrote:<br class=""><blockquote class=""><br class="">You can<br class="">easily get a stack trace from a debugger, no need to use<br class="">llvm_unreachable for that.<br class=""></blockquote><br class=""><br class="">That forces people to use debuggers, which I really don't like.<br class=""><br class="">Maybe printing the stack trace from report_fatal_error (when assertions are<br class="">enabled) would be an option?<br class=""><br class="">-Krzysztof<br class=""><br class=""><br class=""><br class="">--<br class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by<br class="">The Linux Foundation<br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">llvm-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="mailto:llvm-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" target="_blank">llvm-commits@lists.llvm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></blockquote></div><br class=""><br>_______________________________________________<br>llvm-commits mailing list<br>llvm-commits@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>