gnu/148926: [patch] make gcc generate i486 code by default

Tijl Coosemans tijl at coosemans.org
Tue Aug 31 13:10:09 UTC 2010


The following reply was made to PR gnu/148926; it has been noted by GNATS.

From: Tijl Coosemans <tijl at coosemans.org>
To: bug-followup at freebsd.org, tech at 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--


More information about the freebsd-bugs mailing list