From ef5d30c934d3648c6298f79fdb83b19b6195aa65 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 27 Jun 1993 18:57:34 -0400 Subject: [PATCH] (expand_call): If function hasn't been used before, call assemble_external. From-SVN: r4773 --- gcc/calls.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/calls.c b/gcc/calls.c index 9e502aac4e0..edb0dd0a9c7 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1476,8 +1476,18 @@ expand_call (exp, target, ignore) /* Get the function to call, in the form of RTL. */ if (fndecl) - /* Get a SYMBOL_REF rtx for the function address. */ - funexp = XEXP (DECL_RTL (fndecl), 0); + { + /* If this is the first use of the function, see if we need to + make an external definition for it. */ + if (! TREE_USED (fndecl)) + { + assemble_external (fndecl); + TREE_USED (fndecl) = 1; + } + + /* Get a SYMBOL_REF rtx for the function address. */ + funexp = XEXP (DECL_RTL (fndecl), 0); + } else /* Generate an rtx (probably a pseudo-register) for the address. */ { -- 2.30.2