From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19983 invoked by alias); 14 Jun 2013 15:47:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19927 invoked by uid 48); 14 Jun 2013 15:47:55 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57611] New: [Fortran-Dev Regression] Too much memory allocated (gfortran.dg/coarray_lib_alloc_2.f90) Date: Fri, 14 Jun 2013 15:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: fortran-dev X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter blocked Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg00740.txt.bz2 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.