From owner-freebsd-current Fri Dec 20 18:24:41 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 359F437B406 for ; Fri, 20 Dec 2002 18:24:39 -0800 (PST) Received: from creme-brulee.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9425343EDC for ; Fri, 20 Dec 2002 18:24:38 -0800 (PST) (envelope-from marcus@marcuscom.com) Received: from [192.168.1.4] (shumai.marcuscom.com [192.168.1.4]) by creme-brulee.marcuscom.com (8.12.6/8.12.6) with ESMTP id gBL2NZ3a071367 for ; Fri, 20 Dec 2002 21:23:35 -0500 (EST) (envelope-from marcus@marcuscom.com) Subject: WEIRD! div() broken on -CURRENT? From: Joe Marcus Clarke To: current@freebsd.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-3yZhQdDsV/2so3ycgHnv" Organization: MarcusCom, Inc. Message-Id: <1040437478.29101.23.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 20 Dec 2002 21:24:39 -0500 X-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,HOT_NASTY,NOSPAM_INC,PGP_SIGNATURE_2,PLING_QUERY, SPAM_PHRASE_00_01 version=2.43 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-3yZhQdDsV/2so3ycgHnv Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Okay, I must be losing my mind. Does anyone know why the following program compiled with stock gcc-3.2.1, stock CFLAGS, and no CPUTYPE produces: ddy.quot =3D 1 ddy.rem =3D -1077937744 on -CURRENT, and: ddy.quot =3D 8 ddy.rem =3D 0 On -stable? #include #include main(void) { div_t ddy; int dy, dy_frac; ddy =3D div (768, 96); dy =3D ddy.quot; dy_frac =3D ddy.rem; printf("ddy.quot =3D %d\n", dy); printf("ddy.rem =3D %d\n", dy_frac); return 0; } > cc -O -pipe -o xxx xxx.c I'm doing something wrong, right? I mean, this can't be right. I've verified this now on a P4 running: FreeBSD jclarke-pc.cisco.com 5.0-RC FreeBSD 5.0-RC #0: Mon Dec 16 02:54:55 EST 2002 =20 marcus@jclarke-pc.cisco.com:/usr/obj/usr/src/sys/JCLARKE-PC i386 And a PIII running: FreeBSD sysinfo.mezzweb.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon Dec 16 09:44:28 CST 2002 =20 root@sysinfo.mezzweb.com:/usr/src/sys/i386/compile/BSDROCKS i386 Both machines produce the same result, while my -stable machines produce the correct result. Both machines have fresh -CURRENT headers. Oh, and if I move the xxx binary from my -stable machine to my -CURRENT machine, it produces the correct result. Both machines have WITNESS and INVARIANTS disabled. The PIII has MATH_EMULATE compiled in, but the P4 does not. Any help would be most appreciated as I think this is causing Nautilus crashes on -CURRENT. Thanks. Joe --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-3yZhQdDsV/2so3ycgHnv Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+A9Dmb2iPiv4Uz4cRAnhbAKCMNuyAM9FhZGQsyMaZjNMiDEn2PgCfSlZn wAjQe/YSguti6SEFcFMfiNE= =O6Ak -----END PGP SIGNATURE----- --=-3yZhQdDsV/2so3ycgHnv-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message