From ebb904cbbe15329df926b3c7da7c8098fe225fa3 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 14 Jul 1995 08:03:09 -0400 Subject: [PATCH] (current_function_stdarg): New global variable. (push_function_context_to): Save it. (pop_function_context_from): Restore it. (assign_parms): Set it. (init_function_start): Clear it. From-SVN: r10123 --- gcc/function.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/function.c b/gcc/function.c index ce2020ee3a4..a7279bec606 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -168,6 +168,11 @@ rtx current_function_arg_offset_rtx; int current_function_varargs; +/* Nonzero if current function uses stdarg.h or equivalent. + Zero for functions that use varargs.h. */ + +int current_function_stdarg; + /* Quantities of various kinds of registers used for the current function's args. */ @@ -487,6 +492,7 @@ push_function_context_to (context) p->pretend_args_size = current_function_pretend_args_size; p->arg_offset_rtx = current_function_arg_offset_rtx; p->varargs = current_function_varargs; + p->stdarg = current_function_stdarg; p->uses_const_pool = current_function_uses_const_pool; p->uses_pic_offset_table = current_function_uses_pic_offset_table; p->internal_arg_pointer = current_function_internal_arg_pointer; @@ -563,6 +569,7 @@ pop_function_context_from (context) current_function_pretend_args_size = p->pretend_args_size; current_function_arg_offset_rtx = p->arg_offset_rtx; current_function_varargs = p->varargs; + current_function_stdarg = p->stdarg; current_function_uses_const_pool = p->uses_const_pool; current_function_uses_pic_offset_table = p->uses_pic_offset_table; current_function_internal_arg_pointer = p->internal_arg_pointer; @@ -3169,6 +3176,8 @@ assign_parms (fndecl, second_time) && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node)); + current_function_stdarg = stdarg; + /* If the reg that the virtual arg pointer will be translated into is not a fixed reg or is the stack pointer, make a copy of the virtual arg pointer, and address parms via the copy. The frame pointer is @@ -4834,8 +4843,9 @@ init_function_start (subr, filename, line) /* Indicate we have no need of a frame pointer yet. */ frame_pointer_needed = 0; - /* By default assume not varargs. */ + /* By default assume not varargs or stdarg. */ current_function_varargs = 0; + current_function_stdarg = 0; } /* Indicate that the current function uses extra args -- 2.30.2