From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27229 invoked by alias); 5 Dec 2011 01:38:47 -0000 Received: (qmail 27220 invoked by uid 22791); 5 Dec 2011 01:38:46 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BJ,TW_CX,TW_DC,TW_GC,TW_GX X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Dec 2011 01:38:28 +0000 From: "john.harper at vuw dot ac.nz" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 Date: Mon, 05 Dec 2011 01:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: john.harper at vuw dot ac.nz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-12/txt/msg00349.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418 Bug #: 51418 Summary: Fortran format sp,f0.0 output wrong with NaN and 0.0 Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: john.harper@vuw.ac.nz This 6-line program prints " NaN" when IMHO it should print "NaN" and "+." when IMHO it should print "+0." rimu[~]$ cat gftest.f90 character:: cnan*3 = 'NaN', fmt*13 = '(SP,A,F0.0,A)' real xnan read(cnan,*) xnan print fmt, '"',xnan,'"' print fmt, '"',0.0 ,'"' end rimu[~]$ gfortran -v Using built-in specs. Target: i386-redhat-linux6E Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-gnu-unique-object --enable-languages=c,c++,fortran --disable-libgcj --with-mpfr=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/mpfr-install/ --with-ppl=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/ppl-install --with-cloog=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/cloog-install --with-tune=generic --with-arch=i586 --build=i386-redhat-linux6E Thread model: posix gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) rimu[~]$ gfortran gftest.f90 rimu[~]$ ./a.out " NaN" "+." rimu[~]$ The output is the same on another machine: regent[~/Jfh] % gfortran -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)