public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>
Cc: Thomas Koenig <tkoenig@netcologne.de>,
	"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
		gcc-patches <gcc-patches@gcc.gnu.org>,
	Damian Rouson <damian@sourceryinstitute.org>,
		"Bader, Reinhold" <Reinhold.Bader@lrz.de>
Subject: Re: [Patch, fortran] PR34640 - ICE when assigning item of a derived-component to a pointer
Date: Mon, 11 Sep 2017 19:47:00 -0000	[thread overview]
Message-ID: <CAMe9rOob9Yj2wEjNLhVnK13MQtShrp=j6nQd61kMLa+g7NAamQ@mail.gmail.com> (raw)
In-Reply-To: <CAGkQGiJpa5aCo6RJDF2G3RiX-iYmOq9gB4i-BPSbJU8x4Tn1hg@mail.gmail.com>

On Sun, Jul 9, 2017 at 11:43 AM, Paul Richard Thomas
<paul.richard.thomas@gmail.com> wrote:
> Hi Thomas, Hi All,
>
> Please find attached what I believe is the final version of the patch.
>
> The problem concerning temporaries being generated in lieu of the
> descriptor being passed directly - see pointer_array_7.f90 and the
> change to subref_array_4.f90. This latter necessitated a thread on clf
> to get right. Thanks are due to Thomas for initiating it.
>
> I took the opportunity of the delay, while the bounds issue was being
> discussed on clf, to fix class pointer arrays. They now function
> correctly, as evidenced by pointer_array_8.f90.
>
> A possible final tweak - as asked before, should I bump up the module
> version number? My inclination is to say that we should.
>
> Bootstrapped and regtested on FC23/x86_64 - OK for trunk?
>
> Paul
>
> 2017-07-09  Paul Thomas  <pault@gcc.gnu.org>
>
>     PR fortran/34640
>     PR fortran/40737
>     PR fortran/55763
>     PR fortran/57019
>     PR fortran/57116
>
>     * expr.c (is_subref_array): Add class pointer array dummies
>     to the list of expressions that return true.
>     * trans-array.c: Add SPAN_FIELD and update indices for
>     subsequent fields.
>     (gfc_conv_descriptor_span, gfc_conv_descriptor_span_get,
>     gfc_conv_descriptor_span_set, is_pointer_array,
>     get_array_span): New functions.
>     (gfc_get_descriptor_offsets_for_info): New function to preserve
>     API for access to descriptor fields for trans-types.c.
>     (gfc_conv_scalarized_array_ref): If the expression is a subref
>     array, make sure that info->descriptor is a descriptor type.
>     Otherwise, if info->descriptor is a pointer array, set 'decl'
>     and fix it if it is a component reference.
>     (build_array_ref): Simplify handling of class array refs by
>     passing the vptr to gfc_build_array_ref rather than generating
>     the pointer arithmetic in this function.
>     (gfc_conv_array_ref): As in gfc_conv_scalarized_array_ref, set
>     'decl'.
>     (gfc_array_allocate): Set the span field if this is a pointer
>     array. Use the expr3 element size if it is available, so that
>     the dynamic type element size is used.
>     (gfc_conv_expr_descriptor): Set the span field for pointer
>     assignments.
>     * trans-array.h: Prototypes for gfc_conv_descriptor_span_get
>     gfc_conv_descriptor_span_set and
>     gfc_get_descriptor_offsets_for_info added.
>     trans-decl.c (gfc_get_symbol_decl): If a non-class pointer
>     array, mark the declaration as a GFC_DECL_PTR_ARRAY_P. Remove
>     the setting of GFC_DECL_SPAN.
>     (gfc_trans_deferred_vars): Set the span field to zero in thge
>     originating scope.
>     * trans-expr.c (gfc_conv_procedure_call): Do not use copy-in/
>     copy-out to pass subref expressions to a pointer dummy.
>     (gfc_trans_pointer_assignment): Remove code for setting of
>     GFC_DECL_SPAN. Set the 'span' field for non-class pointers to
>     class function results. Likewise for rank remap.
>     * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Pick up the
>     'token' offset from the field decl in the descriptor.
>     (conv_isocbinding_subroutine): Set the 'span' field.
>     * trans-io.c (gfc_trans_transfer): Always scalarize pointer
>     array io.
>     * trans-stmt.c (trans_associate_var): Set the 'span' field.
>     * trans-types.c (gfc_get_array_descriptor_base): Add the 'span'
>     field to the array descriptor.
>     (gfc_get_derived_type): Pointer array components are marked as
>     GFC_DECL_PTR_ARRAY_P.
>     (gfc_get_array_descr_info): Replaced API breaking code for
>     descriptor offset calling gfc_get_descriptor_offsets_for_info.
>     * trans.c (get_array_span): New function.
>     (gfc_build_array_ref): Simplify by calling get_array_span and
>     obtain 'span' if 'decl' or 'vptr' present.
>     * trans.h : Rename DECL_LANG_FLAG_6, GFC_DECL_SUBREF_ARRAY_P,
>     as GFC_DECL_PTR_ARRAY_P.
>
>
> 2017-07-09  Paul Thomas  <pault@gcc.gnu.org>
>
>     PR fortran/34640
>     * gfortran.dg/assumed_type_2.f90: Adjust some of the tree dump
>     checks.
>     * gfortran.dg/no_arg_check_2.f90: Likewise.
>     * gfortran.dg/pointer_array_1.f90: New test.
>     * gfortran.dg/pointer_array_2.f90: New test.
>     * gfortran.dg/pointer_array_7.f90: New test.
>     * gfortran.dg/pointer_array_8.f90: New test.
>     * gfortran.dg/pointer_array_component_1.f90: New test.
>     * gfortran.dg/pointer_array_component_2.f90: New test.
>     * gfortran.dg/goacc/kernels-alias-4.f95: Bump up both tree scan
>     counts by 1.
>     * gfortran.dg/subref_array_pointer_4.f90: Use the passed lower
>     bound for 'Q' to provide an offset for array element access.
>
>     PR fortran/40737
>     * gfortran.dg/pointer_array_3.f90: New test.
>
>     PR fortran/57116
>     * gfortran.dg/pointer_array_4.f90: New test.
>
>     PR fortran/55763
>     * gfortran.dg/pointer_array_5.f90: New test.
>
>     PR fortran/57019
>     * gfortran.dg/pointer_array_6.f90: New test.
>
> 2017-07-09  Paul Thomas  <pault@gcc.gnu.org>
>
>     PR fortran/34640
>     * libgfortran/libgfortran.h: Add span field to descriptor.
>

This caused:

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


-- 
H.J.

  parent reply	other threads:[~2017-09-11 19:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 10:48 Paul Richard Thomas
2017-06-25 10:59 ` Thomas Koenig
2017-06-25 11:43 ` Paul Richard Thomas
2017-07-01 18:17 ` Paul Richard Thomas
2017-07-04 21:04   ` Thomas Koenig
2017-07-06 12:22     ` Paul Richard Thomas
2017-07-09 18:43     ` Paul Richard Thomas
2017-07-09 21:28       ` Thomas Koenig
2017-07-11  6:16         ` Paul Richard Thomas
2017-07-11 14:24           ` Paul Richard Thomas
2017-07-11 14:48             ` Jerry DeLisle
2017-07-11 18:13               ` Thomas Koenig
2017-07-11 20:23                 ` Paul Richard Thomas
2017-09-11 19:47       ` H.J. Lu [this message]
2017-07-10 13:51 Dominique d'Humières

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='CAMe9rOob9Yj2wEjNLhVnK13MQtShrp=j6nQd61kMLa+g7NAamQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=Reinhold.Bader@lrz.de \
    --cc=damian@sourceryinstitute.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.com \
    --cc=tkoenig@netcologne.de \
    /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).