mirror of git://gcc.gnu.org/git/gcc.git
re PR middle-end/70680 (OpenMP SIMD linear variable privatized too eagerly)
PR middle-end/70680 * gimplify.c (gimplify_omp_for): Call omp_notice_variable for implicitly linear or lastprivate iterator on the outer context. * testsuite/libgomp.c/pr70680-1.c: New test. * testsuite/libgomp.c/pr70680-2.c: New test. From-SVN: r235232
This commit is contained in:
parent
743af9719d
commit
843110834c
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-04-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/70680
|
||||||
|
* gimplify.c (gimplify_omp_for): Call omp_notice_variable for
|
||||||
|
implicitly linear or lastprivate iterator on the outer context.
|
||||||
|
|
||||||
2016-04-19 H.J. Lu <hongjiu.lu@intel.com>
|
2016-04-19 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* config/i386/i386.c (ix86_legitimate_combined_insn): Remove
|
* config/i386/i386.c (ix86_legitimate_combined_insn): Remove
|
||||||
|
|
|
||||||
|
|
@ -8785,7 +8785,10 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
|
||||||
decl, false))
|
decl, false))
|
||||||
;
|
;
|
||||||
else if (outer->region_type != ORT_COMBINED_PARALLEL)
|
else if (outer->region_type != ORT_COMBINED_PARALLEL)
|
||||||
outer = NULL;
|
{
|
||||||
|
omp_notice_variable (outer, decl, true);
|
||||||
|
outer = NULL;
|
||||||
|
}
|
||||||
if (outer)
|
if (outer)
|
||||||
{
|
{
|
||||||
n = splay_tree_lookup (outer->variables,
|
n = splay_tree_lookup (outer->variables,
|
||||||
|
|
@ -8868,7 +8871,10 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
|
||||||
decl, false))
|
decl, false))
|
||||||
;
|
;
|
||||||
else if (outer->region_type != ORT_COMBINED_PARALLEL)
|
else if (outer->region_type != ORT_COMBINED_PARALLEL)
|
||||||
outer = NULL;
|
{
|
||||||
|
omp_notice_variable (outer, decl, true);
|
||||||
|
outer = NULL;
|
||||||
|
}
|
||||||
if (outer)
|
if (outer)
|
||||||
{
|
{
|
||||||
n = splay_tree_lookup (outer->variables,
|
n = splay_tree_lookup (outer->variables,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-04-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/70680
|
||||||
|
* testsuite/libgomp.c/pr70680-1.c: New test.
|
||||||
|
* testsuite/libgomp.c/pr70680-2.c: New test.
|
||||||
|
|
||||||
2016-04-14 Cesar Philippidis <cesar@codesourcery.com>
|
2016-04-14 Cesar Philippidis <cesar@codesourcery.com>
|
||||||
|
|
||||||
* testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Don't
|
* testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Don't
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
/* PR middle-end/70680 */
|
||||||
|
|
||||||
|
int v;
|
||||||
|
|
||||||
|
void
|
||||||
|
f1 (void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
;
|
||||||
|
v = i;
|
||||||
|
}
|
||||||
|
if (i != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f2 (void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (i != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f3 (void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd linear(i: 1)
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
;
|
||||||
|
v = i;
|
||||||
|
}
|
||||||
|
if (i != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f4 (void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd linear(i: 1)
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (i != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
f1 ();
|
||||||
|
if (v++ != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
f2 ();
|
||||||
|
f3 ();
|
||||||
|
if (v++ != 100)
|
||||||
|
__builtin_abort ();
|
||||||
|
f4 ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
/* PR middle-end/70680 */
|
||||||
|
|
||||||
|
int v;
|
||||||
|
|
||||||
|
void
|
||||||
|
f1 (void)
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd collapse(2)
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
for (j = 0; j < 10; j++)
|
||||||
|
;
|
||||||
|
v = i + j;
|
||||||
|
}
|
||||||
|
if (i != 10 || j != 10)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f2 (void)
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd collapse(2)
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
for (j = 0; j < 10; j++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (i != 10 || j != 10)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f3 (void)
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd collapse(2) lastprivate (i, j)
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
for (j = 0; j < 10; j++)
|
||||||
|
;
|
||||||
|
v = i + j;
|
||||||
|
}
|
||||||
|
if (i != 10 || j != 10)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f4 (void)
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
#pragma omp task default(shared) if(0)
|
||||||
|
{
|
||||||
|
#pragma omp simd collapse(2) lastprivate (i, j)
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
for (j = 0; j < 10; j++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (i != 10 || j != 10)
|
||||||
|
__builtin_abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
f1 ();
|
||||||
|
if (v++ != 20)
|
||||||
|
__builtin_abort ();
|
||||||
|
f2 ();
|
||||||
|
f3 ();
|
||||||
|
if (v++ != 20)
|
||||||
|
__builtin_abort ();
|
||||||
|
f4 ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue