From owner-freebsd-current@FreeBSD.ORG Sun Oct 23 08:43:36 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FEED106564A; Sun, 23 Oct 2011 08:43:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D4E608FC0C; Sun, 23 Oct 2011 08:43:35 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p9N8hV2M047210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Oct 2011 11:43:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p9N8hU9N083482; Sun, 23 Oct 2011 11:43:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p9N8hUJo083481; Sun, 23 Oct 2011 11:43:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 23 Oct 2011 11:43:30 +0300 From: Kostik Belousov To: Roman Divacky Message-ID: <20111023084330.GA50300@deviant.kiev.zoral.com.ua> References: <20111022205129.32569ec5@davenulle.org> <20111023082412.GA74520@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8Y8a5CJOPM/zJV44" Content-Disposition: inline In-Reply-To: <20111023082412.GA74520@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: FreeBSD Current , Patrick Lamaiziere Subject: Re: 9.0 RC1/Clang / illegal instruction (Signal 4) in gengtype while building cc_tools on i586. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2011 08:43:36 -0000 --8Y8a5CJOPM/zJV44 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 23, 2011 at 10:24:12AM +0200, Roman Divacky wrote: > > Program received signal SIGILL, Illegal instruction. > > 0x08048b24 in do_typedef (s=3D0x80532bf "CUMULATIVE_ARGS", pos=3D0x805e= 1a4) > > at /usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcc/gengtyp= e.c:103 > > 103 { > >=20 > > (gdb) disas 0x08048b24 > > Dump of assembler code for function do_typedef: > > 0x08048b10 : push %ebp > > 0x08048b11 : mov %esp,%ebp > > 0x08048b13 : push %ebx > > 0x08048b14 : push %edi > > 0x08048b15 : push %esi > > 0x08048b16 : sub $0xc,%esp > > 0x08048b19 : mov $0x805e1d4,%edi > > 0x08048b1e : mov 0x10(%ebp),%esi > > 0x08048b21 : mov 0x8(%ebp),%ebx > > 0x08048b24 : nopw %cs:0x0(%eax,%eax,1) >=20 > LLVM attempts to use an optimal nop sequence when writing N-byte nop, > by using these nop instructions >=20 > static const uint8_t Nops[10][10] =3D { > // nop > {0x90}, > // xchg %ax,%ax > {0x66, 0x90}, > // nopl (%[re]ax) > {0x0f, 0x1f, 0x00}, > // nopl 0(%[re]ax) > {0x0f, 0x1f, 0x40, 0x00}, > // nopl 0(%[re]ax,%[re]ax,1) > {0x0f, 0x1f, 0x44, 0x00, 0x00}, > // nopw 0(%[re]ax,%[re]ax,1) > {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}, > // nopl 0L(%[re]ax) > {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}, > // nopl 0L(%[re]ax,%[re]ax,1) > {0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, > // nopw 0L(%[re]ax,%[re]ax,1) > {0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, > // nopw %cs:0L(%[re]ax,%[re]ax,1) > {0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, > }; >=20 > There's no checking for a supported CPU, is it so that AMD geode doesnt s= upport any of these? > Any other cpu that doesnt support these? If this is CPU dependant, I sugg= est to open a bug > report upstream as it's a bug. Long nops are supported only on specific CPUs. Unconditional use of them is a plain bug, like unconditional use of cmovXX. --8Y8a5CJOPM/zJV44 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6j07EACgkQC3+MBN1Mb4jKGgCePnVGFf8bcwIJj4CGnN/gzw7V tv0AoL19C0JxUJyoR/BXubZJQoBO8YUQ =6+hY -----END PGP SIGNATURE----- --8Y8a5CJOPM/zJV44--