Remove dead code and function

Message ID 7n99ps0-1pp3-6r1o-2q2o-49p5235r79op@fhfr.qr
State Committed
Commit 4eda2eee0e1808b2b3a77afde3062e2cb9a24597
Headers
Series Remove dead code and function |

Commit Message

Richard Biener Nov. 25, 2021, 12:35 p.m. UTC
  The only use of get_alias_symbol is gated by a gcc_unreachable (),
so the following patch gets rid of it.

Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?

Thanks,
Richard.

2021-11-24  Richard Biener  <rguenther@suse.de>

	* cgraphunit.c (symbol_table::output_weakrefs): Remove
	unreachable init.
	(get_alias_symbol): Remove now unused function.
---
 gcc/cgraphunit.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
  

Comments

Jan Hubicka Nov. 25, 2021, 12:57 p.m. UTC | #1
> The only use of get_alias_symbol is gated by a gcc_unreachable (),
> so the following patch gets rid of it.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?
OK,
thanks!
Honza
  

Patch

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 1e58ffd65e8..3a803a34cbc 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2222,17 +2222,6 @@  ipa_passes (void)
 }
 
 
-/* Return string alias is alias of.  */
-
-static tree
-get_alias_symbol (tree decl)
-{
-  tree alias = lookup_attribute ("alias", DECL_ATTRIBUTES (decl));
-  return get_identifier (TREE_STRING_POINTER
-			  (TREE_VALUE (TREE_VALUE (alias))));
-}
-
-
 /* Weakrefs may be associated to external decls and thus not output
    at expansion time.  Emit all necessary aliases.  */
 
@@ -2259,10 +2248,7 @@  symbol_table::output_weakrefs (void)
 	else if (node->analyzed)
 	  target = DECL_ASSEMBLER_NAME (node->get_alias_target ()->decl);
 	else
-	  {
-	    gcc_unreachable ();
-	    target = get_alias_symbol (node->decl);
-	  }
+	  gcc_unreachable ();
         do_assemble_alias (node->decl, target);
       }
 }