Hello.

The patch has just been applied to the HSA branch.

Martin
>From 9f791cd1715b65599a4b022a56a7eac7e0816e72 Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Fri, 27 Nov 2015 09:06:58 +0100
Subject: [PATCH 3/5] HSA: fix emission of function names with user-defined
 names

gcc/ChangeLog:

2015-11-27  Martin Liska  <mli...@suse.cz>

	* hsa.c (hsa_get_declaration_name): Skip leading asterisk symbol
	is assembly name.
---
 gcc/hsa.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/hsa.c b/gcc/hsa.c
index 7c4e404..c728608 100644
--- a/gcc/hsa.c
+++ b/gcc/hsa.c
@@ -710,14 +710,20 @@ hsa_get_declaration_name (tree decl)
       free (b);
       return ggc_str;
     }
-  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));
+
+  tree name_tree;
+  if (TREE_CODE (decl) == FUNCTION_DECL
+      || (TREE_CODE (decl) == VAR_DECL && is_global_var (decl)))
+    name_tree = DECL_ASSEMBLER_NAME (decl);
   else
-    return IDENTIFIER_POINTER (DECL_NAME (decl));
+    name_tree = DECL_NAME (decl);
+
+  const char *name = IDENTIFIER_POINTER (name_tree);
+  /* User-defined assembly names have prepended asterisk symbol.  */
+  if (name[0] == '*')
+    name++;
 
-  return NULL;
+  return name;
 }
 
 void
-- 
2.6.3

Reply via email to