From owner-freebsd-current@FreeBSD.ORG Tue Jul 24 22:43:43 2012 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 755A6106564A; Tue, 24 Jul 2012 22:43:43 +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 DEA998FC08; Tue, 24 Jul 2012 22:43:42 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6OMhp0u037770; Wed, 25 Jul 2012 01:43:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6OMhcKJ082718; Wed, 25 Jul 2012 01:43:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6OMhcGP082717; Wed, 25 Jul 2012 01:43:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 01:43:38 +0300 From: Konstantin Belousov To: David Chisnall Message-ID: <20120724224338.GZ2676@deviant.kiev.zoral.com.ua> References: <50097BF0.9010103@FreeBSD.org> <20120721211628.GE2676@deviant.kiev.zoral.com.ua> <6006581B-6B1C-4DFB-8662-3EB35869CA5F@FreeBSD.org> <20120722180119.GJ2676@deviant.kiev.zoral.com.ua> <20120723191856.GR2676@deviant.kiev.zoral.com.ua> <088BF877-50E6-42C5-98EF-DAB0FA52C348@freebsd.org> <05368BFA-F5F6-49D4-BE63-7C9360E54F54@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5KVt+DrA7aLR99aT" Content-Disposition: inline In-Reply-To: <05368BFA-F5F6-49D4-BE63-7C9360E54F54@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=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Dimitry Andric , freebsd-current@freebsd.org, Kim Culhan Subject: Re: -current build failure 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: Tue, 24 Jul 2012 22:43:43 -0000 --5KVt+DrA7aLR99aT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 24, 2012 at 10:08:13PM +0100, David Chisnall wrote: > On 23 Jul 2012, at 20:53, David Chisnall wrote: >=20 > > On 23 Jul 2012, at 20:18, Konstantin Belousov wrote: > >=20 > >> Longer description is that pc_curthread is offset 0 if %gs-based. > >> The dereferenced pointer point to the struct thread, which contains > >> td_proc pointer at offset 8. Instead, clang seems to dereference > >> td_proc from offset 8 based on %gs, or something similar. > >=20 > > This appears to be a bug in the LLVM X86 back end. It is performing an= invalid fold of the two loads. I have filed this bug: > >=20 > > http://llvm.org/bugs/show_bug.cgi?id=3D13438 >=20 > And fixed it in LLVM r160687. Since it's a single-line change, we can pr= obably pull it into our version. >=20 > dim: http://llvm.org/viewvc/llvm-project?view=3Drev&revision=3D160687 As kan rightfully notes, the assumption that &%fs:0 =3D=3D *%fs:0 holds for userspace on amd64, and the same is true for %gs userspace on i386. The change you committed to clang/llvm/whatever it called just breaks useful optimization for FreeBSD. Sigh. --5KVt+DrA7aLR99aT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAPJRoACgkQC3+MBN1Mb4hxxwCcCK6uhCN5jRilzaMof0VyylQp FOQAn2QaqEwCjnLidV+rYhPdgMfoOGSA =s2V6 -----END PGP SIGNATURE----- --5KVt+DrA7aLR99aT--