From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 313B53942021; Thu, 8 Oct 2020 17:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 313B53942021 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/97212] [OpenMP] 'depend' clause with 'target nowait' (!) + 'task' does not work Date: Thu, 08 Oct 2020 17:47:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2020 17:47:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97212 --- Comment #2 from Jakub Jelinek --- I believe the testcase is invalid. As the explicit task doesn't have if(false) clause, the task isn't undeferr= ed, so it is up to the implementation whether it waits for its completion or ju= st continues (defers it). And there is no task synchronization point before t= he if (sum !=3D N) __builtin_abort (); statement, so if the implementation dec= ides to defer it, then there is no guarantee it completes before that statement. Without the target nowait task gcc wouldn't defer it because there is just = an implicit parallel region rather than explicit (e.g. if you add parallel num_threads(1) around most of main and change target nowait to task, you'd = get the same behavior), but in order to support async target tasks we do create intentionally a team and thus defer the task. So, the testcase needs something like #pragma omp taskwait or taskwait with depend or add if(false) to the task.=