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 middle-end/109013] New: [OpenMP] Diagnose if multiple 'omp ordered' appear in a loop body
Date: Fri, 03 Mar 2023 17:04:51 +0000	[thread overview]
Message-ID: <bug-109013-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 109013
           Summary: [OpenMP] Diagnose if multiple 'omp ordered' appear in
                    a loop body
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: diagnostic, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

The following code is accepted – while clang errors with:

test.c:18:5: error: exactly one 'ordered' directive must appear in the loop
body of an enclosing directive

Cf. "Additional restrictions to the block-associated ordered construct are as
follows:"
...
"During execution of the logical iteration of a loop-associated construct, a
thread must not execute more than one block-associated ordered region that
binds to the corresponding region of the loop-associated construct."



int a[10];

void foo(int n)
{
#if 0
  #pragma omp for ordered schedule(static)
  #pragma omp unroll partial(2)
  for(int i = 1; i < n; i++) {
    #pragma omp ordered
       a[i] += a[i-1];
  }
  // ->
#endif
  #pragma omp for ordered schedule(static)
  for(int i = 1; i < n; i += 2) {
    #pragma omp ordered
       a[i] += a[i-1];
    #pragma omp ordered
       a[i+1] += a[i];
  }
}

             reply	other threads:[~2023-03-03 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 17:04 burnus at gcc dot gnu.org [this message]
2023-03-03 17:25 ` [Bug middle-end/109013] " jakub at gcc dot gnu.org
2023-03-03 18:03 ` 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-109013-4@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).