From c7c30edd4a6049a0debe0ed17ffdb9c196d4c677 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 8 Feb 2018 14:03:52 +0100 Subject: [hsa] Set program allocation for static local variables 2018-02-08 Martin Jambor * 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 --- gcc/hsa-gen.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/hsa-gen.c') 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; -- cgit v1.1