public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/104563] [OpenMP] ICE in install_var_field, at omp-low.cc:810 (multi map of same var)
Date: Thu, 17 Feb 2022 17:02:07 +0000	[thread overview]
Message-ID: <bug-104563-4-OuWAAJ0evG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104563-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Trying the hopefully matching rewrite of the test into C/C++:
void
foo (void)
{
  int x, scalar;
  int a[10];
  struct S { int var; int b[10]; } test_struct;
  int i;
  test_struct.var = 1;
  for (i = 0; i < 10; i++)
    {
      a[i] = 42;
      test_struct.b[i] = 42;
    }
  scalar = 80;
  #pragma omp target map(alloc: scalar, a, test_struct) map(to: scalar, a,
test_struct)
  if (scalar != 80 || a[1] != 42 || test_struct.var != 1 || test_struct.b[1] !=
42)
    __builtin_abort ();
}
is right now rejected by GCC:
pr104563.c: In function ‘void foo()’:
pr104563.c:15:44: error: ‘test_struct’ appears more than once in map clauses
   15 |   #pragma omp target map(alloc: scalar, a, test_struct) map(to: scalar,
a, test_struct)
      |                                            ^~~~~~~~~~~
pr104563.c:15:41: error: ‘a’ appears more than once in map clauses
   15 |   #pragma omp target map(alloc: scalar, a, test_struct) map(to: scalar,
a, test_struct)
      |                                         ^
pr104563.c:15:33: error: ‘scalar’ appears more than once in map clauses
   15 |   #pragma omp target map(alloc: scalar, a, test_struct) map(to: scalar,
a, test_struct)
      |                                 ^~~~~~
I agree it is invalid OpenMP 4.5, valid in OpenMP 5.0.
But as we clearly don't support it for C/C++, IMHO we shouldn't support it for
Fortran either,
especially when the support in the middle-end for it isn't there yet (otherwise
it wouldn't ICE).

      reply	other threads:[~2022-02-17 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 10:05 [Bug middle-end/104563] New: " burnus at gcc dot gnu.org
2022-02-17 17:02 ` jakub 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-104563-4-OuWAAJ0evG@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).