diff mbox series

[v2] Avoid unnecessarily numbered clone symbols

Message ID 74afe24e-b65e-d26d-b626-cd4231f177e0@oracle.com
State New
Headers show
Series [v2] Avoid unnecessarily numbered clone symbols | expand

Commit Message

Michael Ploujnikov Oct. 22, 2018, 1:14 a.m. UTC
Continuing from https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01258.html

Fixed up the code after the change to concat suggested by Bernhard
Reutner.

Outstanding question still remains:

To write an exact replacement for numbered_clone_function_name (apart
from the numbering) I also need to copy the double underscore
prefixing behaviour done by ASM_PN_FORMAT (right?)  which is used by
ASM_FORMAT_PRIVATE_NAME. Does that mean that I can't use my
suffixed_function_name to replace the very similar looking code in
cgraph_node::create_virtual_clone? Or is it just missing the double
underscore prefix by mistake?


- Michael
diff mbox series

Patch

From ff92d9da5c7c0af2c8be09af51a1125b5db5b92b Mon Sep 17 00:00:00 2001
From: Michael Ploujnikov <michael.ploujnikov@oracle.com>
Date: Fri, 19 Oct 2018 16:38:02 -0400
Subject: [PATCH 4/4] There can be at most one .localalias clone per symbol.

gcc:
2018-10-19  Michael Ploujnikov  <michael.ploujnikov@oracle.com>

       * symtab.c (symtab_node::noninterposable_alias): Use
         suffixed_function_name.
---
 gcc/symtab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git gcc/symtab.c gcc/symtab.c
index de4f299..bd5a0dc 100644
--- gcc/symtab.c
+++ gcc/symtab.c
@@ -1787,8 +1787,8 @@  symtab_node::noninterposable_alias (void)
   /* Otherwise create a new one.  */
   new_decl = copy_node (node->decl);
   DECL_DLLIMPORT_P (new_decl) = 0;
-  DECL_NAME (new_decl) = numbered_clone_function_name (node->decl,
-						       "localalias");
+  DECL_NAME (new_decl) = suffixed_function_name (DECL_ASSEMBLER_NAME (node->decl),
+						 "localalias");
   if (TREE_CODE (new_decl) == FUNCTION_DECL)
     DECL_STRUCT_FUNCTION (new_decl) = NULL;
   DECL_INITIAL (new_decl) = NULL;
-- 
2.7.4