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

Reply via email to