[PATCH] D22254: [ARM, AArch64] Adds builtins to get current SP and PC
Tim Northover via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 12 08:00:18 PDT 2016
t.p.northover added a comment.
I agree with Renato too.
It seems like, as a compiler, we can provide virtually no guarantees about the value of `__builtin_arm_current_pc`: it's not necessarily in the PC-range of the dynamically innermost frame (inlining); it's not necessarily even in the callstack at all (you actually get PC+8 or PC+4).
About the only feasible use-case is a some kind of panic/abort implementation best-effort. And at that point you'll want r0-r14 as well.
Tim.
http://reviews.llvm.org/D22254
More information about the cfe-commits
mailing list