PR libgomp/80394
* omp-low.c (scan_omp_task): Don't optimize away empty tasks
if they have any depend clauses.
* testsuite/libgomp.c/pr80394.c: New test.
From-SVN: r246849
+2017-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/80394
+ * omp-low.c (scan_omp_task): Don't optimize away empty tasks
+ if they have any depend clauses.
+
2017-04-11 Martin Liska <mliska@suse.cz>
PR ipa/80212
tree name, t;
gomp_task *stmt = as_a <gomp_task *> (gsi_stmt (*gsi));
- /* Ignore task directives with empty bodies. */
+ /* Ignore task directives with empty bodies, unless they have depend
+ clause. */
if (optimize > 0
- && empty_body_p (gimple_omp_body (stmt)))
+ && empty_body_p (gimple_omp_body (stmt))
+ && !omp_find_clause (gimple_omp_task_clauses (stmt), OMP_CLAUSE_DEPEND))
{
gsi_replace (gsi, gimple_build_nop (), false);
return;
+2017-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/80394
+ * testsuite/libgomp.c/pr80394.c: New test.
+
2017-04-04 Jakub Jelinek <jakub@redhat.com>
PR libgomp/79876
--- /dev/null
+/* PR libgomp/80394 */
+
+int
+main ()
+{
+ int x = 0;
+ #pragma omp parallel shared(x)
+ #pragma omp single
+ {
+ #pragma omp task depend(inout: x)
+ {
+ for (int i = 0; i < 100000; i++)
+ asm volatile ("" : : : "memory");
+ x += 5;
+ }
+ #pragma omp task if (0) depend(inout: x)
+ ;
+ if (x != 5)
+ __builtin_abort ();
+ }
+ return 0;
+}