diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-27 18:57:34 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-27 18:57:34 -0400 |
commit | ef5d30c934d3648c6298f79fdb83b19b6195aa65 (patch) | |
tree | 24f1449a2717d46c4b4cd6d0a0e5c473da088901 | |
parent | e44842fedef92357e088c310031cf04c519d239f (diff) | |
download | gcc-ef5d30c934d3648c6298f79fdb83b19b6195aa65.zip gcc-ef5d30c934d3648c6298f79fdb83b19b6195aa65.tar.gz gcc-ef5d30c934d3648c6298f79fdb83b19b6195aa65.tar.bz2 |
(expand_call): If function hasn't been used before, call
assemble_external.
From-SVN: r4773
-rw-r--r-- | gcc/calls.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 9e502aa..edb0dd0 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. */ { |