nptl: x86_64: Use same code for CURRENT_STACK_FRAME and stackinfo_get_sp
Cherry-picked by scw@google.com from
8cd559cf5afe3894f92c2be6f972e1a4e38c56ca
with local modifications (different file path and not use macros introduced in
01bd62517cc242ae503aaa7002e9e94551803e4d). This fixes UB and code
removal when building with clang.
It avoids the possible warning of uninitialized 'frame' variable when
building with clang:
../sysdeps/nptl/jmp-unwind.c:27:42: error: variable 'frame' is
uninitialized when used here [-Werror,-Wuninitialized]
__pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME);
The resulting code is similar to CURRENT_STACK_FRAME.
Checked on x86_64-linux-gnu.