aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/x86_64/nptl/pthreaddef.h4
-rw-r--r--sysdeps/x86_64/stackinfo.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/x86_64/nptl/pthreaddef.h b/sysdeps/x86_64/nptl/pthreaddef.h
index 036deb5772..7cf6677114 100644
--- a/sysdeps/x86_64/nptl/pthreaddef.h
+++ b/sysdeps/x86_64/nptl/pthreaddef.h
@@ -41,4 +41,6 @@
/* Location of current stack frame. The frame pointer is not usable. */
#define CURRENT_STACK_FRAME \
- ({ register char *frame __asm__("rsp"); frame; })
+ ({ register void * p__ __asm__("rsp"); \
+ asm volatile("" : "=r" (p__)); \
+ p__; })
diff --git a/sysdeps/x86_64/stackinfo.h b/sysdeps/x86_64/stackinfo.h
index f7a5672f27..1301c5e197 100644
--- a/sysdeps/x86_64/stackinfo.h
+++ b/sysdeps/x86_64/stackinfo.h
@@ -34,7 +34,9 @@
for which they need to act as barriers as well, hence the additional
(unnecessary) parameters. */
#define stackinfo_get_sp() \
- ({ void *p__; asm volatile ("mov %%" RSP_LP ", %0" : "=r" (p__)); p__; })
+ ({ register void * p__ __asm__(RSP_LP); \
+ asm volatile("" : "=r" (p__)); \
+ p__; })
#define stackinfo_sub_sp(ptr) \
({ ptrdiff_t d__; \
asm volatile ("sub %%" RSP_LP " , %0" : "=r" (d__) : "0" (ptr)); \