+2018-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/85488
+ PR middle-end/87649
+ * omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
+ depend closely nested inside of loop with ordered clause with
+ a parameter.
+
2018-10-19 David Malcolm <dmalcolm@redhat.com>
* Makefile.in (TEXI_GCCINT_FILES): Add ux.texi.
case GIMPLE_OMP_FOR:
if (gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_TASKLOOP)
goto ordered_in_taskloop;
- if (omp_find_clause (gimple_omp_for_clauses (ctx->stmt),
- OMP_CLAUSE_ORDERED) == NULL)
+ tree o;
+ o = omp_find_clause (gimple_omp_for_clauses (ctx->stmt),
+ OMP_CLAUSE_ORDERED);
+ if (o == NULL)
{
error_at (gimple_location (stmt),
"%<ordered%> region must be closely nested inside "
"a loop region with an %<ordered%> clause");
return false;
}
+ if (OMP_CLAUSE_ORDERED_EXPR (o) != NULL_TREE
+ && omp_find_clause (c, OMP_CLAUSE_DEPEND) == NULL_TREE)
+ {
+ error_at (gimple_location (stmt),
+ "%<ordered%> region without %<depend%> clause may "
+ "not be closely nested inside a loop region with "
+ "an %<ordered%> clause with a parameter");
+ return false;
+ }
return true;
case GIMPLE_OMP_TARGET:
if (gimple_omp_target_kind (ctx->stmt)
+2018-10-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/85488
+ PR middle-end/87649
+ * c-c++-common/gomp/doacross-2.c: New test.
+ * c-c++-common/gomp/sink-3.c: Expect another error during error
+ recovery.
+
2018-10-19 Segher Boessenkool <segher@kernel.crashing.org>
* gcc.target/powerpc/safe-indirect-jump-2.c: Do not check assigned CR
--- /dev/null
+/* PR middle-end/87649 */
+
+void
+foo (void)
+{
+ int i;
+ #pragma omp for ordered(1)
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered /* { dg-error "'ordered' region without 'depend' clause may not be closely nested inside a loop region with an 'ordered' clause with a parameter" } */
+ ;
+ }
+ #pragma omp for ordered(1)
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered threads /* { dg-error "'ordered' region without 'depend' clause may not be closely nested inside a loop region with an 'ordered' clause with a parameter" } */
+ ;
+ }
+}
+
+void
+bar (void)
+{
+ int i;
+ #pragma omp for ordered
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered depend(source) /* { dg-error "'ordered' construct with 'depend' clause must be closely nested inside a loop with 'ordered' clause with a parameter" } */
+ #pragma omp ordered depend(sink: i - 1) /* { dg-error "'ordered' construct with 'depend' clause must be closely nested inside a loop with 'ordered' clause with a parameter" } */
+ }
+ #pragma omp for
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered depend(source) /* { dg-error "'ordered' construct with 'depend' clause must be closely nested inside a loop with 'ordered' clause with a parameter" } */
+ #pragma omp ordered depend(sink: i - 1) /* { dg-error "'ordered' construct with 'depend' clause must be closely nested inside a loop with 'ordered' clause with a parameter" } */
+ }
+ #pragma omp for
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered /* { dg-error "'ordered' region must be closely nested inside a loop region with an 'ordered' clause" } */
+ ;
+ }
+ #pragma omp for
+ for (i = 0; i < 64; i++)
+ {
+ #pragma omp ordered threads /* { dg-error "'ordered' region must be closely nested inside a loop region with an 'ordered' clause" } */
+ ;
+ }
+}
for (i=0; i < 100; ++i)
{
#pragma omp ordered depend(sink:poo-1,paa+1) /* { dg-error "poo.*declared.*paa.*declared" } */
- bar(&i);
+ bar(&i); /* { dg-error "may not be closely nested" "" { target *-*-* } .-1 } */
#pragma omp ordered depend(source)
}
}