From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26595 invoked by alias); 13 Feb 2007 05:41:54 -0000 Received: (qmail 26528 invoked by uid 48); 13 Feb 2007 05:41:40 -0000 Date: Tue, 13 Feb 2007 05:41:00 -0000 Message-ID: <20070213054140.26527.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/30780] cpu_time produces a floating point exception when used with -O0 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jvdelisle at gcc dot gnu dot org" 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-02/txt/msg01363.txt.bz2 ------- Comment #5 from jvdelisle at gcc dot gnu dot org 2007-02-13 05:41 ------- I modified cpu_time_4 to just return some dummy values, and experimented a bit with the test case. When I commented out the print statement, the exception went away. Here is a reduced test case. program test2 real :: dog dog = 1.0 print *, dog end program test2 The exception is occurring in the print statement. Nothing to do with time. (gdb) r Starting program: /home/jerry/prs/pr30780/a.out Program received signal SIGFPE, Arithmetic exception. 0x00002aaaaab2c3d9 in write_float (dtp=0x7fff52698b00, f=0x7fff52698a50, source=, len=) at ../../../gcc43/libgfortran/io/write.c:366 366 if ((m > 0.0 && m < 0.1 - 0.05 / exp_d) || (m >= exp_d - 0.5 ) || -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30780