public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0
@ 2011-12-05 1:38 john.harper at vuw dot ac.nz
2011-12-05 8:41 ` [Bug fortran/51418] " burnus at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: john.harper at vuw dot ac.nz @ 2011-12-05 1:38 UTC (permalink / raw)
To: gcc-bugs
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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/51418] Fortran format sp,f0.0 output wrong with NaN and 0.0
2011-12-05 1:38 [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 john.harper at vuw dot ac.nz
@ 2011-12-05 8:41 ` burnus at gcc dot gnu.org
2011-12-05 21:03 ` John.Harper at msor dot vuw.ac.nz
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-05 8:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-05 08:40:49 UTC ---
(In reply to comment #0)
> This 6-line program prints " NaN" when IMHO it should print "NaN" and "+."
> when IMHO it should print "+0."
> gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)
> gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
With GCC 4.7 and 4.6.2, I get:
"NaN"
"+0."
However, with GCC 4.5.3 20110428, I get:
" NaN"
"**"
Thus, it must have been fixed in 4.6 - either 4.6.0 or later. I saw some
I/O-format-related changes around 2011-04-29 and some others around 2011-02-28.
As it is no regression, an (inconvenient but) minor issue, and as I/O format
fixes tend to have unexpected side effects, I do not think that the patches
will be back ported to 4.5 or even 4.4.
Thus, if the bug is a show stopper, you could try to install (possibly parallel
to 4.4) a newer GCC/gfortran. For instance, Fedora 16 ships with GCC 4.6 and
Ubuntu offers it as personal builds (cf.
http://gcc.gnu.org/wiki/GFortranDistros). There is also a gfortran developer
build for i386-linux at http://gcc.gnu.org/wiki/GFortranBinaries, which you
could use - or you build GCC yourself.
If it is no show stopper, you could also simply wait for the next Ubuntu
version or - for RHEL - for a 6.x version with a newer GCC as technical
preview.
Thanks for reporting the bug!
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/51418] Fortran format sp,f0.0 output wrong with NaN and 0.0
2011-12-05 1:38 [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 john.harper at vuw dot ac.nz
2011-12-05 8:41 ` [Bug fortran/51418] " burnus at gcc dot gnu.org
@ 2011-12-05 21:03 ` John.Harper at msor dot vuw.ac.nz
2012-01-10 19:47 ` jvdelisle at gcc dot gnu.org
2012-07-06 18:17 ` [Bug libfortran/51418] " bdavis at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: John.Harper at msor dot vuw.ac.nz @ 2011-12-05 21:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418
--- Comment #2 from John.Harper at msor dot vuw.ac.nz 2011-12-05 21:01:09 UTC ---
Thank you. I have had absolutely no luck trying to build GCC (I got as
far as configure appearing to complete OK but make ended with
checking whether ln -s works... yes
checking for i386-redhat-linux-gnu-gcc... /tmp/gccobj/./gcc/xgcc
-B/tmp/gccobj/./gcc/ -B/tmp/i386-redhat-linux-gnu/bin/
-B/tmp/i386-redhat-linux-gnu/lib/ -isystem
/tmp/i386-redhat-linux-gnu/include -isystem
/tmp/i386-redhat-linux-gnu/sys-include
checking for suffix of object files... configure: error: in
`/tmp/gccobj/i386-redhat-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/tmp/gccobj'
make: *** [all] Error 2
Unfortunately neither that nor config.log told me what I must change.
I had to build gcc in /tmp because my own disk space can't hold the whole
of gcc, which is several hundred Mb. G95 is much smaller. However I built
GMP, MPFR and MPC in my own root directory. Another problem: my system is
i386 and the build I found is i686. I don't know if the difference is
important. Also, the gfortran installation instructions say
Install using the following command:
tar -xzvf gfortran-4.5-linux-i686.tar.gz -C /
This will install gfortran in /usr/local/gfortran
but they do not say what to do if one is not a superuser so can't put
things in /usr/local .
Assuming that what I had to do was
tar -xzvf /tmp/gcc_2011-11-26.tgz -C /tmp
I then tried that and found an executable file
/tmp/gcc_2011-11-26/run/bin/gfortran
but the command /tmp/gcc_2011-11-26/run/bin/gfortran -v gave
/tmp/gcc_2011-11-26/run/bin/gfortran: /lib/libc.so.6: version `GLIBC_2.11'
not found (required by /tmp/gcc_2011-11-26/run/bin/gfortran)
What must I do now to finish installing gfortran? (I made a workaround
for my original problem by writing a Fortran 95 module to simulate F0.n
output. That revealed an error in the Intel compiler which I reported,
but g95 and gfortran 4.4 worked properly with it!)
On Mon, 5 Dec 2011, burnus at gcc dot gnu.org wrote:
> Date: Mon, 5 Dec 2011 08:40:49 +0000
> From: burnus at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
> To: john.harper@vuw.ac.nz
> Subject: [Bug fortran/51418] Fortran format sp,
> f0.0 output wrong with NaN and 0.0
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418
>
> Tobias Burnus <burnus at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |burnus at gcc dot gnu.org
>
> --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-05 08:40:49 UTC ---
> (In reply to comment #0)
>> This 6-line program prints " NaN" when IMHO it should print "NaN" and "+."
>> when IMHO it should print "+0."
>> gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)
>> gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
>
> With GCC 4.7 and 4.6.2, I get:
> "NaN"
> "+0."
>
> However, with GCC 4.5.3 20110428, I get:
> " NaN"
> "**"
>
> Thus, it must have been fixed in 4.6 - either 4.6.0 or later. I saw some
> I/O-format-related changes around 2011-04-29 and some others around 2011-02-28.
>
>
> As it is no regression, an (inconvenient but) minor issue, and as I/O format
> fixes tend to have unexpected side effects, I do not think that the patches
> will be back ported to 4.5 or even 4.4.
>
>
> Thus, if the bug is a show stopper, you could try to install (possibly parallel
> to 4.4) a newer GCC/gfortran. For instance, Fedora 16 ships with GCC 4.6 and
> Ubuntu offers it as personal builds (cf.
> http://gcc.gnu.org/wiki/GFortranDistros). There is also a gfortran developer
> build for i386-linux at http://gcc.gnu.org/wiki/GFortranBinaries, which you
> could use - or you build GCC yourself.
>
> If it is no show stopper, you could also simply wait for the next Ubuntu
> version or - for RHEL - for a 6.x version with a newer GCC as technical
> preview.
>
> Thanks for reporting the bug!
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
-- John Harper, School of Mathematics Statistics and Operations Research
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5276 fax (+64)(4)463 5045
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/51418] Fortran format sp,f0.0 output wrong with NaN and 0.0
2011-12-05 1:38 [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 john.harper at vuw dot ac.nz
2011-12-05 8:41 ` [Bug fortran/51418] " burnus at gcc dot gnu.org
2011-12-05 21:03 ` John.Harper at msor dot vuw.ac.nz
@ 2012-01-10 19:47 ` jvdelisle at gcc dot gnu.org
2012-07-06 18:17 ` [Bug libfortran/51418] " bdavis at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2012-01-10 19:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot
| |gnu.org
--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2012-01-10 19:47:07 UTC ---
I suggest we close this one as no further fixes. I can assist with a build or
get binaries from the wiki for later versions.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libfortran/51418] Fortran format sp,f0.0 output wrong with NaN and 0.0
2011-12-05 1:38 [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 john.harper at vuw dot ac.nz
` (2 preceding siblings ...)
2012-01-10 19:47 ` jvdelisle at gcc dot gnu.org
@ 2012-07-06 18:17 ` bdavis at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: bdavis at gcc dot gnu.org @ 2012-07-06 18:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51418
Bud Davis <bdavis at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |bdavis at gcc dot gnu.org
Resolution| |FIXED
--- Comment #4 from Bud Davis <bdavis at gcc dot gnu.org> 2012-07-06 18:16:49 UTC ---
>From reading the summary, the bug is fixed in recent versions, and no further
action is to be taken. Thus "RESOLVED / FIXED".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-06 18:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-05 1:38 [Bug fortran/51418] New: Fortran format sp,f0.0 output wrong with NaN and 0.0 john.harper at vuw dot ac.nz
2011-12-05 8:41 ` [Bug fortran/51418] " burnus at gcc dot gnu.org
2011-12-05 21:03 ` John.Harper at msor dot vuw.ac.nz
2012-01-10 19:47 ` jvdelisle at gcc dot gnu.org
2012-07-06 18:17 ` [Bug libfortran/51418] " bdavis at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).