Commit 1562e1fe by Jakub Jelinek Committed by Jakub Jelinek

re PR c/25996 ([gomp] ICE on undefined iteration variable)

	PR c/25996
	* c-parser.c (c_parser_omp_for_loop): Don't call c_finish_omp_for if
	either decl or init is error_mark_node.

	* gcc.dg/gomp/pr25996.c: New test.
	* g++.dg/gomp/pr25996.C: New test.

From-SVN: r113269
parent 21a66e91
2006-04-26 Jakub Jelinek <jakub@redhat.com>
PR c/25996
* c-parser.c (c_parser_omp_for_loop): Don't call c_finish_omp_for if
either decl or init is error_mark_node.
PR middle-end/25989
* tree-flow.h (struct omp_region): Add sched_kind.
* omp-low.c (expand_parallel_call): Use region->inner->sched_kind
......
......@@ -7379,7 +7379,7 @@ c_parser_omp_for_loop (c_parser *parser)
/* Only bother calling c_finish_omp_for if we havn't already generated
an error from the initialization parsing. */
if (decl != NULL)
if (decl != NULL && decl != error_mark_node && init != error_mark_node)
return c_finish_omp_for (loc, decl, init, cond, incr, body, NULL);
return NULL;
......
2006-04-26 Jakub Jelinek <jakub@redhat.com>
PR c/25996
* gcc.dg/gomp/pr25996.c: New test.
* g++.dg/gomp/pr25996.C: New test.
2006-04-25 Richard Sandiford <richard@codesourcery.com>
PR rtl-optimization/26725
// PR c/25996
void
test1 (void)
{
#pragma omp for
for (i = 0; i < 1; ++i); // { dg-error "not declared|expected iteration decl" }
}
void
test2 (void)
{
int i;
#pragma omp for
for (i = j; i < 1; ++i); // { dg-error "not declared|expected iteration decl" }
}
void
test3 (void)
{
int i;
#pragma omp for
for (i = 0; i < j; ++i); // { dg-error "not declared|invalid controlling predicate" }
}
void
test4 (void)
{
int i;
#pragma omp for
for (i = 0; i < 10; i += j); // { dg-error "not declared|invalid increment expression" }
}
/* PR c/25996 */
void
test1 (void)
{
#pragma omp for
for (i = 0; i < 1; ++i); /* { dg-error "undeclared|for each function" } */
}
void
test2 (void)
{
int i;
#pragma omp for
for (i = j; i < 1; ++i); /* { dg-error "undeclared" } */
}
void
test3 (void)
{
int i;
#pragma omp for
for (i = 0; i < j; ++i); /* { dg-error "undeclared|invalid controlling predicate" } */
}
void
test4 (void)
{
int i;
#pragma omp for
for (i = 0; i < 10; i += j); /* { dg-error "undeclared|invalid increment expression" } */
}
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