From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8066 invoked by alias); 5 Dec 2002 08:32:55 -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 8046 invoked by uid 61); 5 Dec 2002 08:32:54 -0000 Date: Thu, 05 Dec 2002 00:32:00 -0000 Message-ID: <20021205083254.8045.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, petdr@cs.mu.OZ.AU From: zlomek@gcc.gnu.org Reply-To: zlomek@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, petdr@cs.mu.OZ.AU, gcc-gnats@gcc.gnu.org Subject: Re: optimization/8635: incorrect optimization of 0.0 * Infinity X-SW-Source: 2002-12/txt/msg00265.txt.bz2 List-Id: Synopsis: incorrect optimization of 0.0 * Infinity State-Changed-From-To: open->closed State-Changed-By: zlomek State-Changed-When: Thu Dec 5 00:32:47 2002 State-Changed-Why: When compiling with -O the variables are kept in coprocessor registers which are more exact that doubles (they are as exact as long doubles). Compiler is allowed to keep the values more exact. Although the value is infinite for doubles, it is finite for long doubles and thus 0.0 * (large but finite) = 0. I also tried to make a long double infinite and it worked as expected: 0.0 * inf = nan (the reason why the result with -O0 was nan is that the register was stored to memory as double and loaded again so when converting large number to doubles it became inf) Josef Zlomek http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8635