From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32316 invoked by alias); 11 Apr 2002 21:35:16 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32290 invoked by uid 61); 11 Apr 2002 21:35:15 -0000 Date: Thu, 11 Apr 2002 14:35:00 -0000 Message-ID: <20020411213515.32289.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, karl@tarantella.com, nobody@gcc.gnu.org From: rth@gcc.gnu.org Reply-To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, karl@tarantella.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/6258: floor() may return incorrect value when optimized X-SW-Source: 2002-04/txt/msg00632.txt.bz2 List-Id: Synopsis: floor() may return incorrect value when optimized State-Changed-From-To: open->closed State-Changed-By: rth State-Changed-When: Thu Apr 11 14:35:14 2002 State-Changed-Why: Not a bug. -ffast-math allows the compiler to replace a/90 with a*(1/90). Except that 1/90 can't be represented exactly, so the result of the multiplication is -3.0000000000000001144917494144692682, not -3. Since the value is indeed less than -3, floor rightly returns -4. If you don't want this to happen, don't use -ffast-math. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6258