+2018-02-08 Martin Jambor <mjambor@suse.cz>
+
+ * hsa-gen.c (get_symbol_for_decl): Set program allocation for
+ static local variables.
+
2018-02-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/84278
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;
+2018-02-08 Martin Jambor <mjambor@suse.cz>
+
+ * testsuite/libgomp.hsa.c/staticvar.c: New test.
+
2018-02-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/libgomp.oacc-c-c++-common/pr84217.c (abort)
--- /dev/null
+extern void abort (void);
+
+#pragma omp declare target
+int
+foo (void)
+{
+ static int s;
+ return ++s;
+}
+#pragma omp end declare target
+
+int
+main ()
+{
+ int r;
+ #pragma omp target map(from:r)
+ {
+ r = foo ();
+ }
+ if (r != 1)
+ abort ();
+ return 0;
+}