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/104131] ICE in gfc_conv_array_ref, at fortran/trans-array.c:3810
Date: Wed, 25 Oct 2023 07:07:28 +0000	[thread overview]
Message-ID: <bug-104131-4-3SfBPaLWdA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104131-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to anlauf from comment #7)
> (In reply to Tobias Burnus from comment #6)
> > !$omp task detach (x)
> >       !$omp end task
> > 
> > This seems to be valid. OpenMP mostly only rejects coindexed variables like:
> 
> Alright, I did not expect this, and no other compiler I have access to
> accepts it.

On the technical side, a coarray is just a normal variable that is also
remotely accessible; I think it is usually just 'malloc'ed but in principle the
coarray library could allocate it also in special memory.
There might be some issues when used inside target regions, i.e. on a device
with shared memory (page migrations etc.) but, otherwise, there is no real
reason to disallow it.

Of course, everything related to memory allocation or coindexed access will not
work (in general - at least some special cases will fail).

* * *

In terms of the OpenMP specification, there is a section "Normative
References";

* in OpenMP 5.0, it has: "Fortran 2008 ... their use may result in unspecified
behavior ... Coarrays"

* in OpenMP 5.1, there are no exceptions for 2008 and Fortran 2018 with a new
list of unspecified behavior was added.

Thus, coarrays were never explicitly rejected but in 5.0 their use might result
in unspecified behavior, i.e. an implementation could reject it.
Since 5.1, they can be used where deemed to be okay.

(Disclaimer: What might be okay for most implementation can be unimplementable
in another; additionally, some corner cases might have been overlooked which do
cause problems.)

* * *

My quotes in comment 6 were from OpenMP 5.2, the latest release. TR11 (pre-6.0)
is the latest spec, semi-solid but breaking changes are permitted until the
final 6.0 (to fix oversights).

      parent reply	other threads:[~2023-10-25  7:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 18:53 [Bug fortran/104131] New: " gscfq@t-online.de
2022-01-20 10:19 ` [Bug fortran/104131] " marxin at gcc dot gnu.org
2022-01-26 17:25 ` gscfq@t-online.de
2022-03-03 10:28 ` cvs-commit at gcc dot gnu.org
2023-10-23 18:50 ` anlauf at gcc dot gnu.org
2023-10-23 19:15 ` anlauf at gcc dot gnu.org
2023-10-24 19:53 ` burnus at gcc dot gnu.org
2023-10-24 20:26 ` anlauf at gcc dot gnu.org
2023-10-25  7:07 ` burnus at gcc dot gnu.org [this message]

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-104131-4-3SfBPaLWdA@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).