52bfbb69e7
PR middle-end/89002 * gimplify.c (gimplify_omp_for): When adding OMP_CLAUSE_*_GIMPLE_SEQ for lastprivate/linear IV, push gimplify context around gimplify_assign and, if it needed any temporaries, pop it into a gimple bind around the sequence. * testsuite/libgomp.c/pr89002.c: New test. From-SVN: r268346
44 lines
498 B
C
44 lines
498 B
C
/* PR middle-end/89002 */
|
|
|
|
extern void abort (void);
|
|
|
|
int
|
|
foo (int x)
|
|
{
|
|
int a;
|
|
int *p = &a;
|
|
|
|
#pragma omp taskloop lastprivate (a)
|
|
for (a = 0; a < x; ++a)
|
|
;
|
|
return *p;
|
|
}
|
|
|
|
int
|
|
bar (int x)
|
|
{
|
|
int a;
|
|
int *p = &a;
|
|
|
|
#pragma omp parallel
|
|
#pragma omp single
|
|
#pragma omp taskloop lastprivate (a)
|
|
for (a = 0; a < x; ++a)
|
|
;
|
|
return *p;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
#pragma omp parallel
|
|
#pragma omp single
|
|
{
|
|
if (foo (4) != 4)
|
|
abort ();
|
|
}
|
|
if (bar (6) != 6)
|
|
abort ();
|
|
return 0;
|
|
}
|