+2004-10-12  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       PR c/17301
+       * c-typeck.c (convert_arguments): Return error_mark_node if there
+       are too few arguments.
+       (build_function_call): Handle error_mark_node return from
+       convert_arguments.
+
 2004-10-06  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure.ac (symbolic_link): Replace with $LN_S.
 
   coerced_params
     = convert_arguments (TYPE_ARG_TYPES (fntype), params, function, fundecl);
 
+  if (coerced_params == error_mark_node)
+    return error_mark_node;
+
   /* Check that the arguments to the function are valid.  */
 
   check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params);
 \f
 /* Convert the argument expressions in the list VALUES
    to the types in the list TYPELIST.  The result is a list of converted
-   argument expressions.
+   argument expressions, unless there are too few arguments in which
+   case it is error_mark_node.
 
    If TYPELIST is exhausted, or when an element has NULL as its type,
    perform the default conversions.
     }
 
   if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
-    error ("too few arguments to function %qE", function);
+    {
+      error ("too few arguments to function %qE", function);
+      return error_mark_node;
+    }
 
   return nreverse (result);
 }
 
--- /dev/null
+/* Invalid use of __builtin_stdarg_start should not cause an ICE.  Bug
+   17301.  Case with no arguments.  */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo (char *format, ...)
+{
+  __builtin_stdarg_start (); /* { dg-error "error: too few arguments to function '__builtin_stdarg_start'" } */
+}