+2021-08-19 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * c-typeck.cc (handle_omp_array_sections_1): Robustify non-contiguous
+ array check and reject non-DECL base-pointer cases as unsupported.
+
2021-02-02 Chung-Lin Tang <cltang@codesourcery.com>
* c-parser.cc (c_parser_declaration_or_fndef): Set
if (d_length == NULL_TREE || !integer_onep (d_length))
{
if (ort == C_ORT_ACC)
- non_contiguous = true;
- else
{
+ while (TREE_CODE (d) == TREE_LIST)
+ d = TREE_CHAIN (d);
+ if (DECL_P (d))
+ {
+ /* Note that OpenACC does accept these kinds of
+ non-contiguous pointer based arrays. */
+ non_contiguous = true;
+ break;
+ }
error_at (OMP_CLAUSE_LOCATION (c),
- "array section is not contiguous in %qs clause",
+ "base-pointer expression in %qs clause not "
+ "supported for non-contiguous arrays",
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
return error_mark_node;
}
+
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "array section is not contiguous in %qs clause",
+ omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
+ return error_mark_node;
}
}
}
+2021-08-19 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * semantics.cc (handle_omp_array_sections_1): Robustify non-contiguous
+ array check and reject non-DECL base-pointer cases as unsupported.
+
2021-03-03 Chung-Lin Tang <cltang@codesourcery.com>
* decl2.cc (cp_omp_mappable_type_1): Allow fields with
return error_mark_node;
}
/* If there is a pointer type anywhere but in the very first
- array-section-subscript, the array section could be non-contiguous.
- Note that OpenACC does accept these kinds of non-contiguous pointer
- based arrays. */
+ array-section-subscript, the array section could be non-contiguous. */
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_AFFINITY
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND
&& TREE_CODE (TREE_CHAIN (t)) == TREE_LIST)
if (d_length == NULL_TREE || !integer_onep (d_length))
{
if (ort == C_ORT_ACC)
- non_contiguous = true;
- else
{
+ while (TREE_CODE (d) == TREE_LIST)
+ d = TREE_CHAIN (d);
+ if (DECL_P (d))
+ {
+ /* Note that OpenACC does accept these kinds of
+ non-contiguous pointer based arrays. */
+ non_contiguous = true;
+ break;
+ }
error_at (OMP_CLAUSE_LOCATION (c),
- "array section is not contiguous in %qs clause",
+ "base-pointer expression in %qs clause not "
+ "supported for non-contiguous arrays",
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
return error_mark_node;
}
+
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "array section is not contiguous in %qs clause",
+ omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
+ return error_mark_node;
}
}
}