Commit 0bb99c11 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/67501 (Bad error recovery for invalid OpenMP clauses in C FE)

	PR c/67501
	* c-parser.c (c_parser_oacc_all_clauses,
	c_parser_omp_all_clauses): Remove invalid clause from
	list of clauses even if parser->error is set.

	* c-c++-common/gomp/pr67501.c: New test.

From-SVN: r227578
parent fce5e5e3
2015-09-09 Jakub Jelinek <jakub@redhat.com> 2015-09-09 Jakub Jelinek <jakub@redhat.com>
PR c/67501
* c-parser.c (c_parser_oacc_all_clauses,
c_parser_omp_all_clauses): Remove invalid clause from
list of clauses even if parser->error is set.
PR c/67500 PR c/67500
* c-parser.c (c_parser_omp_clause_aligned, * c-parser.c (c_parser_omp_clause_aligned,
c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
......
...@@ -11752,7 +11752,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, ...@@ -11752,7 +11752,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
first = false; first = false;
if (((mask >> c_kind) & 1) == 0 && !parser->error) if (((mask >> c_kind) & 1) == 0)
{ {
/* Remove the invalid clause(s) from the list to avoid /* Remove the invalid clause(s) from the list to avoid
confusing the rest of the compiler. */ confusing the rest of the compiler. */
...@@ -11981,7 +11981,7 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask, ...@@ -11981,7 +11981,7 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask,
first = false; first = false;
if (((mask >> c_kind) & 1) == 0 && !parser->error) if (((mask >> c_kind) & 1) == 0)
{ {
/* Remove the invalid clause(s) from the list to avoid /* Remove the invalid clause(s) from the list to avoid
confusing the rest of the compiler. */ confusing the rest of the compiler. */
......
2015-09-09 Jakub Jelinek <jakub@redhat.com> 2015-09-09 Jakub Jelinek <jakub@redhat.com>
PR c/67501
* c-c++-common/gomp/pr67501.c: New test.
PR c/67500 PR c/67500
* gcc.dg/gomp/pr67500.c: New test. * gcc.dg/gomp/pr67500.c: New test.
......
/* PR c/67501 */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
void
foo (void)
{
int i, j;
#pragma omp for simd copyprivate(j /* { dg-error "before end of line" } */
for (i = 0; i < 16; ++i) /* { dg-error "is not valid for" "" { target *-*-* } 9 } */
;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment