(expand_builtin): Allow builtin_next_arg for varargs functions as
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 6 Apr 1994 11:48:06 +0000 (07:48 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 6 Apr 1994 11:48:06 +0000 (07:48 -0400)
well.

From-SVN: r6984

gcc/expr.c

index a825d264cace7db46da10d8399999fed7f35ce4d..6339b459941da6f53d627ccdddf4500da29db3d5 100644 (file)
@@ -6957,8 +6957,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
 #endif
       }
 
-      /* Return the address of the first anonymous stack arg.
-        This should only be used for stdarg functions.  */
+      /* Return the address of the first anonymous stack arg.  */
     case BUILT_IN_NEXT_ARG:
       {
        tree fntype = TREE_TYPE (current_function_decl);
@@ -6967,7 +6966,8 @@ expand_builtin (exp, target, subtarget, mode, ignore)
 
        if (TYPE_ARG_TYPES (fntype) == 0
            || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
-               == void_type_node))
+               == void_type_node)
+           || current_function_varargs)
          {
            error ("`va_start' used in function with fixed args");
            return const0_rtx;