public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46703] New: Wrong I/O output (only) when running under valgrind
@ 2010-11-29  9:00 burnus at gcc dot gnu.org
  2010-11-29 19:38 ` [Bug fortran/46703] " mikael at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-11-29  9:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46703

           Summary: Wrong I/O output (only) when running under valgrind
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jvdelisle@gcc.gnu.org


There is something odd with the following program. It shows (here) always the
correct output -- except I run it through valgrind.

(The program is from
http://groups.google.com/group/comp.lang.fortran/msg/cb8e13e6226bc6c5 (part of
the c.l.f thread
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1b907e3b7b6f3461).
James reports that it fails on MinGW with the www.equation.com version but not
with the MinGW version.)

Without valgrind, the program prints (with GCC 4.6 and 4.5 and any optimization
level):
  3.36210314311209350626E-4912
  ...
  3.36210314311209350626E-4912
  1.18973149535723176502E+4932
  ...
  1.18973149535723176502E+4932

However, using valgrind I get:
   0.0000000000000000000
   ...
   0.0000000000000000000
  i.f                   E+0000
   ...
  i.f                   E+0000

But otherwise no warning and no leakage.

Using GCC 4.5, I get with valgrind "0.0000" and "+Infinity".

The issue seems to be in libgfortran as the result depends on the library and
not on the FE compiler. I am also not sure whether there is a real issue or
whether it is just a side effect of valgrind.


program bugs2
   implicit none
   integer, parameter :: ep = 10
   real(ep) x
   integer i

   x = tiny(x)
   write(*,*) x
   do i = 1, 10
      x = 100*x
      write(*,*) x
   end do
   x = huge(x)
   write(*,*) x
   do i = 1, 10
      x = x/1.0e100_ep
      write(*,*) x
   end do
end program bugs2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-19 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29  9:00 [Bug fortran/46703] New: Wrong I/O output (only) when running under valgrind burnus at gcc dot gnu.org
2010-11-29 19:38 ` [Bug fortran/46703] " mikael at gcc dot gnu.org
2010-12-27  0:23 ` dfranke at gcc dot gnu.org
2010-12-27  1:04 ` jvdelisle at gcc dot gnu.org
2011-07-24 18:54 ` dfranke at gcc dot gnu.org
2013-05-19  5:01 ` bdavis at gcc dot gnu.org
2013-05-19 19:35 ` jvdelisle 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).