From 90a0bf4e029b1ff3d7e7dfc6f98da88356587959 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 7 Mar 2019 20:46:11 +0100 Subject: [PATCH] re PR translation/79999 (possible typo in gimplify.c: depend(sink:)) PR translation/79999 * gimplify.c (gimplify_omp_ordered): Reword diagnostics to talk about depend clause with source (or sink) modifier. * omp-expand.c (expand_omp_ordered_sink): Likewise. * c-c++-common/gomp/doacross-1.c: Adjust expected diagnostics. * c-c++-common/gomp/doacross-3.c: New test. From-SVN: r269468 --- gcc/ChangeLog | 5 ++ gcc/gimplify.c | 13 ++--- gcc/omp-expand.c | 9 ++-- gcc/testsuite/ChangeLog | 4 ++ gcc/testsuite/c-c++-common/gomp/doacross-1.c | 4 +- gcc/testsuite/c-c++-common/gomp/doacross-3.c | 54 ++++++++++++++++++++ 6 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/gomp/doacross-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 082e90b0126..e2ece539fe4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-03-07 Jakub Jelinek + PR translation/79999 + * gimplify.c (gimplify_omp_ordered): Reword diagnostics to talk about + depend clause with source (or sink) modifier. + * omp-expand.c (expand_omp_ordered_sink): Likewise. + PR target/89602 * config/i386/sse.md (avx512f_mov_mask, *avx512f_load_mask, avx512f_store_mask): New define_insns. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index fa85b1c86de..6d7a314719d 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -12145,8 +12145,8 @@ gimplify_omp_ordered (tree expr, gimple_seq body) if (!fail && i != gimplify_omp_ctxp->loop_iter_var.length () / 2) { error_at (OMP_CLAUSE_LOCATION (c), - "number of variables in % " - "clause does not match number of " + "number of variables in % clause with " + "% modifier does not match number of " "iteration variables"); failures++; } @@ -12158,8 +12158,8 @@ gimplify_omp_ordered (tree expr, gimple_seq body) if (source_c) { error_at (OMP_CLAUSE_LOCATION (c), - "more than one % clause on an " - "% construct"); + "more than one % clause with % " + "modifier on an % construct"); failures++; } else @@ -12169,8 +12169,9 @@ gimplify_omp_ordered (tree expr, gimple_seq body) if (source_c && sink_c) { error_at (OMP_CLAUSE_LOCATION (source_c), - "% clause specified together with " - "% clauses on the same construct"); + "% clause with % modifier specified " + "together with % clauses with % modifier " + "on the same construct"); failures++; } diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 5c2dba9d1c5..89a3a323267 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -2147,8 +2147,8 @@ expand_omp_ordered_sink (gimple_stmt_iterator *gsi, struct omp_for_data *fd, forward = tree_int_cst_sgn (step) != -1; } if (forward ^ OMP_CLAUSE_DEPEND_SINK_NEGATIVE (deps)) - warning_at (loc, 0, "% clause waiting for " - "lexically later iteration"); + warning_at (loc, 0, "% clause with % modifier " + "waiting for lexically later iteration"); break; } deps = TREE_CHAIN (deps); @@ -2284,8 +2284,9 @@ expand_omp_ordered_sink (gimple_stmt_iterator *gsi, struct omp_for_data *fd, build_int_cst (itype, 0)); if (integer_zerop (t) && !warned_step) { - warning_at (loc, 0, "% refers to iteration never " - "in the iteration space"); + warning_at (loc, 0, "% clause with % modifier " + "refers to iteration never in the iteration " + "space"); warned_step = true; } cond = fold_build2_loc (loc, BIT_AND_EXPR, boolean_type_node, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31b1f69b814..e2b22ba5436 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2019-03-07 Jakub Jelinek + PR translation/79999 + * c-c++-common/gomp/doacross-1.c: Adjust expected diagnostics. + * c-c++-common/gomp/doacross-3.c: New test. + PR target/89602 * gcc.target/i386/avx512f-vmovss-1.c: New test. * gcc.target/i386/avx512f-vmovss-2.c: New test. diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-1.c b/gcc/testsuite/c-c++-common/gomp/doacross-1.c index 6244ca08d2c..eacaeaef80a 100644 --- a/gcc/testsuite/c-c++-common/gomp/doacross-1.c +++ b/gcc/testsuite/c-c++-common/gomp/doacross-1.c @@ -38,11 +38,11 @@ foo (void) for (i = 0; i < 64; i++) { #pragma omp ordered depend (sink: i - 1) depend (sink: i - 2) - #pragma omp ordered depend (source) depend (source) /* { dg-error "more than one .depend.source.. clause on an" } */ + #pragma omp ordered depend (source) depend (source) /* { dg-error "more than one .depend. clause with .source. modifier on an .ordered. construct" } */ } #pragma omp for ordered (1) for (i = 0; i < 64; i++) { - #pragma omp ordered depend (sink: i - 1) depend (source) depend (sink: i - 2) /* { dg-error "clause specified together with" } */ + #pragma omp ordered depend (sink: i - 1) depend (source) depend (sink: i - 2) /* { dg-error ".depend. clause with .source. modifier specified together with .depend. clauses with .sink. modifier on the same construct" } */ } } diff --git a/gcc/testsuite/c-c++-common/gomp/doacross-3.c b/gcc/testsuite/c-c++-common/gomp/doacross-3.c new file mode 100644 index 00000000000..6d7517271f6 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/doacross-3.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +void +foo (void) +{ + int i, j; + #pragma omp for ordered (1) + for (i = 0; i < 64; i++) + { + #pragma omp ordered depend (sink: i + 1) /* { dg-warning "'depend' clause with 'sink' modifier waiting for lexically later iteration" } */ + #pragma omp ordered depend (source) + } + #pragma omp for ordered (1) + for (i = 63; i >= 0; i--) + { + #pragma omp ordered depend (sink: i - 1) /* { dg-warning "'depend' clause with 'sink' modifier waiting for lexically later iteration" } */ + #pragma omp ordered depend (source) + } + #pragma omp for ordered (2) collapse (2) + for (i = 0; i < 64; i++) + for (j = 0; j < 64; j++) + { + #pragma omp ordered depend (sink: i + 1, j - 2) /* { dg-warning "'depend' clause with 'sink' modifier waiting for lexically later iteration" } */ + #pragma omp ordered depend (source) + } + #pragma omp for ordered (2) collapse (2) + for (i = 63; i >= 0; --i) + for (j = 0; j < 64; j++) + { + #pragma omp ordered depend (sink: i - 2, j - 2) /* { dg-warning "'depend' clause with 'sink' modifier waiting for lexically later iteration" } */ + #pragma omp ordered depend (source) + } + #pragma omp for ordered (2) collapse (2) + for (i = 0; i < 64; i++) + for (j = 0; j < 64; j++) + { + #pragma omp ordered depend (sink: i - 1, j + 2) + #pragma omp ordered depend (source) + } + #pragma omp for ordered (2) collapse (2) + for (i = 63; i >= 0; --i) + for (j = 0; j < 64; j++) + { + #pragma omp ordered depend (sink: i + 2, j + 2) + #pragma omp ordered depend (source) + } + #pragma omp for ordered (1) + for (i = 0; i < 64; i += 2) + { + #pragma omp ordered depend (sink: i - 1) /* { dg-warning "'depend' clause with 'sink' modifier refers to iteration never in the iteration space" } */ + #pragma omp ordered depend (source) + } +} -- 2.30.2