public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52176] New: Valgrind complains about some realloc on assignment to unallocated LHS
@ 2012-02-08 20:42 dominiq at lps dot ens.fr
  2012-02-09 17:03 ` [Bug fortran/52176] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-08 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52176
           Summary: Valgrind complains about some realloc on assignment to
                    unallocated LHS
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominiq@lps.ens.fr
                CC: burnus@gcc.gnu.org, pault@gcc.gnu.org


At revision 184016, the executable for Rouson et al code in
chapter08/puppeteer_f2003 passes valgrind without error up to -O. For higher
optimization, valgrind complains:

==6241== Conditional jump or move depends on uninitialised value(s)
==6241==    at 0x100004E46: MAIN__.2374 (main.F90:95)
==6241==    by 0x10000755E: main (main.F90:27)

this is

      jacobian = identity - 0.5*dt*dRHS_dState

and a lot of

==6153== Conditional jump or move depends on uninitialised value(s)
==6153==    at 0x100005258: __air_module_MOD_coordinate (air.F90:82)
==6153==    by 0x1000070BF: ??? (in ./a.out)
==6153==    by 0x10000728F: ??? (in ./a.out)
==6153==    by 0x1000070BF: ??? (in ./a.out)
==6153==    by 0x100454B8F: ???
==6153==    by 0x1000070BF: ??? (in ./a.out)
==6153==    by 0x208: ???

this is

  ! accessor: returns phase-space coordinates
  function coordinate(this) result(return_x)
    class(air)          ,intent(in)  :: this
    real  ,dimension(:) ,allocatable :: return_x
    return_x = [ this%x ,this%sigma ]
  end function

Adding

    allocate(return_x(2))

fixes the later errors. Note that running the executable outside valgrind seems
to give the right results even with -Ofast -flto.


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

end of thread, other threads:[~2015-09-08 12:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08 20:42 [Bug fortran/52176] New: Valgrind complains about some realloc on assignment to unallocated LHS dominiq at lps dot ens.fr
2012-02-09 17:03 ` [Bug fortran/52176] " burnus at gcc dot gnu.org
2013-06-29 15:46 ` dominiq at lps dot ens.fr
2014-03-22 22:47 ` dominiq at lps dot ens.fr
2015-09-08 12:45 ` dominiq at lps dot ens.fr

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).