From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 21 04:20:16 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E493437B401 for ; Mon, 21 Apr 2003 04:20:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 062B843FAF for ; Mon, 21 Apr 2003 04:20:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h3LBKFUp094804 for ; Mon, 21 Apr 2003 04:20:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h3LBKFxv094803; Mon, 21 Apr 2003 04:20:15 -0700 (PDT) Resent-Date: Mon, 21 Apr 2003 04:20:15 -0700 (PDT) Resent-Message-Id: <200304211120.h3LBKFxv094803@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, ura@euro-bill.net Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0E0437B401 for ; Mon, 21 Apr 2003 04:10:21 -0700 (PDT) Received: from server148.winterfire.com (server148.winterfire.com [207.44.200.19]) by mx1.FreeBSD.org (Postfix) with SMTP id 10F9743FAF for ; Mon, 21 Apr 2003 04:10:21 -0700 (PDT) (envelope-from ura@euro-bill.net) Received: (qmail 14099 invoked from network); 21 Apr 2003 11:25:50 -0000 Received: from unused.nbi.com.ua (HELO sphinx.zzz) (80.78.41.228) by server148.winterfire.com with SMTP; 21 Apr 2003 11:25:50 -0000 Received: (qmail 92311 invoked by uid 1001); 21 Apr 2003 11:10:16 -0000 Message-Id: <20030421111016.92310.qmail@sphinx.zzz> Date: 21 Apr 2003 11:10:16 -0000 From: ura@euro-bill.net To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: i386/51210: gcc compiler bug with floating point X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 11:20:17 -0000 >Number: 51210 >Category: i386 >Synopsis: gcc compiler bug with floating point >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 21 04:20:15 PDT 2003 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 5.0-RELEASE-p7 i386 >Organization: >Environment: /etc/make.conf CPUTYPE=p4 CFLAGS=-O2 -pipe COPTFLAGS=-O2 -pipe ttyp4 ~> gcc -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.2.1 [FreeBSD] 20021119 (release) >Description: When libm(msun) built with -march=pentium4, pow(3) returns incorrect results. >How-To-Repeat: You must have pentium4 processor. Compile whole system with specified /etc/make.conf (actually you can compile only libm with this flags). And try to compile this piece of code: ----[Cut]----- #include #include int main () { double res = pow(0.001953125F, 2.2000000476837158F); printf("%f", res); } ----[Cut]----- You will get 512.0000 (shoud be 0.000001) >Fix: I've found a workaround. Seems that gcc do not have such bug with -march=pentium3. So if you replace CPUTYPE=p4 to CPUTYPE=p3 problem will be solved. >Release-Note: >Audit-Trail: >Unformatted: