<div dir="ltr"><div>On Wed, Sep 18, 2019 at 3:32 PM Eli Friedman <<a href="mailto:efriedma@quicinc.com">efriedma@quicinc.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_8202073035473732105WordSection1">We could extend the circumstances under which we allow musttail, sure.  But we could only allow arbitrary mismatched argument lists with specific calling conventions where we know it’s actually possible to lower them.  And currently, there
 is no such convention. (Well, technically there’s x86_stdcall, but that only works on 32-bit x86.  And the GHC and HiPE calling conventions are weird in other ways.)<div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">We could add a new calling convention that’s equivalent to “fastcc with GuaranteedTailCallOpt”, though, and give it special musttail rules.  Maybe call it “tailcc”.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">-Eli<u></u><u></u></p>
</div>
</div>
</div>
</div>

</blockquote></div><br clear="all"></div>What you suggest (a new tail-callable calling convention equivalent to fastcc with GuaranteedTailCallOpt) sounds like a solution that would work for us. But it also sounds like something significant enough in scope that it might be difficult for me to complete myself, when I am barely familiar with the codebase. I feel confident I could probably add a new function attribute that is equivalent to specifying GuaranteedTailCallOpt=true if it is present on both the callee and caller functions, but I doubt I have the skills necessary to create an entirely new calling convention AND modify the musttail semantics to have knowledge of it. Is this something someone would actually be willing to work on or at the very least help me figure out? Or is the former solution also considered viable?<br><div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:arial,helvetica,sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Dwight Guth</span></span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:arial,helvetica,sans-serif"><span style="font-size:10pt;color:rgb(0,153,204);background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Director of Engineering<br></span></span></p><span style="font-family:arial,helvetica,sans-serif"><br></span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:arial,helvetica,sans-serif"><span style="font-size:10pt;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Email: <a href="mailto:dwight.guth@runtimeverification.com" target="_blank">dwight.guth@runtimeverification.com</a></span></span></p><span style="font-family:arial,helvetica,sans-serif"><br></span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><a href="https://www.runtimeverification.com" target="_blank"><span style="font-family:arial,helvetica,sans-serif"><span style="font-size:10pt;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh4.googleusercontent.com/9nQ-OcCjIckvCtTEhjlLzJWYSbDpLbLDK-86J9EXPBx3eEZRIO8S6FmoBCGtjLFoXIQTbHMVk8mIWtxmNwjXDFIdYbZSESpGfNBnhn9Fd9N9nwyju_Occ9t1vNyCT19356vJWTie" style="border: medium none;" width="127" height="29"></span></span></a></p><span style="font-family:arial,helvetica,sans-serif"><br></span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:arial,helvetica,sans-serif"><a href="https://github.com/dwightguth" style="text-decoration:none" target="_blank"><span style="font-size:11pt;color:rgb(17,85,204);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/pR82FD7c9rTjFV0B1hsqPuesQ2gICSy891NRLcNY1RZlNFDP6qfifdcfytB-JvTTXAP2OJBncHAHTwYz5K1QMv-Vl0N7lV1U9l4f4L-rzrhLXwLy0vdpbJIfv0KauuXy1VlY83V6" style="border: medium none;" width="22" height="22"></span></a><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"> </span><a href="https://www.linkedin.com/company/3142238/" style="text-decoration:none" target="_blank"><span style="font-size:11pt;color:rgb(17,85,204);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/VWPk-q0ajsC_1Q8Nx-h6ZLnz8M0RP7aRyRpkPheJe1Eo70RMGutikAawN3Z60BeR3dD0CDe0JqMaW90mShKLKhzcLzCVxl0oKUykS2PCUpbd8ChLU1VvxL3bLxxCdLuaYqULkWp1" style="border: medium none;" width="22" height="22"></span></a><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">  </span><a href="https://twitter.com/rv_inc" style="text-decoration:none" target="_blank"><span style="font-size:11pt;color:rgb(17,85,204);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/9PTz7ABdFzG9bXkQTwsYXgQvzD8EuIEfEEbGZJbgD7ZVcJHrILswk5S3aD0501u-FtE_V2eCnegUaQO51exH_Khgfdll19SdSYgN2pp-v4ZkvybrFmFJ05EAoBpDgqp1pB10tOoj" style="border: medium none;" width="23" height="23"></span></a></span></p><span style="font-family:arial,helvetica,sans-serif"><br></span><br><br><br></div></div></div></div></div></div></div>