From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxpH-00018a-Tu for qemu-devel@nongnu.org; Mon, 11 Nov 2013 15:11:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfxpA-0007il-Kq for qemu-devel@nongnu.org; Mon, 11 Nov 2013 15:11:11 -0500 Received: from mail.fgznet.ch ([81.92.96.47]:57214 helo=smtp.fgznet.ch) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfxpA-0007i9-BO for qemu-devel@nongnu.org; Mon, 11 Nov 2013 15:11:04 -0500 Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rABKApNx078954 for ; Mon, 11 Nov 2013 21:11:01 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <528139CB.7080502@FreeBSD.org> Date: Mon, 11 Nov 2013 21:10:51 +0100 From: Andreas Tobler MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000900090904070500060609" Subject: [Qemu-devel] [PATCH] fix compilation/link with clang, target-i386/cpu.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000900090904070500060609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, Paolo asked me to test and submit the below patch to fix compilation and link with clang. Paolo reduced the issue to a clang bug where dead code is not properly eliminated before linktime. (the clang bug ID: 17882) Thanks, Andreas Signed-off-by: Andreas Tobler --------------000900090904070500060609 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="target-i386.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="target-i386.diff" diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 864c80e..6d3e5fd 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2196,7 +2196,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *ebx = 0; *ecx = 0; *edx = 0; - if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE) || !kvm_enabled()) { + if (!kvm_enabled() || !(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) { break; } kvm_mask = --------------000900090904070500060609--