Received: from eggs.gnu.org ([2001:4830:134:3::10]:37208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMIFA-0000nY-GI for qemu-devel@nongnu.org; Sun, 10 Jul 2016 13:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMIF6-0003OH-Rn for qemu-devel@nongnu.org; Sun, 10 Jul 2016 13:10:11 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:33568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMIF6-0003Nu-Kq for qemu-devel@nongnu.org; Sun, 10 Jul 2016 13:10:08 -0400 Received: by mail-pa0-x242.google.com with SMTP id q2so621427pap.0 for ; Sun, 10 Jul 2016 10:10:08 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sun, 10 Jul 2016 10:10:04 -0700 Message-Id: <1468170605-13725-2-git-send-email-rth@twiddle.net> In-Reply-To: <1468170605-13725-1-git-send-email-rth@twiddle.net> References: <1468170605-13725-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL 1/2] linux-user: Fix i386 safe-syscall.S List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Clang insists that "cmp" is ambiguous with a memory destination, requiring an explicit size suffix. There was a true error in the use of .cfi_def_cfa_offset in the epilogue, but changing to use the proper .cfi_adjust_cfa_offset runs afoul of a clang bug wrt .cfi_restore_state. Better to fold the two epilogues so that we don't trigger the bug. Signed-off-by: Richard Henderson --- linux-user/host/i386/safe-syscall.inc.S | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386/safe-syscall.inc.S index 766d0de..9e58fc6 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/linux-user/host/i386/safe-syscall.inc.S @@ -69,7 +69,7 @@ safe_syscall_base: safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ mov 4+16(%esp), %eax /* signal_pending */ - cmp $0, (%eax) + cmpl $0, (%eax) jnz 1f mov 8+16(%esp), %eax /* syscall number */ int $0x80 @@ -77,16 +77,16 @@ safe_syscall_end: /* code path for having successfully executed the syscall */ pop %ebx .cfi_remember_state - .cfi_def_cfa_offset -4 + .cfi_adjust_cfa_offset -4 .cfi_restore ebx pop %edi - .cfi_def_cfa_offset -4 + .cfi_adjust_cfa_offset -4 .cfi_restore edi pop %esi - .cfi_def_cfa_offset -4 + .cfi_adjust_cfa_offset -4 .cfi_restore esi pop %ebp - .cfi_def_cfa_offset -4 + .cfi_adjust_cfa_offset -4 .cfi_restore ebp ret @@ -94,19 +94,7 @@ safe_syscall_end: /* code path when we didn't execute the syscall */ .cfi_restore_state mov $-TARGET_ERESTARTSYS, %eax - pop %ebx - .cfi_def_cfa_offset -4 - .cfi_restore ebx - pop %edi - .cfi_def_cfa_offset -4 - .cfi_restore edi - pop %esi - .cfi_def_cfa_offset -4 - .cfi_restore esi - pop %ebp - .cfi_def_cfa_offset -4 - .cfi_restore ebp - ret + jmp safe_syscall_end .cfi_endproc .size safe_syscall_base, .-safe_syscall_base -- 2.7.4