From ceac71f1f54220d64c87a0c2ebfd583ea49ca037 Mon Sep 17 00:00:00 2001 From: Antonin ENFRUN Date: Mon, 12 May 2014 00:24:41 +0200 Subject: [PATCH] unix: Add asm statements needed to read registers with clang. Code generated by gcc 4.9.0 is unchanged (same statements, different order). Both are inefficient, saving unmodified registers on the stack. --- unix/gccollect.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unix/gccollect.c b/unix/gccollect.c index 647a1214de..1b5a38ffc6 100644 --- a/unix/gccollect.c +++ b/unix/gccollect.c @@ -43,11 +43,17 @@ typedef machine_uint_t regs_t[6]; void gc_helper_get_regs(regs_t arr) { register long rbx asm ("rbx"); + asm("" : "=r"(rbx)); register long rbp asm ("rbp"); + asm("" : "=r"(rbp)); register long r12 asm ("r12"); + asm("" : "=r"(r12)); register long r13 asm ("r13"); + asm("" : "=r"(r13)); register long r14 asm ("r14"); + asm("" : "=r"(r14)); register long r15 asm ("r15"); + asm("" : "=r"(r15)); arr[0] = rbx; arr[1] = rbp; arr[2] = r12;