aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 4205fec..1b2c2cd 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3520,7 +3520,11 @@ mangle_decl (const tree decl)
if (vague_linkage_p (decl))
DECL_WEAK (alias) = 1;
if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_same_body_alias (cgraph_get_create_node (decl), alias, decl);
+ {
+ /* Don't create an alias to an unreferenced function. */
+ if (struct cgraph_node *n = cgraph_get_node (decl))
+ cgraph_same_body_alias (n, alias, decl);
+ }
else
varpool_extra_name_alias (alias, decl);
#endif