<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Any more objections/comments/lack of consensus/etc?<div><br></div><div>Michael</div><div><br><div><div>On Aug 9, 2013, at 1:36 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Aug 9, 2013 at 1:21 PM, Michael Gottesman <<a href="mailto:mgottesman@apple.com">mgottesman@apple.com</a>> wrote:<br><blockquote type="cite">Hey Eli! Sorry for the delay.<br><br>On Jul 23, 2013, at 4:14 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br><br>What happens if the call satisfies all the platform-independent<br>requirements, but fails some platform-specific requirement?  Does it<br>just not matter because the buffers the stack protector is protecting<br>can't be referenced?<br><br><br>The key thing about the patch is that something magical is happening. No<br>matter where the stack protector intrinsic is in the actual basic block, the<br>stack protector code will be inserted right before the terminator whether or<br>not it is a return or a tail return. If the call fails the platform specific<br>requirements, then there will be a call and then the terminator. The stack<br>protector code will be inserted right before the terminator and thus right<br>before the call.<br><br><br>Also, I don't understand why we need to introduce an intrinsic: if<br>steps 1 and 2 are both in the same pass, can't you just insert the<br>compare+branch before the tail call?<br><br><br>I can’t actually insert the compare + branch before the tail call at the IR<br>level since the branch will be a terminator implying that I would need to<br>split the basic block at the IR level. Splitting the basic block at the IR<br>level is exactly what we do not want to do since then we would be required<br>to move a failed tail call at the MI level from the success basic block to<br>the parent basic block before the actual stack protector compare happens.<br>This would require doing platform dependent pattern matching, something that<br>I am trying to avoid.<br><br>What the intrinsic is really being used for is delaying the code-gen of the<br>stack protector check until we know the exact position where we wish to<br>insert it (which due to the way we represent tail calls at the MI level is<br>always right before the terminator of the basic block no matter whether we<br>have a tail call, failed tail call, or normal call). Thus we can stay<br>platform independent and clean.<br></blockquote><br>That makes sense; thanks.<br><br>-Eli</div></blockquote></div><br></div></body></html>