re PR c++/92084 (ICE: tree check: expected tree that contains 'decl minimal' structur...
authorJakub Jelinek <jakub@redhat.com>
Mon, 14 Oct 2019 08:28:05 +0000 (10:28 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 14 Oct 2019 08:28:05 +0000 (10:28 +0200)
PR c++/92084
* semantics.c (handle_omp_array_sections_1): Temporarily disable
-fstrong-eval-order also for in_reduction and task_reduction clauses.

* g++.dg/gomp/pr92084.C: New test.

From-SVN: r276954

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr92084.C [new file with mode: 0644]

index af084974cf8fbabf88bc015ac5c6a5f350bfbc88..187935d5e7e043b5862c37ea3ace324bc34c0ce0 100644 (file)
@@ -1,5 +1,9 @@
 2019-10-14  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/92084
+       * semantics.c (handle_omp_array_sections_1): Temporarily disable
+       -fstrong-eval-order also for in_reduction and task_reduction clauses.
+
        * parser.c (cp_parser_omp_all_clauses): Change bool NESTED_P argument
        into int NESTED, if it is 2, diagnose missing commas in between
        clauses.
index f93bb934850c99ce65f3a7d53cdc8d179ed90220..59def3170ab11d46a565ba1e6e7d5ccf0c498e6c 100644 (file)
@@ -5068,7 +5068,9 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
      saying how many times the side-effects are evaluated is unspecified,
      makes int *a, *b; ... reduction(+:a[a = b, 3:10]) really unspecified.  */
   warning_sentinel s (flag_strong_eval_order,
-                     OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION);
+                     OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
+                     || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_IN_REDUCTION
+                     || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TASK_REDUCTION);
   ret = grok_array_decl (OMP_CLAUSE_LOCATION (c), ret, low_bound, false);
   return ret;
 }
index 7385c3345055311ac9806215cddc830945b1c0a1..093bd174d2b973e71fadc5821607e27d8502f23e 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/92084
+       * g++.dg/gomp/pr92084.C: New test.
+
 2019-10-14  Richard Sandiford  <richard.sandiford@arm.com>
 
        * gcc.dg/diag-aka-5.h: New test.
diff --git a/gcc/testsuite/g++.dg/gomp/pr92084.C b/gcc/testsuite/g++.dg/gomp/pr92084.C
new file mode 100644 (file)
index 0000000..da3079b
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/92084
+
+void bar (int *, int);
+int baz (int);
+
+void
+foo (int *x, int y)
+{
+#pragma omp taskgroup task_reduction (*: x[baz (y)])
+  bar (x, baz (y));
+}