public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/83118] [8/9/10/11 Regression] Bad intrinsic assignment of class(*) array component of derived type
Date: Fri, 18 Dec 2020 14:00:24 +0000	[thread overview]
Message-ID: <bug-83118-4-Jg1u2c0ZE9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-83118-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83118

--- Comment #38 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:ce8dcc9105cbd4043d575d8b2c91309a423951a9

commit r11-6253-gce8dcc9105cbd4043d575d8b2c91309a423951a9
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Fri Dec 18 14:00:11 2020 +0000

    As well as the PR this patch fixes problems in handling class objects

    2020-12-18  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/83118
            PR fortran/96012
            * resolve.c (resolve_ordinary_assign): Generate a vtable if
            necessary for scalar non-polymorphic rhs's to unlimited lhs's.
            * trans-array.c (get_class_info_from_ss): New function.
            (gfc_trans_allocate_array_storage): Defer obtaining class
            element type until all sources of class exprs are tried. Use
            class API rather than TREE_OPERAND. Look for class expressions
            in ss->info by calling get_class_info_from_ss. After, obtain
            the element size for class descriptors. Where the element type
            is unknown, cast the data as character(len=size) to overcome
            unlimited polymorphic problems.
            (gfc_conv_ss_descriptor): Do not fix class variable refs.
            (build_class_array_ref, structure_alloc_comps): Replace code
            replicating the new function gfc_resize_class_size_with_len.
            (gfc_alloc_allocatable_for_assignment): Obtain element size
            for lhs in cases of deferred characters and class enitities.
            Move code for the element size of rhs to start of block. Clean
            up extraction of class parameters throughout this function.
            After the shape check test whether or not the lhs and rhs
            element sizes are the same. Use earlier evaluation of
            'cond_null'. Reallocation of lhs only to happen if size changes
            or element size changes.
            * trans-expr.c (gfc_resize_class_size_with_len): New function.
            (gfc_get_class_from_expr): If a constant expression is
            encountered, return NULL_TREE;
            (trans_scalar_class_assign): New function.
            (gfc_conv_procedure_call): Ensure the vtable is present for
            passing a non-class actual to an unlimited formal.
            (trans_class_vptr_len_assignment): For expressions of type
            BT_CLASS, extract the class expression if necessary. Use a
            statement block outside the loop body. Ensure that 'rhs' is
            of the correct type. Obtain rhs vptr in all circumstances.
            (gfc_trans_scalar_assign): Call trans_scalar_class_assign to
            make maximum use of the vptr copy in place of assignment.
            (trans_class_assignment): Actually do reallocation if needed.
            (gfc_trans_assignment_1): Simplify some of the logic with
            'realloc_flag'. Set 'vptr_copy' for all array assignments to
            unlimited polymorphic lhs.
            * trans.c (gfc_build_array_ref): Call gfc_resize_class_size_
            with_len to correct span for unlimited polymorphic decls.
            * trans.h : Add prototype for gfc_resize_class_size_with_len.

    gcc/testsuite/
            PR fortran/83118
            PR fortran/96012
            * gfortran.dg/dependency_60.f90: New test.
            * gfortran.dg/class_allocate_25.f90: New test.
            * gfortran.dg/class_assign_4.f90: New test.
            * gfortran.dg/unlimited_polymorphic_32.f03: New test.

  parent reply	other threads:[~2020-12-18 14:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-83118-4@http.gcc.gnu.org/bugzilla/>
2020-05-01 15:23 ` ro at gcc dot gnu.org
2020-05-01 15:25 ` ro at gcc dot gnu.org
2020-05-02 12:22 ` pault at gcc dot gnu.org
2020-05-07 21:04 ` vladimir.fuka at gmail dot com
2020-10-21  5:59 ` pault at gcc dot gnu.org
2020-10-21 16:25 ` pault at gcc dot gnu.org
2020-12-18 14:00 ` cvs-commit at gcc dot gnu.org [this message]
2020-12-26 15:08 ` cvs-commit at gcc dot gnu.org
2021-01-07 11:19 ` cvs-commit at gcc dot gnu.org
2021-01-07 11:21 ` cvs-commit at gcc dot gnu.org
2021-01-07 11:34 ` cvs-commit at gcc dot gnu.org
2021-01-07 13:05 ` cvs-commit at gcc dot gnu.org
2021-01-07 15:23 ` pault at gcc dot gnu.org

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=bug-83118-4-Jg1u2c0ZE9@http.gcc.gnu.org/bugzilla/ \
    --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: link
Be 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).