From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8600 invoked by alias); 3 Jun 2007 15:15:19 -0000 Received: (qmail 8507 invoked by uid 48); 3 Jun 2007 15:15:09 -0000 Date: Sun, 03 Jun 2007 15:15:00 -0000 Message-ID: <20070603151509.8506.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/32180] Paranoia UCB GSL TestFloat libm tests fail - accuracy of recent gcc math poor In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rob1weld at aol dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg00154.txt.bz2 ------- Comment #3 from rob1weld at aol dot com 2007-06-03 15:15 ------- Here is simple test for the "float-store" issue: main() { double v = 1E308; double x = (v * v) / v; printf("Try compiling with and without -ffloat-store\n"); printf("(1E308 * 1E308) / 1E308\n"); printf("Correct output is 'inf 0' - Incorrect output is '1e+308 1'.\n"); printf("%g %d\n", x, x==v); } Reading the info file for cpp I notice in the node "Common Predefined Macros" that we define various macros for many things but nothing for "-ffloat-store". We have __NO_INLINE__ for -fno-inline We have __USER_LABEL_PREFIX__ for -f(no-)underscores We have __EXCEPTIONS for -fno-exceptions We have __NEXT_RUNTIME__ for -fnext-runtime We have __SSP__ for -fstack-protector We have __SSP_ALL__ for -fstack-protector-all On the basis that using "-ffloat-store" alters the resulting output of gcc I propose we use cpp_define() in gcc-4_3-trunk/gcc/c-cppbuiltin.c to add "__FLOAT_STORE__" for -ffloat-store. We should also fix the code so the math is as accurate as the standard provides for; regardless of use of -ffloat-store or -ffast-math, -msoft-float, -mfpmath=xyz, -msse*, -minline-float-*, -minline-sqrt-*, or anything else. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32180