public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pault at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/20541] TR 15581: ALLOCATABLE components Date: Sun, 08 Oct 2006 16:22:00 -0000 [thread overview] Message-ID: <20061008162222.23423.qmail@sourceware.org> (raw) In-Reply-To: <bug-20541-10302@http.gcc.gnu.org/bugzilla/> ------- Comment #35 from pault at gcc dot gnu dot org 2006-10-08 16:22 ------- Subject: Bug 20541 Author: pault Date: Sun Oct 8 16:21:55 2006 New Revision: 117558 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117558 Log: 2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> PR fortran/20541 * interface.c (gfc_compare_derived_types): Add comparison of the allocatable field. * intrinsic.c (add_subroutines): Add MOVE_ALLOC. * trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign, gfc_trans_subcomponent_assign, gfc_conv_string_parameter, gfc_trans_scalar_assign): Add extra arguments l_is_temp and r_is_var to references to latter function. (gfc_conv_function_call): Add enum for types of argument and an associated variable parm_kind. Deallocate components of INTENT(OUT) and non-variable arrays. (gfc_trans_subcomponent_assign): Add block to assign arrays to allocatable components. (gfc_trans_scalar_assign): Add block to handle assignments of derived types with allocatable components, using the above new arguments to control allocation/deallocation of memory and the copying of allocated arrays. * trans-array.c (gfc_array_allocate): Remove old identification of pointer and replace with that of an allocatable array. Add nullify of structures with allocatable components. (gfc_conv_array_initializer): Treat EXPR_NULL. (gfc_conv_array_parameter): Deallocate allocatable components of non-variable structures. (gfc_trans_dealloc_allocated): Use second argument of library deallocate to inhibit, without error, freeing NULL pointers. (get_full_array_size): New function to return the size of a full array. (gfc_duplicate_allocatable): New function to allocate and copy allocated data. (structure_alloc_comps): New recursive function to deallocate, nullify or copy allocatable components. (gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp, gfc_copy_alloc_comp): New interface functions to call previous. (gfc_trans_deferred_array): Add the code to nullify allocatable components, when entering scope, and to deallocate them on leaving. Do not call gfc_trans_static_array_pointer and return for structures with allocatable components and default initializers. * symbol.c (gfc_set_component_attr): Set allocatable field. (gfc_get_component_attr): Set the allocatable attribute. * intrinsic.h : Prototype for gfc_check_move_alloc. * decl.c (build_struct): Apply TR15581 constraints for allocatable components. (variable_decl): Default initializer is always NULL for allocatable components. (match_attr_spec): Allow, or not, allocatable components, according to the standard in force. * trans-array.h : Prototypes for gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and gfc_duplicate_allocatable. * gfortran.texi : Add mention of TR15581 extensions. * gfortran.h : Add attribute alloc_comp, add gfc_components field allocatable and add the prototype for gfc_expr_to_initialize. * trans-stmt.c (generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp, gfc_trans_where_assign, gfc_trans_where_3): Add extra arguments to calls to gfc_trans_scalar_assign and set appropriately. (gfc_trans_allocate): Nullify allocatable components. (gfc_trans_deallocate): Deallocate to ultimate allocatable components but stop at ultimate pointer components. * module.c (mio_symbol_attribute, mio_symbol_attribute, mio_component): Add module support for allocatable components. * trans-types.c (gfc_get_derived_type): Treat allocatable components. * trans.h : Add two boolean arguments to gfc_trans_scalar_assign. * resolve.c (resolve_structure_cons): Check conformance of constructor element and the component. (resolve_allocate_expr): Add expression to nullify the constructor expression for allocatable components. (resolve_transfer): Inhibit I/O of derived types with allocatable components. (resolve_fl_derived): Skip check of bounds of allocatable components. * trans-decl.c (gfc_get_symbol_decl): Add derived types with allocatable components to deferred variable. (gfc_trans_deferred_vars): Make calls for derived types with allocatable components to gfc_trans_deferred_array. (gfc_generate_function_code): Nullify allocatable component function result on entry. * parse.c (parse_derived): Set symbol attr.allocatable if allocatable components are present. * check.c (gfc_check_allocated): Enforce attr.allocatable for intrinsic arguments. (gfc_check_move_alloc): Check arguments of move_alloc. * primary.c (gfc_variable_attr): Set allocatable attribute. * intrinsic.texi : Add index entry and section for for move_alloc. PR fortran/29115 * resolve.c (resolve_structure_cons): It is an error if the pointer component elements of a derived type constructor are not pointer or target. PR fortran/29211 * trans-stmt.c (generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp): Provide a string length for the temporary by copying that of the other side of the scalar assignment. 2006-10-05 Paul Thomas <pault@gcc.gnu.org> Erik Edelmann <edelmann@gcc.gnu.org> PR libgfortran/20541 * Makefile.in : Add move_alloc. * intrinsics/move_alloc.c: New function. * Makefile.am : Add move_alloc. 2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> PR fortran/20541 * gfortran.dg/alloc_comp_basics_1.f90: New test. * gfortran.dg/alloc_comp_basics_2.f90: New test. * gfortran.dg/alloc_comp_assign_1.f90: New test. * gfortran.dg/alloc_comp_assign_2.f90: New test. * gfortran.dg/alloc_comp_assign_3.f90: New test. * gfortran.dg/alloc_comp_assign_4.f90: New test. * gfortran.dg/alloc_comp_constraint_1.f90: New test. * gfortran.dg/alloc_comp_constraint_2.f90: New test. * gfortran.dg/alloc_comp_constraint_3.f90: New test. * gfortran.dg/alloc_comp_constructor_1.f90: New test. * gfortran.dg/alloc_comp_constructor_2.f90: New test. * gfortran.dg/alloc_comp_initializer_1.f90: New test. * gfortran.dg/alloc_comp_std.f90: New test. * gfortran.dg/move_alloc.f90: New test. PR fortran/29115 * gfortran.dg/derived_constructor_comps_2.f90: New test. PR fortran/29211 * gfortran.dg/forall_char_dependencies_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_1.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_2.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_3.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_4.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_basics_2.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_constraint_2.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_constraint_3.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_constructor_2.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_initializer_1.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_initializer_2.f90 trunk/gcc/testsuite/gfortran.dg/alloc_comp_std.f90 trunk/gcc/testsuite/gfortran.dg/derived_constructor_comps_2.f90 trunk/gcc/testsuite/gfortran.dg/forall_char_dependencies_1.f90 trunk/gcc/testsuite/gfortran.dg/move_alloc.f90 trunk/libgfortran/intrinsics/move_alloc.c Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/check.c trunk/gcc/fortran/decl.c trunk/gcc/fortran/expr.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/interface.c trunk/gcc/fortran/intrinsic.c trunk/gcc/fortran/intrinsic.h trunk/gcc/fortran/intrinsic.texi trunk/gcc/fortran/module.c trunk/gcc/fortran/parse.c trunk/gcc/fortran/primary.c trunk/gcc/fortran/resolve.c trunk/gcc/fortran/symbol.c trunk/gcc/fortran/trans-array.c trunk/gcc/fortran/trans-array.h trunk/gcc/fortran/trans-decl.c trunk/gcc/fortran/trans-expr.c trunk/gcc/fortran/trans-stmt.c trunk/gcc/fortran/trans-types.c trunk/gcc/fortran/trans.h trunk/gcc/testsuite/ChangeLog trunk/libgfortran/ChangeLog trunk/libgfortran/Makefile.in -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20541
next prev parent reply other threads:[~2006-10-08 16:22 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-20541-10302@http.gcc.gnu.org/bugzilla/> 2006-03-12 18:07 ` eedelman at gcc dot gnu dot org 2006-03-12 19:53 ` steven at gcc dot gnu dot org 2006-05-09 21:27 ` tkoenig at gcc dot gnu dot org 2006-07-12 14:21 ` paul dot richard dot thomas at cea dot fr 2006-07-12 14:24 ` paul dot richard dot thomas at cea dot fr 2006-07-12 19:41 ` pault at gcc dot gnu dot org 2006-07-18 14:35 ` paul dot richard dot thomas at cea dot fr 2006-07-30 21:38 ` eedelman at gcc dot gnu dot org 2006-08-06 22:47 ` howarth at nitro dot med dot uc dot edu 2006-08-09 21:55 ` eedelman at gcc dot gnu dot org 2006-08-10 13:31 ` howarth at nitro dot med dot uc dot edu 2006-08-10 20:23 ` eedelman at gcc dot gnu dot org 2006-08-20 14:37 ` howarth at nitro dot med dot uc dot edu 2006-08-20 17:38 ` eedelman at gcc dot gnu dot org 2006-09-19 16:41 ` pinskia at gcc dot gnu dot org 2006-09-23 16:18 ` paul dot thomas at jet dot uk 2006-09-23 16:24 ` howarth at nitro dot med dot uc dot edu 2006-09-23 18:41 ` howarth at nitro dot med dot uc dot edu 2006-09-24 17:31 ` pault at gcc dot gnu dot org 2006-09-25 5:10 ` howarth at nitro dot med dot uc dot edu 2006-09-25 5:54 ` jvdelisle at gcc dot gnu dot org 2006-09-28 14:07 ` pault at gcc dot gnu dot org 2006-09-29 15:00 ` pault at gcc dot gnu dot org 2006-10-02 3:10 ` howarth at nitro dot med dot uc dot edu 2006-10-02 4:15 ` jvdelisle at gcc dot gnu dot org 2006-10-02 7:21 ` sfilippone at uniroma2 dot it 2006-10-02 21:54 ` pault at gcc dot gnu dot org 2006-10-03 15:49 ` sfilippone at uniroma2 dot it 2006-10-05 5:01 ` patchapp at dberlin dot org 2006-10-08 16:22 ` pault at gcc dot gnu dot org [this message] 2006-10-08 16:27 ` pault at gcc dot gnu dot org 2006-10-16 22:30 ` pault at gcc dot gnu dot org 2006-10-17 11:34 ` pault at gcc dot gnu dot org 2006-10-17 11:48 ` fxcoudert at gcc dot gnu dot org 2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com 2005-04-22 12:43 ` [Bug fortran/20541] TR 15581: ALLOCATABLE components fxcoudert at gcc dot gnu dot org 2005-07-29 8:45 ` post at tillmann-wegst dot de 2005-09-27 15:21 ` erik dot edelmann at iki dot fi 2005-09-29 19:48 ` erik dot edelmann at iki dot fi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20061008162222.23423.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).