public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60922] New: [4.9 regression]  Memory leak with INTENT(OUT) CLASS argument w/ allocatable CLASS components
@ 2014-04-22 15:33 sfilippone at uniroma2 dot it
  2014-04-23  7:37 ` [Bug fortran/60922] [4.9/4.10 " sfilippone at uniroma2 dot it
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: sfilippone at uniroma2 dot it @ 2014-04-22 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60922
           Summary: [4.9 regression]  Memory leak with INTENT(OUT) CLASS
                    argument w/ allocatable CLASS components
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sfilippone at uniroma2 dot it

Created attachment 32653
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32653&action=edit
test case

Attached code runs fine with 4.8.2, but generates a memory leak with current
trunk, unless I explicitly add FINAL subroutines, which should not be necessary
for this simple case. Possibly 4.9.0 is affected as well. 
Symptoms similar to PR 47637. 
------------ fails with trunk -------------------
[sfilippo@epsilon IMAGING]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/gnu/4.9/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/opt/gnu/4.9
--enable-languages=c,c++,fortran --with-gmp=/usr/local/travel/GNU/gmp
--with-mpfr=/usr/local/travel/GNU/mpfr --with-mpc=/usr/local/travel/GNU/mpc
--with-cloog=/usr/local/travel/GNU/cloog : (reconfigured) ../gcc/configure
--prefix=/opt/gnu/4.9 --with-gmp=/usr/local/travel/GNU/gmp
--with-mpfr=/usr/local/travel/GNU/mpfr --with-mpc=/usr/local/travel/GNU/mpc
--with-cloog=/usr/local/travel/GNU/cloog --enable-languages=c,c++,fortran,lto
--no-create --no-recursion
Thread model: posix
gcc version 4.10.0 20140422 (experimental) (GCC) 
[sfilippo@epsilon IMAGING]$ gfortran -o test_leak_410 -O3 test_leak.f90
[sfilippo@epsilon IMAGING]$ valgrind ./test_leak_410
==2140== Memcheck, a memory error detector
==2140== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==2140== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2140== Command: ./test_leak_410
==2140== 
 Iteration            1
 Iteration            2
==2140== 
==2140== HEAP SUMMARY:
==2140==     in use at exit: 6,291,552 bytes in 5 blocks
==2140==   total heap usage: 32 allocs, 27 frees, 10,497,741 bytes allocated
==2140== 
==2140== LEAK SUMMARY:
==2140==    definitely lost: 48 bytes in 1 blocks
==2140==    indirectly lost: 2,097,152 bytes in 1 blocks
==2140==      possibly lost: 0 bytes in 0 blocks
==2140==    still reachable: 4,194,352 bytes in 3 blocks
==2140==         suppressed: 0 bytes in 0 blocks
==2140== Rerun with --leak-check=full to see details of leaked memory
==2140== 
==2140== For counts of detected and suppressed errors, rerun with: -v
==2140== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)



--------Works with 4.8.2-----------
[sfilippo@epsilon IMAGING]$ gfortran -v 
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/gnu/4.8.2/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.2/configure --prefix=/opt/gnu/4.8.2
--enable-languages=c,c++,fortran --with-gmp=/usr/local/travel/GNU/gmp
--with-mpfr=/usr/local/travel/GNU/mpfr --with-mpc=/usr/local/travel/GNU/mpc
--with-cloog=/usr/local/travel/GNU/cloog
Thread model: posix
gcc version 4.8.2 (GCC) 
[sfilippo@epsilon IMAGING]$ gfortran -o test_leak_482 -O3 test_leak.f90
[sfilippo@epsilon IMAGING]$ valgrind ./test_leak_482
==2122== Memcheck, a memory error detector
==2122== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==2122== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2122== Command: ./test_leak_482
==2122== 
 Iteration            1
 Iteration            2
==2122== 
==2122== HEAP SUMMARY:
==2122==     in use at exit: 4,194,352 bytes in 3 blocks
==2122==   total heap usage: 28 allocs, 25 frees, 10,497,699 bytes allocated
==2122== 
==2122== LEAK SUMMARY:
==2122==    definitely lost: 0 bytes in 0 blocks
==2122==    indirectly lost: 0 bytes in 0 blocks
==2122==      possibly lost: 0 bytes in 0 blocks
==2122==    still reachable: 4,194,352 bytes in 3 blocks
==2122==         suppressed: 0 bytes in 0 blocks
==2122== Rerun with --leak-check=full to see details of leaked memory
==2122== 
==2122== For counts of detected and suppressed errors, rerun with: -v
==2122== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)


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

end of thread, other threads:[~2015-01-24 10:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-22 15:33 [Bug fortran/60922] New: [4.9 regression] Memory leak with INTENT(OUT) CLASS argument w/ allocatable CLASS components sfilippone at uniroma2 dot it
2014-04-23  7:37 ` [Bug fortran/60922] [4.9/4.10 " sfilippone at uniroma2 dot it
2014-04-23  8:41 ` rguenth at gcc dot gnu.org
2014-04-27 13:46 ` dominiq at lps dot ens.fr
2014-07-16 13:31 ` jakub at gcc dot gnu.org
2014-07-17 12:28 ` sfilippone at uniroma2 dot it
2014-10-30 10:43 ` [Bug fortran/60922] [4.9/5 " jakub at gcc dot gnu.org
2015-01-16 21:28 ` janus at gcc dot gnu.org
2015-01-17 16:09 ` janus at gcc dot gnu.org
2015-01-17 16:26 ` [Bug fortran/60922] [4.9/5 regression] Memory leak with " janus at gcc dot gnu.org
2015-01-17 16:43 ` janus at gcc dot gnu.org
2015-01-17 22:07 ` janus at gcc dot gnu.org
2015-01-23  8:35 ` [Bug fortran/60922] [4.9/5 Regression] " janus at gcc dot gnu.org
2015-01-24 10:12 ` janus at gcc dot gnu.org
2015-01-24 10:14 ` janus 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).