From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24548 invoked by alias); 26 Mar 2004 16:21:31 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 24538 invoked from network); 26 Mar 2004 16:21:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Mar 2004 16:21:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i2QGLT1X008494; Fri, 26 Mar 2004 11:21:29 -0500 Received: from speedy.slc.redhat.com (vpn50-15.rdu.redhat.com [172.16.50.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i2QGLSj22487; Fri, 26 Mar 2004 11:21:28 -0500 Received: from redhat.com (law@localhost) by speedy.slc.redhat.com (8.12.10/8.12.8/Submit) with ESMTP id i2QGLQ7X014994; Fri, 26 Mar 2004 09:21:26 -0700 Message-Id: <200403261621.i2QGLQ7X014994@speedy.slc.redhat.com> X-Authentication-Warning: speedy.slc.redhat.com: law owned process doing -bs To: Joe Buck cc: gcc@gcc.gnu.org Reply-To: law@redhat.com Subject: Re: -ffast-math and floating point reordering In-Reply-To: Your message of "Wed, 24 Mar 2004 17:07:19 PST." <20040324170719.A12420@synopsys.com> From: law@redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 26 Mar 2004 18:18:00 -0000 X-SW-Source: 2004-03/txt/msg01559.txt.bz2 In message <20040324170719.A12420@synopsys.com>, Joe Buck writes: >If -ffast-math is not specified, we should follow the language standards. >First question: can tree-ssa distinguish, for Fortran, whether parentheses >were present and so whether reordering is allowed? No. The front-ends don't pass enough information around in the tree nodes to know when such changes are safe/unsafe. Even if the information existed none of the optimizers would know how to use it (at least initially). >If -ffast-math is specified, what should we do? One option is to use the >K&R rule and free-associate at will. I feel uncomfortable with that >because of the major loss in accuracy that can result. If, however, we >implement support for the Fortran rules, one option would be to relax >order of evaluation when there are no parentheses (like Fortran), another >would be to just leave the order the same. First I'd like to come out in favor of having a flag to turn on FP reassociation. The question then becomes whether or not -ffast-math ought to turn that flag on. I'm neither a significant user or expert in FP arithmetic. So I've got no strong opinions here. jeff