public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, fortran] PR67171 - [6 regression] sourced allocation
@ 2015-10-24 13:46 Paul Richard Thomas
  2015-10-24 15:14 ` Paul Richard Thomas
  2015-10-25 17:17 ` Andre Vehreschild
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Richard Thomas @ 2015-10-24 13:46 UTC (permalink / raw)
  To: fortran, gcc-patches

Dear All,

This patch does four things:
(i) On deallocating class components, the vptr is set to point to the
vtable of the declared type;
(ii) When digging out the last class reference, a NULL is returned if
the allocatable component is to the right of a part reference with
non-zero rank, so that the resulting ICE is removed. The previous
modification takes care of these cases for gfc_reset_vptr and
gfc_reset_len;
(iii) gfc_reset_vptr has been simplified by the use of
gfc_get_vptr_from_expr; and
(iv) All variable expressions for the source are passed to
gfc_trans-assignment, so that array sections work correctly.

I see that Andre has already reserved the testcase
allocate_with_source_10, for the pending patch that I undertook to
review, so I will change this to #12 on submission

OK for trunk?

Cheers

Paul

2015-01-24  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/67171
    * trans-array.c (structure_alloc_comps): On deallocation of
    class components, reset the vptr to the declared type vtable
    and reset the _len field of unlimited polymorphic components.
    *trans-expr.c (gfc_find_and_cut_at_last_class_ref): Bail out on
    allocatable component references to the right of part reference
    with non-zero rank and return NULL.
    (gfc_reset_vptr): Simplify this function by using the function
    gfc_get_vptr_from_expr. Return if the vptr is NULL_TREE.
    (gfc_reset_len): If gfc_find_and_cut_at_last_class_ref returns
    NULL return.
    * trans-stmt.c (gfc_trans_allocate): Rely on the use of
    gfc_trans_assignment if expr3 is a variable expression since
    this deals correctly with array sections.

2015-01-24  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/67171
    * gfortran.dg/allocate_with_source_10.f03: New test

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-25 21:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-24 13:46 [Patch, fortran] PR67171 - [6 regression] sourced allocation Paul Richard Thomas
2015-10-24 15:14 ` Paul Richard Thomas
2015-10-25 17:17 ` Andre Vehreschild
2015-10-25 17:46   ` Paul Richard Thomas
2015-10-26  1:04   ` Paul Richard Thomas

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).