builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy to strcpy.
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 8 Jul 2004 17:16:24 +0000 (17:16 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 8 Jul 2004 17:16:24 +0000 (17:16 +0000)
* builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy
to strcpy.

From-SVN: r84301

gcc/ChangeLog
gcc/builtins.c

index e2cdc6693e1d944795e5471fe124286debf79f1a..1456ae97488e68308418cc5cb75baf463b3606fc 100644 (file)
@@ -1,5 +1,8 @@
 2004-07-08  Alexandre Oliva  <aoliva@redhat.com>
 
+       * builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy
+       to strcpy.
+
        * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Default to 0.
        (FUNCTION_ARG_PASS_BY_REFERENCE): Likewise.
        (FUNCTION_ARG_CALLEE_COPIES): Likewise.
index 72cf798a021dddb59270273dc96cfe8bd004f2b2..9bcef91a70b36d4dbebc2e010c8c1bed12e9f45c 100644 (file)
@@ -3090,7 +3090,14 @@ expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode)
 {
   /* If return value is ignored, transform stpcpy into strcpy.  */
   if (target == const0_rtx)
-    return expand_builtin_strcpy (arglist, target, mode);
+    {
+      tree fn = implicit_built_in_decls[BUILT_IN_STRCPY];
+      if (!fn)
+       return 0;
+
+      return expand_expr (build_function_call_expr (fn, arglist),
+                         target, mode, EXPAND_NORMAL);
+    }
 
   if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
     return 0;