This patch reverts some changes related to "gang reduction on an orphan loop"
of commit
3a5e525489f2f808093ae1f12b5d2b406f571ec7 "Various OpenACC reduction
enhancements - FE change" similar to the mainline commit
77d24d43644909852998043335b5a0e09d1e8f02.
gcc/c/ChangeLog:
* c-typeck.cc (c_finish_omp_clauses): Remove "gang reduction on an
orphan loop" checking.
gcc/cp/ChangeLog:
* semantics.cc (finish_omp_clauses): Remove "gang reduction on an
orphan loop" checking.
gcc/fortran/ChangeLog:
* openmp.cc (oacc_is_parallel): Remove.
(resolve_oacc_loop_blocks): Remove "gang reduction on an orphan loop"
checking.
+2022-10-27 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * c-typeck.cc (c_finish_omp_clauses): Remove "gang reduction on an
+ orphan loop" checking.
+
2022-10-04 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
bool allocate_seen = false;
bool implicit_moved = false;
bool target_in_reduction_seen = false;
- bool oacc_gang_seen = false;
bitmap_obstack_initialize (NULL);
bitmap_initialize (&generic_head, &bitmap_default_obstack);
if (ort & C_ORT_ACC)
for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- switch (OMP_CLAUSE_CODE (c))
- {
- case OMP_CLAUSE_ASYNC:
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC)
+ {
oacc_async = true;
break;
- case OMP_CLAUSE_GANG:
- oacc_gang_seen = true;
- break;
- default:;
}
for (pc = &clauses, c = clauses; c ; c = *pc)
goto check_dup_generic;
case OMP_CLAUSE_REDUCTION:
- if (oacc_gang_seen && oacc_get_fn_attrib (current_function_decl))
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "gang reduction on an orphan loop");
- remove = true;
- break;
- }
if (reduction_seen == 0)
reduction_seen = OMP_CLAUSE_REDUCTION_INSCAN (c) ? -1 : 1;
else if (reduction_seen != -2
+2022-10-27 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * semantics.cc (finish_omp_clauses): Remove "gang reduction on an orphan
+ loop" checking.
+
2022-10-04 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
bool mergeable_seen = false;
bool implicit_moved = false;
bool target_in_reduction_seen = false;
- bool oacc_gang_seen = false;
bitmap_obstack_initialize (NULL);
bitmap_initialize (&generic_head, &bitmap_default_obstack);
if (ort & C_ORT_ACC)
for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- switch (OMP_CLAUSE_CODE (c))
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC)
{
- case OMP_CLAUSE_ASYNC:
oacc_async = true;
break;
- case OMP_CLAUSE_GANG:
- oacc_gang_seen = true;
- break;
- default:;
}
for (pc = &clauses, c = clauses; c ; c = *pc)
field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
goto check_dup_generic;
case OMP_CLAUSE_REDUCTION:
- if (oacc_gang_seen && oacc_get_fn_attrib (current_function_decl))
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "gang reduction on an orphan loop");
- remove = true;
- break;
- }
if (reduction_seen == 0)
reduction_seen = OMP_CLAUSE_REDUCTION_INSCAN (c) ? -1 : 1;
else if (reduction_seen != -2
+2022-10-27 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * openmp.cc (oacc_is_parallel): Remove.
+ (resolve_oacc_loop_blocks): Remove "gang reduction on an orphan loop"
+ checking.
+
2022-10-19 Tobias Burnus <tobias@codesourcery.com>
* trans-array.cc (non_negative_strides_array_p): Fix handling
}
}
-static bool
-oacc_is_parallel (gfc_code *code)
-{
- return code->op == EXEC_OACC_PARALLEL || code->op == EXEC_OACC_PARALLEL_LOOP;
-}
static gfc_statement
omp_code_to_statement (gfc_code *code)
if (!oacc_is_loop (code))
return;
- if (code->op == EXEC_OACC_LOOP
- && code->ext.omp_clauses->lists[OMP_LIST_REDUCTION]
- && code->ext.omp_clauses->gang)
- {
- fortran_omp_context *c;
- for (c = omp_current_ctx; c; c = c->previous)
- if (!oacc_is_loop (c->code))
- break;
- if (c == NULL || !oacc_is_parallel (c->code))
- gfc_error ("gang reduction on an orphan loop at %L", &code->loc);
- }
-
if (code->ext.omp_clauses->tile_list && code->ext.omp_clauses->gang
&& code->ext.omp_clauses->worker && code->ext.omp_clauses->vector)
gfc_error ("Tiled loop cannot be parallelized across gangs, workers and "