From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 063DB3858C83; Fri, 3 Mar 2023 17:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 063DB3858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677863093; bh=/FXzOC9IBE+jUZrtV4d3tgsBTHtPwzXTmvIIn3dsNqI=; h=From:To:Subject:Date:From; b=K/l1ynjJKGyYAi7qKdaCCghoe3EXEzK46AuOjS2egbwYZBGsMxg+NZla96lz4ByKW NsJtPOYx4xHdaLMUnF7dDzgERSkm/Q/RozfExdMaL1m+ncAj5qMSSIHhZCGnCRdBYx YzTshn4U09xsHRBYMRsGKuz4sroNChDmHdoctV3c= From: "burnus at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109013 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 =E2=80=93 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 =3D 1; i < n; i++) { #pragma omp ordered a[i] +=3D a[i-1]; } // -> #endif #pragma omp for ordered schedule(static) for(int i =3D 1; i < n; i +=3D 2) { #pragma omp ordered a[i] +=3D a[i-1]; #pragma omp ordered a[i+1] +=3D a[i]; } }=