]> gcc.gnu.org Git - gcc.git/commitdiff
(expand_call): If function hasn't been used before, call
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 27 Jun 1993 22:57:34 +0000 (18:57 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 27 Jun 1993 22:57:34 +0000 (18:57 -0400)
assemble_external.

From-SVN: r4773

gcc/calls.c

index 9e502aac4e0dedc51b2313db695d584763ce569a..edb0dd0a9c71b543a05f071faf41c6ac4deef028 100644 (file)
@@ -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.  */
     {
This page took 0.068945 seconds and 5 git commands to generate.