<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;">On Nov 6, 2013, at 5:46 PM, Behan Webster <<a href="mailto:behanw@converseincode.com">behanw@converseincode.com</a>> wrote:<br><div><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;">Another way would be to introduce a new builtin in parallel to others<br>like __builtin_return_address(). Essentially adding a<br>__builtin_stack_pointer() which does what the above code does. The idea<br>would be to get something like this added to both clang and gcc in order<br>to make this work across compilers, and across arches.<br><br>It ends up being a trivial patch for clang (see below). We're still<br>looking for someone to help us on the gcc side.<br></div></blockquote><div dir="auto"><br></div><div dir="auto">From my perspective, adding __builtin_stack_pointer() makes perfect sense. Mapping it to Intrinsic::stacksave does not though, it should map down to a new llvm.stackpointer() intrinsic, and the code generator should turn it into the stack pointer register at isel time.</div><div dir="auto"><br></div><div dir="auto">-Chris</div></div></body></html>