This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/41586] Allocatable _scalars_ are never auto-deallocated



------- Comment #1 from burnus at gcc dot gnu dot org  2009-10-05 15:17 -------
Does not need to be a component or derived type, any scalar leaks:

integer , allocatable :: a
allocate(a)
a = 42
end


MAIN__ ()
{
  integer(kind=4) * a;
  {
    void * restrict D.1366;
    D.1366 = (void * restrict) __builtin_malloc (4);
    if (D.1366 == 0B)
      {
        _gfortran_os_error (&"Out of memory"[1]{lb: 1 sz: 1});
      }
    a = (integer(kind=4) *) D.1366;
  }
  *a = 42;
}


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[OOP] Allocatable _scalar_  |Allocatable _scalars_ are
                   |TYPE/CLASS leak memory      |never auto-deallocated


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]