public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/102708] Improve ''array temporary was created for argument" diagnostic
Date: Thu, 14 Oct 2021 09:49:52 +0000	[thread overview]
Message-ID: <bug-102708-4-iGq35k5AWU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102708-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Actually, it prints the line number at the call site. Thus, there is probably
no need for adding the name of callee.

However, related to the fsym/proc_name passing:

Currently, the callers in gfc_conv_procedure_call do not make use of the
avoid-copy-in feature by not passing the (add) contiguous (check) = true flag
to gfc_conv_subref_array_arg.

There are some testcase which check that the copyin does not happen when being
contiguous, but I think those are not used for dummy arguments that are
(CONTIGUOUS) assumed-shape/assumed-rank arrays.

Side note: To get that working, it requires the gfc_conv_subref_array_arg
changes of the patch at
  https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581575.html
which might be the reason for not doing it currently.

 * * *

Another observation, which might be unrelated or related: TRANSFORM can be
implemented by just swapping the first and second dimension (see
trans-intrinsic.s + trans-array.c, search for ISYM_TRANSFORM).

Currently, GCC for a call makes it contiguous – which it could be also
transferred as is (noncontiguous). I am not sure what's better, though.

Testcase: gfortran.dg/c-interop/fc-descriptor-7.f90 also part of the patch 
  https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581575.html
Search for the comments regarding the implementation choice.

As testing shows, calling a Fortran procedure does the copy in (as mentioned)
but with my patch, calling a BIND(C) procedure passes the array as
noncontiguous array.
Thus, I wonder whether it is also related to the gfc_conv_subref_array_arg.

 * * *

gfc_conv_subref_array_arg: While the above mentioned patch adds support for a
contiguous check with descriptors, I lack an optional + contiguous check
testcase.

However, that can only be added once gfc_conv_subref_array_arg is called with
contiguous=true - or in any other way with type = descriptor type.

  reply	other threads:[~2021-10-14  9:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 15:00 [Bug fortran/102708] New: " burnus at gcc dot gnu.org
2021-10-14  9:49 ` burnus at gcc dot gnu.org [this message]
2022-01-06  1:21 ` [Bug fortran/102708] " sandra 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-102708-4-iGq35k5AWU@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).