From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYARL-0001io-Rd for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:43:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYARK-0007h4-UH for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:43:35 -0500 Received: from mail-vk0-x236.google.com ([2607:f8b0:400c:c05::236]:32861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYARK-0007gw-M6 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:43:34 -0500 Received: by mail-vk0-x236.google.com with SMTP id k196so158473925vka.0 for ; Tue, 23 Feb 2016 02:43:34 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <56CC2ADA.8060407@redhat.com> References: <56CC2ADA.8060407@redhat.com> From: Peter Maydell Date: Tue, 23 Feb 2016 10:43:14 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 0/5] migration pull List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Liang Li Cc: Amit Shah , Juan Quintela , qemu list , "Dr. David Alan Gilbert" On 23 February 2016 at 09:48, Paolo Bonzini wrote: > On 23/02/2016 10:09, Peter Maydell wrote: >> Hi. I'm afraid this doesn't compile for x86-64 Linux: > > What compiler is this, and does the following compile with no particular > extra options? > > #pragma GCC target("avx2") > #include > __m256i foo; This is stock gcc from Ubuntu trusty: $ gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4 That code fragment you suggest compiles fine normally, but not if I add -save-temps: $ cat /tmp/zz9.c #pragma GCC target("avx2") #include __m256i foo; $ gcc -g -Wall -o /tmp/zz9.o -c /tmp/zz9.c $ echo $? 0 $ gcc -g -Wall -o /tmp/zz9.o -c /tmp/zz9.c -save-temps /tmp/zz9.c:4:1: error: unknown type name =E2=80=98__m256i=E2=80=99 __m256i foo; ^ /tmp/zz9.c: In function =E2=80=98bar=E2=80=99: /tmp/zz9.c:7:19: error: =E2=80=98__m256i=E2=80=99 undeclared (first use in = this function) return sizeof(__m256i); ^ /tmp/zz9.c:7:19: note: each undeclared identifier is reported only once for each function it appears in /tmp/zz9.c:8:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ This seems to be because -save-temps causes the #pragma not to actually #define __AVX__. This feels all pretty fragile to me and I think we should probably avoid messing with the target pragma if we can. thanks -- PMM