For normal sink vectors, we just check that the token is CPP_NUMBER and with
INTEGER_CST value, while for omp_cur_iteration I was additionally requiring
integer_type_node type (so only 1, 001, 0x0001 but not 1L or 1ULL etc.).
I think we need to clarify what we actually should allow in the standard, until
then it is better to be consistent.
2022-09-06 Jakub Jelinek <jakub@redhat.com>
gcc/c/
* c-parser.cc (c_parser_omp_clause_doacross_sink): Don't verify val
in omp_cur_iteration - 1 has integer_type_node type.
gcc/cp/
* parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
in omp_cur_iteration - 1 has integer_type_node type.
gcc/testsuite/
* c-c++-common/gomp/doacross-6.c (corge): Don't expect an error here.
Add a few further tests.
(cherry picked from commit
0bd514107de7b0f643aa72554b3bdb5aeb5aa0f5)
+2022-09-06 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ * c-parser.cc (c_parser_omp_clause_doacross_sink): Don't verify val
+ in omp_cur_iteration - 1 has integer_type_node type.
+
2022-09-05 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
&& c_parser_peek_nth_token (parser, 4)->type == CPP_CLOSE_PAREN)
{
tree val = c_parser_peek_nth_token (parser, 3)->value;
- if (integer_onep (val)
- && comptypes (TREE_TYPE (val), integer_type_node))
+ if (integer_onep (val))
{
c_parser_consume_token (parser);
c_parser_consume_token (parser);
+2022-09-06 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
+ in omp_cur_iteration - 1 has integer_type_node type.
+
2022-09-05 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
&& cp_lexer_nth_token_is (parser->lexer, 4, CPP_CLOSE_PAREN))
{
tree val = cp_lexer_peek_nth_token (parser->lexer, 3)->u.value;
- if (integer_onep (val)
- && same_type_p (TREE_TYPE (val), integer_type_node))
+ if (integer_onep (val))
{
cp_lexer_consume_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
+2022-09-06 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/doacross-6.c (corge): Don't expect an error here.
+ Add a few further tests.
+
2022-07-06 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
#pragma omp for ordered
for (i = 0; i < 8; i += n)
{
- #pragma omp ordered doacross(sink:omp_cur_iteration - 1LL) /* { dg-error "'omp_cur_iteration' undeclared \\\(first use in this function\\\)" "" { target c } } */
- } /* { dg-error "'omp_cur_iteration' has not been declared" "" { target c++ } .-1 } */
+ #pragma omp ordered doacross(sink:omp_cur_iteration - 1)
+ }
+ #pragma omp for ordered
+ for (i = 0; i < 8; i += n)
+ {
+ #pragma omp ordered doacross(sink:omp_cur_iteration - 1LL)
+ }
+ #pragma omp for ordered
+ for (i = 0; i < 8; i += n)
+ {
+ #pragma omp ordered doacross(sink:omp_cur_iteration - 0x00001)
+ }
+ #pragma omp for ordered
+ for (i = 0; i < 8; i += n)
+ {
+ #pragma omp ordered doacross(sink:omp_cur_iteration - 001)
+ }
+ #pragma omp for ordered
+ for (i = 0; i < 8; i += n)
+ {
+ #pragma omp ordered doacross(sink:omp_cur_iteration - 1ULL)
+ }
}