From owner-freebsd-threads@FreeBSD.ORG Wed May 4 19:52:43 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2173916A4CE; Wed, 4 May 2005 19:52:43 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E5B843D3F; Wed, 4 May 2005 19:52:42 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by mailhost.stack.nl (Postfix) with ESMTP id D247A1F178; Wed, 4 May 2005 21:51:53 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id B9D866393; Wed, 4 May 2005 21:51:53 +0200 (CEST) Date: Wed, 4 May 2005 21:51:53 +0200 From: Marc Olzheim To: Daniel Eischen Message-ID: <20050504195153.GC76171@stack.nl> References: <20050504183132.GA76171@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zbGR4y+acU1DwHSi" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD hammer.stack.nl 5.4-STABLE FreeBSD 5.4-STABLE X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.9i cc: Marc Olzheim cc: freebsd-threads@freebsd.org Subject: Re: Floating point exceptions with -pthread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2005 19:52:43 -0000 --zbGR4y+acU1DwHSi Content-Type: multipart/mixed; boundary="TYecfFk8j8mZq+dy" Content-Disposition: inline --TYecfFk8j8mZq+dy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 04, 2005 at 03:15:06PM -0400, Daniel Eischen wrote: > > It seems to me like something about the floorf() assembly might have > > something to do with it. >=20 > Yeah, I was just trying to narrow down the problem a bit more. I've attached one that's built very tight around floorf(). Marc --TYecfFk8j8mZq+dy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile all: fpu6 fpu6th fpu6th: fpu6.c cc -O3 -Wall -W -Werror -Wno-unused -g -Wcast-qual -DWITH_THR -fstrict-aliasing -pthread fpu6.c -o fpu6th -lm fpu6: fpu6.c cc -O3 -Wall -W -Werror -Wno-unused -g -Wcast-qual -fstrict-aliasing fpu6.c -o fpu6 -lm clean: rm -f fpu6 fpu6th fpu6th.core core --TYecfFk8j8mZq+dy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fpu6.c" /* Blame it in Marc Olzheim (Zlo) */ #ifdef WITH_THR #include #endif /* WITH_THR */ #include #include #include #include void * calc_thread(void *arg) { float f; for (;;) { f = floorf((float)1.0 / (float)((long)arg + 1L)); if (f > (float)1.0) /* Never true, but needed to use f. */ printf("\r%f", (double)f); } /* NOTREACHED */ return NULL; } int main(int argc, char *argv[]) { #ifdef WITH_THR pthread_t thread; if (pthread_create(&thread , NULL, calc_thread, (void *)1L)) err(1, "pthread_create()"); #else /* ! WITH_THR */ (void)calc_thread((void *)1L); #endif /* ! WITH_THR */ for (;;) sleep(60); /* NOTREACHED */ return 0; } --TYecfFk8j8mZq+dy-- --zbGR4y+acU1DwHSi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCeSfZezjnobFOgrERAq6pAJwLIrgWFmhQJC+nBk+eGEpJNP1CzACguTUG fFj9Zit2QQLReKSybmgQWTQ= =vTI4 -----END PGP SIGNATURE----- --zbGR4y+acU1DwHSi--