aboutsummaryrefslogtreecommitdiff
path: root/gcc/hsa-gen.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2018-02-08 14:03:52 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2018-02-08 14:03:52 +0100
commitc7c30edd4a6049a0debe0ed17ffdb9c196d4c677 (patch)
tree1ddc2a0a9a52e7b9fbe52d94618bbcaeb647280b /gcc/hsa-gen.c
parent414fef4e668856edb8ca885525679c5d5e691fd1 (diff)
downloadgcc-c7c30edd4a6049a0debe0ed17ffdb9c196d4c677.zip
gcc-c7c30edd4a6049a0debe0ed17ffdb9c196d4c677.tar.gz
gcc-c7c30edd4a6049a0debe0ed17ffdb9c196d4c677.tar.bz2
[hsa] Set program allocation for static local variables
2018-02-08 Martin Jambor <mjambor@suse.cz> * hsa-gen.c (get_symbol_for_decl): Set program allocation for static local variables. libgomp/ * testsuite/libgomp.hsa.c/staticvar.c: New test. From-SVN: r257484
Diffstat (limited to 'gcc/hsa-gen.c')
-rw-r--r--gcc/hsa-gen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index af0b33d..55a46b5 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -932,9 +932,13 @@ get_symbol_for_decl (tree decl)
else if (lookup_attribute ("hsa_group_segment",
DECL_ATTRIBUTES (decl)))
segment = BRIG_SEGMENT_GROUP;
- else if (TREE_STATIC (decl)
- || lookup_attribute ("hsa_global_segment",
- DECL_ATTRIBUTES (decl)))
+ else if (TREE_STATIC (decl))
+ {
+ segment = BRIG_SEGMENT_GLOBAL;
+ allocation = BRIG_ALLOCATION_PROGRAM;
+ }
+ else if (lookup_attribute ("hsa_global_segment",
+ DECL_ATTRIBUTES (decl)))
segment = BRIG_SEGMENT_GLOBAL;
else
segment = BRIG_SEGMENT_PRIVATE;