+2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * c-typeck.cc (handle_omp_array_sections): Add extra argument. Set
+ argument to true if array section has a stride that is not one.
+ (c_finish_omp_clauses): Disable strided updates when iterators are
+ used in the clause. Emit sorry if strided.
+
2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
* c-parser.cc (c_parser_omp_clause_from_to): Parse 'iterator' modifier.
static bool
handle_omp_array_sections (tree *pc, tree **pnext, enum c_omp_region_type ort,
- int *discontiguous)
+ int *discontiguous, bool *strided = NULL)
{
tree c = *pc;
bool maybe_zero_len = false;
if (stride == NULL_TREE)
stride = size_one_node;
+ if (strided && !integer_onep (stride))
+ *strided = true;
if (discontiguous && *discontiguous)
{
/* This condition is similar to the error check below, but
grp_sentinel = OMP_CLAUSE_CHAIN (c);
tree *pnext = NULL;
+ /* FIXME: Strided target updates not supported together with
+ iterators yet. */
int discontiguous
= (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO
- || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM);
- if (handle_omp_array_sections (pc, &pnext, ort, &discontiguous))
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM)
+ && !OMP_CLAUSE_ITERATORS (c);
+ bool strided = false;
+ if (handle_omp_array_sections (pc, &pnext, ort, &discontiguous,
+ &strided))
remove = true;
else
{
+ if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM)
+ && OMP_CLAUSE_ITERATORS (c) && strided)
+ sorry ("strided target updates with iterators");
c = *pc;
t = OMP_CLAUSE_DECL (c);
if (!omp_mappable_type (TREE_TYPE (t)))
+2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * semantics.cc (handle_omp_array_sections): Add extra argument. Set
+ argument to true if array section has a stride that is not one.
+ (finish_omp_clauses): Disable strided updates when iterators are
+ used in the clause. Emit sorry if strided.
+
2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
* parser.cc (cp_parser_omp_clause_from_to): Parse 'iterator' modifier.
static bool
handle_omp_array_sections (tree *pc, tree **pnext, enum c_omp_region_type ort,
- int *discontiguous)
+ int *discontiguous, bool *strided = NULL)
{
tree c = *pc;
bool maybe_zero_len = false;
if (stride == NULL_TREE)
stride = size_one_node;
+ if (strided && !integer_onep (stride))
+ *strided = true;
if (discontiguous && *discontiguous)
{
/* This condition is similar to the error check below, but
{
grp_start_p = pc;
grp_sentinel = OMP_CLAUSE_CHAIN (c);
-
+ /* FIXME: Strided target updates not supported together with
+ iterators yet. */
int discontiguous
= (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO
- || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM);
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM)
+ && !OMP_CLAUSE_ITERATORS (c);
+ bool strided = false;
tree *pnext = NULL;
- if (handle_omp_array_sections (pc, &pnext, ort, &discontiguous))
+ if (handle_omp_array_sections (pc, &pnext, ort, &discontiguous,
+ &strided))
remove = true;
else
{
+ if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM)
+ && OMP_CLAUSE_ITERATORS (c) && strided)
+ sorry ("strided target updates with iterators");
/* We might have replaced the clause, so refresh C. */
c = *pc;
t = OMP_CLAUSE_DECL (c);
+2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses): Disable strided updates
+ when iterators are used in the clause.
+
2025-04-17 Kwok Cheung Yeung <kcyeung@baylibre.com>
* dump-parse-tree.cc (show_omp_namelist): Add iterator support for
if (ref->type == REF_COMPONENT || ref->type == REF_ARRAY)
lastref = ref;
+ /* FIXME: Currently no support for strided target updates with
+ iterators. */
if ((list == OMP_LIST_TO || list == OMP_LIST_FROM)
+ && !iterator
&& (!n->expr || (lastref && lastref->type == REF_ARRAY))
&& !gfc_omp_contiguous_update_p (n))
{