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
This commit is contained in:
parent
21a66e91d0
commit
1562e1fee7
@ -1,5 +1,9 @@
|
||||
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;
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
32
gcc/testsuite/g++.dg/gomp/pr25996.C
Normal file
32
gcc/testsuite/g++.dg/gomp/pr25996.C
Normal file
@ -0,0 +1,32 @@
|
||||
// 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" }
|
||||
}
|
32
gcc/testsuite/gcc.dg/gomp/pr25996.c
Normal file
32
gcc/testsuite/gcc.dg/gomp/pr25996.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* 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" } */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user