Commit Graph

63 Commits

Author SHA1 Message Date
Zack Weinberg
6c535c69ee varargs.h: Replace with stub which issues #error.
* ginclude/varargs.h: Replace with stub which issues #error.
	* ginclude/stdarg.h: __builtin_stdarg_start is renamed
	__builtin_va_start.

	* builtins.def (BUILT_IN_VARARGS_START): Delete.
	(BUILT_IN_VA_START): New.
	* builtins.c (expand_builtin_va_start): Eliminate first
	argument and code to implement pre-ISO varargs.
	(std_expand_builtin_va_start): Ignore first argument; it is
	always 1.
	(expand_builtin): Handle BUILT_IN_VA_START and
	BUILT_IN_STDARG_START identically.  Delete
	BUILT_IN_VARARGS_START case.

	* function.c (assign_parms): Delete hide_last_arg and all
	its uses.
	(mark_varargs): Delete function.
	* function.h (struct function): Delete 'varargs' bit.
	(current_function_varargs): Delete macro.
	* tree.h: Don't declare mark_varargs.

	* c-decl.c (c_function_varargs, c_mark_varargs): Delete.
	(c_expand_body): Don't call mark_varargs.
	* c-objc-common.c: Handle BUILT_IN_VA_START and
	BUILT_IN_STDARG_START identically.  Delete
	BUILT_IN_VARARGS_START case.
	* c-tree.h: Don't declare c_mark_varargs.
	* c-parse.in: Remove grammar rules for '&...' (which has been
	commented out since before 2.7.2) and for '...' in K+R
	argument declarations.

	* builtins.c, function.c, integrate.c, sibcall.c,
	config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h,
	config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c,
	config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c,
	config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h,
	config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h,
	config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c,
	config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h,
	config/stormy16/stormy16.c: Delete all references to
	current_function_varargs, and code predicated on that flag.

	* config/alpha/alpha.c (alpha_va_start),
	config/arc/arc.c (arc_va_start),
	config/i386/i386.c (ix86_va_start),
	config/mips/mips.c (mips_va_start),
	config/mn10300/mn10300.c (mn10300_va_start),
	config/rs6000/rs6000.c (rs6000_va_start),
	config/s390/s390.c (s390_va_start),
	config/sh/sh.c (sh_va_start),
	Ignore first argument; it is always 1.

	* config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start.
	* config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start.
	* config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c:
	Delete m68hc11_va_start.
	* config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h:
	No need to define EXPAND_BUILTIN_VA_START.

	* doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi,
	doc/trouble.texi: Remove references to GCC-provided <varargs.h>.

testsuite:
	* c-torture/execute/991216-3.c, c-torture/execute/strct-varg-1.c,
	c-torture/execute/va-arg-7.c, c-torture/execute/va-arg-8.c,
	c-torture/execute/va-arg-15.c, c-torture/execute/va-arg-16.c,
	c-torture/execute/va-arg-17.c, c-torture/execute/va-arg-19.c:
	Convert to use <stdarg.h>.
	* c-torture/execute/va-arg-3.c, c-torture/execute/va-arg-3.x:
	Delete.
	* gcc.dg/va-arg-2.c: New.
	* lib/gcc.exp, lib/objc.exp: Remove code to set -DNO_VARARGS.

From-SVN: r55472
2002-07-16 02:16:47 +00:00
Geoff Keating
9f720c3eba c-common.c (c_common_nodes_and_builtins): The first parameter to __builtin_va_start and __builtin_va_copy is now either a...
* c-common.c (c_common_nodes_and_builtins): The first parameter to
__builtin_va_start and __builtin_va_copy is now either a 'va_list'
or a reference to a va_list.
* builtins.c (stabilize_va_list): Simplify now we don't have to
work around C array address decay.
* c-typeck.c (convert_for_assignment): Handle assignment to
a reference parameter by taking the address of the RHS.
* ginclude/stdarg.h (va_start): Don't take address of first parameter.
(va_copy): Likewise.
(__va_copy): Likewise.
* ginclude/varargs.h (va_start): Likewise.
(__va_copy): Likewise.

From-SVN: r32821
2000-03-30 00:03:14 +00:00
Jason Merrill
512b62fb1b configure.in (i?86-*-beos{pe,elf,}*): Recognize.
* configure.in (i?86-*-beos{pe,elf,}*): Recognize.
        * i386/t-beos, i386/x-beos, i386/xm-beos.h: New files.
        * i386/beos-elf.h, i386/beos-pe.h: New files.

        * Makefile.in (CROSS_SYSTEM_HEADER_DIR): New.
        * cross-make (SYSTEM_HEADER_DIR): Define using
        CROSS_SYSTEM_HEADER_DIR.

        * gcc.c (LIBRARY_PATH_ENV): Provide default.
        (process_command): Use it.
        (main): Likewise.  Kill trailing = from env vars.
        (build_search_list): Put it back.
        * collect2.c (main): Use LIBRARY_PATH_ENV.

        * configure.in (GCC_NEED_DECLARATIONS): Add environ.
        * toplev.c: Use NEED_DECLARATION_ENVIRON.

        * tm.texi (Frame Layout): Document SMALL_STACK.
        * c-common.c (c_common_nodes_and_builtins): Check it.

        * system.h: Undef alloca after including glibc's <stdlib.h>,
        if USE_C_ALLOCA is defined.

        * gcc.c (set_input): New fn.
        (main): After all input files are compiled, reset the input file
        info to the first.

        * aclocal.m4 (rindex, index): If already defined, don't attempt
        to redefine.

        * ginclude/varargs.h: (__va_list__): Define ifndef.
        * ginclude/stdarg.h: Likewise.

        * ginclude/stddef.h (__WCHAR_TYPE__) [BEOS]: Use int
        instead of unsigned char.

        * hash.h (true, false, boolean): Undef before enum.

From-SVN: r31366
2000-01-12 19:37:06 -05:00
Zack Weinberg
fe1dbf6c7c iso646.h, [...]: Add copyright notice and special exception to GPL.
1999-09-23 10:56 -0700  Zack Weinberg  <zack@bitmover.com>

	* iso646.h, stdarg.h, stdbool.h, stddef.h, varargs.h: Add
	copyright notice and special exception to GPL.

From-SVN: r29624
1999-09-23 18:02:55 +00:00
Richard Henderson
8411a90399 stdarg.h, varargs.h: Implement in terms of builtin functions and types.
* ginclude/stdarg.h, ginclude/varargs.h: Implement in
        terms of builtin functions and types.

From-SVN: r29416
1999-09-14 16:30:44 -07:00
Richard Henderson
99a2576a3c varargs.h (__builtin_va_alist_t): New typedef.
X
        * ginclude/varargs.h (__builtin_va_alist_t): New typedef.
        (va_dcl): Use __builtin_va_alist_t.

From-SVN: r27971
1999-07-06 18:18:05 -06:00
Richard Henderson
262b846df7 varargs.h (va_dcl): Use word_mode for type of __builtin_va_list.
* ginclude/varargs.h (va_dcl): Use word_mode for type of
        __builtin_va_list.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>

From-SVN: r27911
1999-07-01 18:23:59 -06:00
David Edelsohn
fdc829c7fa David Edelsohn <edelsohn@gnu.org>
David Edelsohn  <edelsohn@gnu.org>
        * ginclude/stdarg.h (__va_rounded_size): Use long type for
        rounding on AIX.
        * ginclude/varargs.h: Likewise.

From-SVN: r26837
1999-05-07 18:52:36 -07:00
Michael Hayes
9949a9f27a varargs.h: Add support for C4x target.
* ginclude/varargs.h: Add support for C4x target.
        * ginclude/stdargs.h: Likewise.

From-SVN: r22483
1998-09-19 15:27:09 -06:00
Jeffrey A Law
e9818f3c28 stdarg.h: Undo BeOS changes, they break hpux.
* ginclude/stdarg.h: Undo BeOS changes, they break hpux.
        * ginclude/varargs.h: Likewise.

From-SVN: r17116
1997-12-16 13:00:15 -07:00
Fred Fish
c55dcc7ddd cvs commit ChangeLog config.sub configure configure.in toplev.c
From-SVN: r17060
1997-12-11 23:36:11 -07:00
Jeff Law
e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Jeff Law
66ed068304 Add port done awhile ago for the ARC cpu.
* arc/arc.h: New file.
        * arc/arc.c: New file.
        * arc/arc.md: New file.
        * arc/initfini.c: New file.
        * arc/lib1funcs.asm: New file.
        * arc/t-arc: New file.
        * arc/xm-arc.h: New file.
        * ginclude/va-arc.h: New file.
        * ginclude/stdarg.h: Include va-arc.h ifdef __arc__.
        * ginclude/varargs.h: Likewise.
        * Makefile.in (USER_H): Add va-arc.h.
        * configure.in (arc-*-elf*): Recognize.
        * longlong.h: Add ARC support.
Mostly so I can test changes in snapshot scripts.

        * expr.c (clear_storage): Use CONST0_RTX instead of const0_rtx.
        when clearing non-BLKmode data.
Fixes sparc problem.

From-SVN: r15198
1997-09-09 16:21:04 -06:00
Jeffrey A Law
f84271d99d v850: New directory for v850 port.
* v850: New directory for v850 port.
        * v850/lib1funcs.asm: New file.
        * t-v850, v850.c, v850.h, v850.md, xm-v850.h: New files.
        * ginclude/va-v850.h: New file.
        * varargs.h, stdarg.h: Include va-mn10200.h.
        * configure.in (mn10200-*-*): New target.
        * Makefile.in (USER_H): Add va-mn10200.h.

From-SVN: r15104
1997-09-05 11:43:51 -06:00
Jeff Law
51593cc576 * varargs.h, stdarg.h: Include va-mn10200.h.
From-SVN: r14290
1997-06-23 11:30:34 -06:00
Richard Kenner
1997cb46f7 Protect va_list definition from SCO headers.
From-SVN: r14286
1997-06-22 06:29:26 -04:00
Doug Evans
90e6057ba5 Add m32r support.
From-SVN: r13844
1997-04-07 22:31:52 +00:00
Jeff Law
22ef4e9b59 stdarg.h: Include va-mn10300.h.
* ginclude/stdarg.h: Include va-mn10300.h.
        * ginclude/varargs.h: Likewise.
        * ginclude/va-mn10300.h: New file.
        * mn10300/mn10300.c (expand_prologue): If current_function_varargs is
        nonzero, then flush d0/d1 back into the stack.
        (mn10300_builtin_saveregs): New function.
        (function_arg, function_arg_partial_nregs): New functions.
        (initial_offset): Tweak now that the RP save area is allocated
        and deallocated around each call again.
        * mn10300/mn10300.h (FIRST_PARM_OFFSET): Now 4.
        (FRAME_POINTER_REQUIRED): Require a frame pointer for all non-leaf
        functions.
        (REG_PARM_STACK_SPACE): Now 8 bytes.
        (FUNCTION_ARG_REGNO_P): Update for new parameter passing conventions.
        (CUMULATIVE_ARGS, INIT_CUMULATIVE_ARGS): Likewise.
        (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Likewise.
        (FUNCTION_ARG_PARTIAL_NREGS): Likewise.
        (TRAMPOLINE_TEMPLATE): Don't clobber d0 anymore.
        (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes.
        (EXPAND_BUILTIN_SAVEREGS): Define.
        * mn10300/mn10300.md (call, call_value patterns): Allocate and
        deallocate a stack slot for the return pointer around each call.

        * mn10300/mn10300.h (RTX_COSTS): Refine.
        (CASE_VALUES_THRESHHOLD, NO_FUNCTION_CSE): Likewise.
        * mn10300/mn10300.c (output_tst): New function.
        * mn10300/mn10300.md (movdi, movdf): Improve code to load constants
        into registers.
        (tst insns): Use output_tst to optimize some cases.  Add versions to
        encourage more zero extensions instead of sign extensions of HImode
        and QImode values.
        (divsi3, udivsi3): Remove patterns.  Replaced by...
        (divmodsi4, udivmodsi4): New expanders/patterns.
        (andsi3): Optimize "and" operations with certain constants.

From-SVN: r13827
1997-04-01 18:33:45 -07:00
Richard Kenner
a52a564cd7 Add definition of __va_copy.
From-SVN: r13685
1997-03-02 17:41:16 -05:00
Jeff Law
d2c4d860c6 mn10300.c: New file for Matsushita MN10300 port.
* mn10300/mn10300.c: New file for Matsushita MN10300 port.
        * mn10300/{mn10300.h,mn10300.md,t-mn10300,xm-mn10300.h}: Likewise.
        * config.sub: Recognize mn10300 as a basic machine type.
        * configure: Similarly.
        * ginclude/stdarg.h: mn10300 is little endian.
        * ginclude/varargs.h: Likewise.

From-SVN: r13281
1996-12-11 14:28:52 -07:00
Doug Evans
d884dca33e Use #include "", not #include <>.
From-SVN: r12893
1996-10-03 22:31:13 +00:00
Doug Evans
1143a698bd stdarg.h: Change __WIN32__ to _WIN32.
* ginclude/stdarg.h: Change __WIN32__ to _WIN32.
	* ginclude/varargs.h: Likewise.
	* ginclude/va-ppc.h: Likewise.

From-SVN: r12651
1996-08-18 01:31:48 +00:00
Michael Meissner
06737be4a3 Fix varargs/stdarg on PowerPC Windows NT
From-SVN: r12637
1996-08-14 15:49:57 +00:00
Jeff Law
8343b898b9 stdarg.h: Handle the H8/S.
* ginclude/stdarg.h: Handle the H8/S.
        * ginclude/varargs.h: Likewise.

From-SVN: r12409
1996-07-08 14:29:33 -06:00
Jim Wilson
385512eb87 Use va-sh.h.
From-SVN: r11485
1996-03-06 16:59:13 -08:00
Richard Kenner
d33fc50c39 Add test for SCO Open Server 5.
From-SVN: r11012
1996-01-15 20:59:42 -05:00
Richard Kenner
0c125e9152 Add ppc svr4 calling sequence support.
From-SVN: r10213
1995-08-13 18:19:33 -04:00
Richard Kenner
92c874f7d7 (va_arg): Don't assume __va_rounded_size (char) has the value of 4.
From-SVN: r9550
1995-04-30 08:11:09 -04:00
Richard Kenner
0f2101cc28 Clean up code that defines *DEFINED* symbols.
From-SVN: r9376
1995-04-13 08:50:20 -04:00
Jim Wilson
ed73e9f119 (va_end): Expand to a void expression instead of nothing.
From-SVN: r9074
1995-02-24 18:35:35 -08:00
Richard Kenner
c4f0e4979f Test _VA_LIST_DEFINED macro.
From-SVN: r9014
1995-02-21 18:53:15 -05:00
Jim Wilson
971ba70d62 Delete include of <varargs.h> when not gcc.
From-SVN: r7692
1994-07-08 19:06:27 -07:00
Richard Kenner
6c68c4abdd Recognize __FreeBSD__.
From-SVN: r7153
1994-04-25 14:22:17 -04:00
Richard Kenner
e9de0fec0f Round to multiple of sizeof(short) on sysV68.
From-SVN: r6972
1994-04-06 06:51:28 -04:00
Richard Stallman
116c9aab44 Test __bsdi__ like __BSD_NET2__.
From-SVN: r6093
1993-11-15 02:08:56 +00:00
Richard Stallman
237157dc44 [__i860__]: Add to little-endian conditional.
From-SVN: r5906
1993-10-26 23:29:24 +00:00
Richard Stallman
c8cdb42bc6 Test __sequent__ like __BSD_NET2__.
From-SVN: r5556
1993-10-02 02:11:53 +00:00
Doug Evans
0b2c164809 add h8/300h support
From-SVN: r5215
1993-08-26 21:57:10 +00:00
Richard Stallman
51eeee3ed1 [__svr4__ __i860__]: Define _VA_LIST only if not defined already.
From-SVN: r4486
1993-05-17 17:56:32 +00:00
Richard Stallman
9dace10d1b [__svr4__ __i860__] (_VA_LIST): Do define.
From-SVN: r4479
1993-05-16 04:30:47 +00:00
Richard Stallman
32e69e1dc8 [__svr4__]: Test only _VA_LIST_ to avoid dup typedef.
(This used to test __SVR4_2__.)

From-SVN: r3998
1993-04-04 07:16:41 +00:00
Richard Stallman
ade97c34b3 (memory.h): Use proper ANSI syntax in `#endif __memory_h__'.
From-SVN: r3870
1993-03-24 22:42:07 +00:00
Richard Stallman
61a2ac12b3 (_VA_LIST_T_H): Test and define this.
From-SVN: r3547
1993-02-27 00:47:05 +00:00
Richard Stallman
5153d9d693 (va_arg): Copy both definitions from gstdarg.h.
From-SVN: r2821
1992-11-30 23:07:11 +00:00
Richard Stallman
5ce402b71d Don't test, define or undef _VA_LIST_ on NET 2 systems. Don't include ansi.h.
From-SVN: r2736
1992-11-10 15:27:21 +00:00
Richard Stallman
563701f9dc [4.3 net 2]: If _VA_LIST_, is undefined then va_list is already declared.
From-SVN: r2671
1992-10-31 21:41:35 +00:00
Richard Stallman
4c3a130a92 On Net 2 system, don't test, define or undef _VA_LIST_.
Use _ANSI_H_, __BSD_NET2__ and ____386BSD____ to test for this.

From-SVN: r2657
1992-10-30 09:21:34 +00:00
Richard Stallman
b394f6313d Treat _AIX and _M_UNIX like __svr4__.
From-SVN: r2598
1992-10-25 04:38:49 +00:00
Richard Stallman
eae92d827e (va_list) [__SVR4_2__]: Don't set or test _VA_LIST.
From-SVN: r2500
1992-10-17 07:39:31 +00:00
Richard Stallman
7dea1d59ea [__NeXT__]: Define _VA_LIST_ if _ANSI_STDARG_H_ was
defined; then define _ANSI_STDARG_H_.

From-SVN: r2470
1992-10-15 08:08:16 +00:00