Date: Sun, 13 Mar 2016 14:48:52 -0700 From: Steve Kargl <sgk@troutmask.apl.washington.edu> To: Ed Maste <emaste@freebsd.org> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: clang is mostlikely miscompling libm Message-ID: <20160313214852.GA27156@troutmask.apl.washington.edu> In-Reply-To: <CAPyFy2AMtd23TZLHzxFG_dKQ3R9H%2BQbUR2EZq0XBXt%2By9m0daA@mail.gmail.com> References: <20160313191637.GA25928@troutmask.apl.washington.edu> <CAPyFy2AMtd23TZLHzxFG_dKQ3R9H%2BQbUR2EZq0XBXt%2By9m0daA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 13, 2016 at 09:08:56PM +0000, Ed Maste wrote:
> On 13 March 2016 at 19:16, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> > JFYI,
> >
> > It appears that clang on up-to-date current may be
> > miscompiling libm on at i686 class hardware.
>
> Do you have an example of the suspected miscompilation?
See freebsd-toolchain@
#include <fenv.h>
#include <stdio.h>
int
main(void)
{
int i;
// float x = 1.f;
double x = 1.;
i = 0;
feclearexcept(FE_ALL_EXCEPT);
do {
x *= 2;
i++;
} while(!fetestexcept(FE_OVERFLOW));
if (fetestexcept(FE_OVERFLOW)) printf("FE_UNDERFLOW: ");
printf("x = %e after %d iterations\n", x, i);
return 0;
}
--
Steve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160313214852.GA27156>
