mirror of git://gcc.gnu.org/git/gcc.git
c-decl.c (c_decl_attributes): Also add "omp declare target" attribute for DECL_EXTERNAL VAR_DECLs.
* c-decl.c (c_decl_attributes): Also add "omp declare target" attribute for DECL_EXTERNAL VAR_DECLs. * decl2.c (cplus_decl_attributes): Also add "omp declare target" attribute for DECL_EXTERNAL VAR_DECLs. * testsuite/libgomp.c/target-10.c: New test. * testsuite/libgomp.c++/target-4.C: New test. From-SVN: r221520
This commit is contained in:
parent
257291fc89
commit
9b65e171ed
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-03-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* c-decl.c (c_decl_attributes): Also add "omp declare target"
|
||||||
|
attribute for DECL_EXTERNAL VAR_DECLs.
|
||||||
|
|
||||||
2015-03-11 Jakub Jelinek <jakub@redhat.com>
|
2015-03-11 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
|
* c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
|
||||||
|
|
|
||||||
|
|
@ -4407,7 +4407,8 @@ c_decl_attributes (tree *node, tree attributes, int flags)
|
||||||
{
|
{
|
||||||
/* Add implicit "omp declare target" attribute if requested. */
|
/* Add implicit "omp declare target" attribute if requested. */
|
||||||
if (current_omp_declare_target_attribute
|
if (current_omp_declare_target_attribute
|
||||||
&& ((TREE_CODE (*node) == VAR_DECL && TREE_STATIC (*node))
|
&& ((TREE_CODE (*node) == VAR_DECL
|
||||||
|
&& (TREE_STATIC (*node) || DECL_EXTERNAL (*node)))
|
||||||
|| TREE_CODE (*node) == FUNCTION_DECL))
|
|| TREE_CODE (*node) == FUNCTION_DECL))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (*node) == VAR_DECL
|
if (TREE_CODE (*node) == VAR_DECL
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-03-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* decl2.c (cplus_decl_attributes): Also add "omp declare target"
|
||||||
|
attribute for DECL_EXTERNAL VAR_DECLs.
|
||||||
|
|
||||||
2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
|
2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
PR c++/65340
|
PR c++/65340
|
||||||
|
|
|
||||||
|
|
@ -1440,7 +1440,8 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
|
||||||
|
|
||||||
/* Add implicit "omp declare target" attribute if requested. */
|
/* Add implicit "omp declare target" attribute if requested. */
|
||||||
if (scope_chain->omp_declare_target_attribute
|
if (scope_chain->omp_declare_target_attribute
|
||||||
&& ((TREE_CODE (*decl) == VAR_DECL && TREE_STATIC (*decl))
|
&& ((TREE_CODE (*decl) == VAR_DECL
|
||||||
|
&& (TREE_STATIC (*decl) || DECL_EXTERNAL (*decl)))
|
||||||
|| TREE_CODE (*decl) == FUNCTION_DECL))
|
|| TREE_CODE (*decl) == FUNCTION_DECL))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (*decl) == VAR_DECL
|
if (TREE_CODE (*decl) == VAR_DECL
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-03-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* testsuite/libgomp.c/target-10.c: New test.
|
||||||
|
* testsuite/libgomp.c++/target-4.C: New test.
|
||||||
|
|
||||||
2015-03-13 Ilya Verbin <ilya.verbin@intel.com>
|
2015-03-13 Ilya Verbin <ilya.verbin@intel.com>
|
||||||
|
|
||||||
* testsuite/libgomp.fortran/declare-target-1.f90: New test.
|
* testsuite/libgomp.fortran/declare-target-1.f90: New test.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
// { dg-do run }
|
||||||
|
|
||||||
|
#include "../libgomp.c/target-10.c"
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
/* { dg-do run } */
|
||||||
|
|
||||||
|
#pragma omp declare target
|
||||||
|
extern int v;
|
||||||
|
#pragma omp end declare target
|
||||||
|
|
||||||
|
int v;
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#pragma omp target update to(v)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue