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

            Bug ID: 57611
           Summary: [Fortran-Dev Regression] Too much memory allocated
                    (gfortran.dg/coarray_lib_alloc_2.f90)
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
            Blocks: 56818

The following should be:
  yy._data.base_addr = (void * restrict) __builtin_malloc (1);
however, it is
  yy._data.base_addr = (void * restrict) __builtin_malloc (128);

type t
end type t
class(t), allocatable :: yy(:)
allocate(yy(2))
end

Similarly for coarrays, cf. gfortran.dg/coarray_lib_alloc_2.f90:
 class(t), allocatable :: xx[:], yy(:)[:]
 allocate(yy(2)[*], stat=stat, errmsg=errmsg)
which gives
  xx._data.base_addr = _gfortran_caf_register (72, 1, &xx._data.token, &stat.0,
                                               &errmsg, 200);
  yy._data.base_addr = _gfortran_caf_register (192, 1, &yy._data.token,
&stat.2,
                                               &errmsg, 200);
The first arguments should be "1" instead of 72/192.


As the email at http://gcc.gnu.org/ml/fortran/2013-06/msg00071.html indicates,
there seems to be some pointer involved as the size varies between 32 and 64
bit systems.

Reply via email to