Force output of vars with "omp declare target" attribute in gcc/varpool.c
gcc/ * varpool.c (varpool_node::get_create): Force output of vars with "omp declare target" attribute. libgomp/ * testsuite/libgomp.c/target-9.c: New test. From-SVN: r218607
This commit is contained in:
parent
c44f74e4cb
commit
2354caecd9
|
@ -1,3 +1,8 @@
|
||||||
|
2014-12-10 Ilya Verbin <ilya.verbin@intel.com>
|
||||||
|
|
||||||
|
* varpool.c (varpool_node::get_create): Force output of vars with
|
||||||
|
"omp declare target" attribute.
|
||||||
|
|
||||||
2014-12-10 Marc Glisse <marc.glisse@inria.fr>
|
2014-12-10 Marc Glisse <marc.glisse@inria.fr>
|
||||||
|
|
||||||
* real.h (HONOR_NANS): Replace macro with 3 overloaded declarations.
|
* real.h (HONOR_NANS): Replace macro with 3 overloaded declarations.
|
||||||
|
|
|
@ -175,6 +175,7 @@ varpool_node::get_create (tree decl)
|
||||||
g->have_offload = true;
|
g->have_offload = true;
|
||||||
if (!in_lto_p)
|
if (!in_lto_p)
|
||||||
vec_safe_push (offload_vars, decl);
|
vec_safe_push (offload_vars, decl);
|
||||||
|
node->force_output = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2014-12-10 Ilya Verbin <ilya.verbin@intel.com>
|
||||||
|
|
||||||
|
* testsuite/libgomp.c/target-9.c: New test.
|
||||||
|
|
||||||
2014-12-09 Varvara Rainchik <varvara.rainchik@intel.com>
|
2014-12-09 Varvara Rainchik <varvara.rainchik@intel.com>
|
||||||
|
|
||||||
* config.h.in: Regenerate.
|
* config.h.in: Regenerate.
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/* { dg-do run } */
|
||||||
|
/* { dg-options "-O1" } */
|
||||||
|
/* { dg-additional-options "-flto" { target lto } } */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define N 123456
|
||||||
|
|
||||||
|
#pragma omp declare target
|
||||||
|
int X, Y;
|
||||||
|
#pragma omp end declare target
|
||||||
|
|
||||||
|
void
|
||||||
|
foo ()
|
||||||
|
{
|
||||||
|
#pragma omp target map(alloc: X)
|
||||||
|
X = N;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
|
foo ();
|
||||||
|
|
||||||
|
#pragma omp target map(alloc: X, Y) map(from: res)
|
||||||
|
{
|
||||||
|
Y = N;
|
||||||
|
res = X + Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res != N + N)
|
||||||
|
abort ();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue