From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 31 13:10:09 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E0651065694 for ; Tue, 31 Aug 2010 13:10:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 637B68FC1A for ; Tue, 31 Aug 2010 13:10:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7VDA9Jn006040 for ; Tue, 31 Aug 2010 13:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7VDA9A2006039; Tue, 31 Aug 2010 13:10:09 GMT (envelope-from gnats) Date: Tue, 31 Aug 2010 13:10:09 GMT Message-Id: <201008311310.o7VDA9A2006039@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Tijl Coosemans Cc: Subject: Re: gnu/148926: [patch] make gcc generate i486 code by default X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tijl Coosemans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 13:10:09 -0000 The following reply was made to PR gnu/148926; it has been noted by GNATS. From: Tijl Coosemans To: bug-followup@freebsd.org, tech@askold.net Cc: Subject: Re: gnu/148926: [patch] make gcc generate i486 code by default Date: Tue, 31 Aug 2010 14:56:36 +0200 --nextPart1286161.nfbifCBD99 Content-Type: multipart/mixed; boundary="Boundary-01=_EwPfM7ddS+D0g4h" Content-Transfer-Encoding: 7bit --Boundary-01=_EwPfM7ddS+D0g4h Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Yuri, On my system, it seems gcc already compiles for i486 by default. The output of "cc -E -dM - < /dev/null" shows that __i486__ is defined and atomic builtins such as __sync_fetch_and_add are defined and produce i486 instructions. Only when you explicitly specify -march=i386 does gcc produce i386 code. However, it does look like libstdc++ can be optimised somewhat now that FreeBSD doesn't support the 80386 anymore. Can you test the attached patch and verify that it accomplishes what you want? --Boundary-01=_EwPfM7ddS+D0g4h Content-Type: text/plain; charset="us-ascii"; name="libstdc++-i386-atomic.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libstdc++-i386-atomic.diff" diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile index e0a7bb2..56ca626 100644 =2D-- a/gnu/lib/libstdc++/Makefile +++ b/gnu/lib/libstdc++/Makefile @@ -83,7 +83,7 @@ ATOMICITY_H=3D ${SRCDIR}/config/cpu/${MARCHDIR}/atomicity= =2Eh ATOMICITY_H=3D ${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h .endif =20 =2D.if ${MACHINE_ARCH} =3D=3D "amd64" +.if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D "i386" .if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h) ATOMICITY_H=3D ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h .endif diff --git a/gnu/lib/libstdc++/config.h b/gnu/lib/libstdc++/config.h index de4641d..8bc099f 100644 =2D-- a/gnu/lib/libstdc++/config.h +++ b/gnu/lib/libstdc++/config.h @@ -671,7 +671,7 @@ /* #undef VERSION */ =20 /* Define if builtin atomic operations are supported on this host. */ =2D#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) #define _GLIBCXX_ATOMIC_BUILTINS 1 #endif =20 --Boundary-01=_EwPfM7ddS+D0g4h-- --nextPart1286161.nfbifCBD99 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAkx8/AoACgkQfoCS2CCgtitKYgD/TSHqPTm852UpVR0CNS3PJHeE z2FCQ1oBvrkAhQqsNysA/13Qx9p4IjmpHCweihMAp1MX6Z3ls+b6RRTr1M+B2JdK =641w -----END PGP SIGNATURE----- --nextPart1286161.nfbifCBD99--