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/99226] [11 Regression] ICE in expand_expr_real_1, at expr.c:10279
Date: Wed, 24 Feb 2021 10:27:41 +0000	[thread overview]
Message-ID: <bug-99226-4-b3G6x36laK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99226-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> This is invalid and should have been rejected, when teams is nested in
> target, it must be the only thing nested in it, you can't have two teams
> directives nested in one target construct.

How is this enforceable at compile time for '!$omp target; call f(); call g()"
and then in f() and g() the teams?


The following C program compiles – without ICE and without error:

void
sub (int n)
{
  int i;
#pragma omp target
  {
    #pragma omp teams distribute dist_schedule (static,n+4)
    for (i = 0; i < 8; ++i)
      ;
    #pragma omp teams distribute dist_schedule (static,n+4)
    for (i = 0; i < 8; ++i)
      ;
  }
}


And the resulting omplower dump is:
          #pragma omp teams shared(n)
          __builtin_GOMP_teams (0, 0);
          {
            D.2077 = n + 4;
            {
              int i;

              #pragma omp distribute dist_schedule(static,D.2077) private(i)
              for (i = 0; i < 8; i = i + 1)
              #pragma omp continue (i, i)
              #pragma omp return(nowait)
            }
          }
          #pragma omp return(nowait)

while for Fortran the dump is
            #pragma omp teams shared(n)
            __builtin_GOMP_teams (0, 0);
            {
              {
                integer(kind=4) D.3932;

                D.3936 = *n;
                D.3932 = D.3936 + 4;
                {
                  integer(kind=4) i;

                  #pragma omp distribute dist_schedule(static,D.3932)
private(i)
                  for (i = 1; i <= 8; i = i + 1)
                  <D.3945>:
                  #pragma omp continue (i, i)
                  #pragma omp return(nowait)
                }
              }
            }
            #pragma omp return(nowait)

  parent reply	other threads:[~2021-02-24 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 18:30 [Bug fortran/99226] New: " gscfq@t-online.de
2021-02-23 18:48 ` [Bug fortran/99226] " jakub at gcc dot gnu.org
2021-02-24  8:20 ` rguenth at gcc dot gnu.org
2021-02-24 10:27 ` burnus at gcc dot gnu.org [this message]
2021-02-24 10:46 ` jakub at gcc dot gnu.org
2021-02-24 14:13 ` jakub at gcc dot gnu.org
2021-02-24 15:18 ` burnus at gcc dot gnu.org
2021-02-24 19:16 ` cvs-commit at gcc dot gnu.org
2021-02-25  8:18 ` jakub 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-99226-4-b3G6x36laK@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).