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/93956] Wrong array creation with p => array_dt(1:n)%component
Date: Thu, 23 Apr 2020 18:31:02 +0000	[thread overview]
Message-ID: <bug-93956-4-gX8jt80ca4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93956-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Kथà¤nig <tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:06eca1acafa27e19e82dc73927394a7a4d0bdbc5

commit r10-7920-g06eca1acafa27e19e82dc73927394a7a4d0bdbc5
Author: Thomas König <tkoenig@gcc.gnu.org>
Date:   Thu Apr 23 20:30:01 2020 +0200

    Fix PR 93956, wrong pointer when returned via function.

    This one took a bit of detective work.  When array pointers point
    to components of derived types, we currently set the span field
    and then create an array temporary when we pass the array
    pointer to a procedure as a non-pointer or non-target argument.
    (This is inefficient, but that's for another release).

    Now, the compiler detected this case when there was a direct assignment
    like p => a%b, but not when p was returned either as a function result
    or via an argument.  This patch fixes that.

    2020-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

            PR fortran/93956
            * expr.c (gfc_check_pointer_assign): Also set subref_array_pointer
            when a function returns a pointer.
            * interface.c (gfc_set_subref_array_pointer_arg): New function.
            (gfc_procedure_use): Call it.

    2020-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

            PR fortran/93956
            * gfortran.dg/pointer_assign_13.f90: New test.

  parent reply	other threads:[~2020-04-23 18:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93956-4@http.gcc.gnu.org/bugzilla/>
2020-03-11 12:04 ` marxin at gcc dot gnu.org
2020-04-14 17:16 ` tkoenig at gcc dot gnu.org
2020-04-20  5:26 ` mscfd at gmx dot net
2020-04-20 14:36 ` tkoenig at gcc dot gnu.org
2020-04-20 16:08 ` tkoenig at gcc dot gnu.org
2020-04-20 18:42 ` tkoenig at gcc dot gnu.org
2020-04-21 18:48 ` tkoenig at gcc dot gnu.org
2020-04-23 18:31 ` cvs-commit at gcc dot gnu.org [this message]
2020-04-24  6:23 ` cvs-commit at gcc dot gnu.org
2020-04-24  7:27 ` cvs-commit at gcc dot gnu.org
2020-04-24  7:28 ` tkoenig at gcc dot gnu.org
2020-04-24  7:28 ` tkoenig at gcc dot gnu.org
2020-04-26 12:52 ` cvs-commit at gcc dot gnu.org
2020-04-27 21:51 ` cvs-commit at gcc dot gnu.org
2020-04-27 21:53 ` tkoenig at gcc dot gnu.org
2020-04-28 16:23 ` pault at gcc dot gnu.org
2020-05-01 12:53 ` cvs-commit at gcc dot gnu.org
2020-05-01 12:55 ` cvs-commit at gcc dot gnu.org
2020-05-21 10:42 ` tkoenig at gcc dot gnu.org
2021-04-16 16:22 ` tkoenig 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-93956-4-gX8jt80ca4@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).