Hi, the patch below makes libgomp/testsuite/libgomp.c/target-28.c pass on HSA, where it previously did not like the two static variables with the same name. Committed to the branch.
Thanks, Martin 2015-11-25 Martin Jambor <mjam...@suse.cz> * hsa.c (hsa_get_declaration_name): Return ASM name for global variables. --- gcc/hsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/hsa.c b/gcc/hsa.c index 7c9e0f6..8ab5da7 100644 --- a/gcc/hsa.c +++ b/gcc/hsa.c @@ -700,6 +700,8 @@ hsa_get_declaration_name (tree decl) } else if (TREE_CODE (decl) == FUNCTION_DECL) return cgraph_node::get_create (decl)->asm_name (); + else if (TREE_CODE (decl) == VAR_DECL && is_global_var (decl)) + return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); else return IDENTIFIER_POINTER (DECL_NAME (decl)); -- 2.6.0