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/41478] Corrupted memory using PACK for derived-types with allocated components



------- Comment #27 from pault at gcc dot gnu dot org  2010-01-14 06:17 -------
Subject: Bug 41478

Author: pault
Date: Thu Jan 14 06:17:38 2010
New Revision: 155877

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155877
Log:
2010-01-14  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/41478
        * trans-array.c (duplicate_allocatable):  Static version of
        gfc_duplicate_allocatable with provision to handle scalar
        components. New boolean argument to switch off call to malloc
        if true.
        (gfc_duplicate_allocatable): New function to call above with
        new argument false.
        (gfc_copy_allocatable_data): New function to call above with
        new argument true.
        (structure_alloc_comps): Do not apply indirect reference to
        scalar pointers. Add new section to copy allocatable components
        of arrays. Extend copying of allocatable components to include
        scalars.
        (gfc_copy_only_alloc_comp): New function to copy allocatable
        component derived types, without allocating the base structure.
        * trans-array.h : Add primitive for gfc_copy_allocatable_data.
        Add primitive for gfc_copy_only_alloc_comp.
        * trans-expr.c (gfc_conv_procedure_call): After calls to
        transformational functions with results that are derived types
        with allocatable components, copy the components in the result.
        (gfc_trans_arrayfunc_assign): Deallocate allocatable components
        of lhs derived types before allocation.


2010-01-14  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/41478
        * gfortran.dg/alloc_comp_scalar_1.f90: New test.
        * gfortran.dg/alloc_comp_transformational_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_scalar_1.f90
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_transformational_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-array.h
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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