Commit Graph

306 Commits

Author SHA1 Message Date
Geoffrey Keating 1617e5eedc Index: gcc/ChangeLog
2007-07-12  Geoffrey Keating  <geoffk@apple.com>

	* ginclude/tgmath.h: New.
	* config.gcc: Use GCC's tgmath.h on non-glibc systems.
	* doc/sourcebuild.texi (Headers): Document use_gcc_tgmath.
	* configure.ac (STMP_FIXPROTO): Honor use_gcc_tgmath.
	* configure: Regenerate.

Index: gcc/testsuite/ChangeLog
2007-07-11  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/c99-tgmath-1.c: New.
	* gcc.dg/c99-tgmath-2.c: New.
	* gcc.dg/c99-tgmath-3.c: New.
	* gcc.dg/c99-tgmath-4.c: New.

From-SVN: r126613
2007-07-13 06:12:51 +00:00
Janis Johnson 93167356eb float.h: Check that __STDC_WANT_DEC_FP__ is defined, not that it is 1.
* ginclude/float.h: Check that __STDC_WANT_DEC_FP__ is defined,
	not that it is 1.

From-SVN: r123974
2007-04-19 16:58:42 +00:00
Janis Johnson b7f0fff23b Makefile.in (USER_H): Remove decfloat.h.
gcc/
	* Makefile.in (USER_H): Remove decfloat.h.
	* ginclude/decfloat.h: Delete, moving contents to ...
	* ginclude/float.h: Add support for decimal floating point,
	guarded by __STDC_WANT_DEC_FP__.

gcc/testsuite/
	* gcc.dg/dfp/dec-eval-method.c: Replace decfloat.h with float.h.
	* gcc.dg/dfp/decfloat-constants.c: Ditto.
	* gcc.dg/dfp/convert-dfp.c: Ditto.
	* gcc.dg/dfp/convert-int-saturate.c: Ditto.

From-SVN: r121308
2007-01-29 20:27:41 +00:00
Janis Johnson 6750b31e4a decfloat.h (DEC*_DEN): Define using the correct builtins.
gcc:
	* ginclude/decfloat.h (DEC*_DEN): Define using the correct builtins.

testsuite:
	* gcc.dg/dfp/decfloat-constants.c: Remove 'dg-do compile', fix typo.

From-SVN: r117115
2006-09-21 17:34:47 +00:00
Jon Grimm 9a8ce21f3b target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New.
2005-12-16  Jon Grimm  <jgrimm2@us.ibm.com>
	    Janis Johnson  <janis187@us.ibm.com>
	    Ben Elliston  <bje@au.ibm.com>

	* target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New.
	(TARGET_INITIALIZER): Add TARGET_DECIMAL_FLOAT_P.
	* target.h (struct gcc_target): Add decimal_float_supported_p.
	* targhooks.c (default_scalar_mode_supported_p): Handle
	MODE_DECIMAL_FLOAT.
	* builtins.def: Add new builtins for 32, 64 and 128 bit variants
	of inf, nan, finite, isinf and isnan.
	* builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128,
	BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR,
	BT_FN_DFLOAT32, BT_FN_DFLOAT64, BT_FN_DFLOAT128,
	BT_FN_INT_DFLOAT32, BT_FN_INT_DFLOAT64, BT_FN_INT_DFLOAT128,
	BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT64_CONST_STRING,
	BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT32_DFLOAT32,
	BT_FN_DFLOAT64_DFLOAT64, BT_FN_DFLOAT128_DFLOAT128): New.
	* c-decl.c (declspecs_add_type): Verify combos on type qualifiers.
	Pedwarn if decimal floating point types are used.  Error if
	decimal floating point is not supported by the target.
	(finish_declspecs): Return type from DFP typespec_word.
	* c-typeck.c (c_common_type): Choose the decimal floating point
	type with the greater precision when determining a common type.
	(convert_arguments): Warn if there is a mismatch between argument
	and prototype for decimal float types.  Warn of conversions with
	binary float types and of precision narrowing due to prototype.
	* c-parser.c (reswords): Add _Decimal32, _Decimal64, _Decimal128.
	(c_token_starts_typename): Handle RID_DFLOAT32/64/128.
	(c_token_starts_declspecs): Likewise.
	(c_parser_attributes): Likewise.
	* c-common.h (enum rid): Add new enumeration values RID_DFLOAT32,
	RID_DFLOAT64, RID_DFLOAT128.
	(T_D32, TEX_D32, T_D64, TEX_D64, T_D128, TEX_D128): New macros.
	* c-common.c (c_common_type_for_mode): Handle decimal float modes.
	(shorten_compare): Convert DFP/BFP operands to a common type.
	(c_common_modes_and_builtins): Register built-in decimal float
	types if the target supports them.
	(handle_mode_addtribute): Handle MODE_DECIMAL_FLOAT.
	* builtins.c (fold_builtin_1): Handle 32, 64 and 128 bit cases of
	inf, nan, finite, isinf and isnan builtins.
	* c-cppbuiltin.c (builtin_define_decimal_float_constants): New.
	(builtin_define_float_constants): Assert non-decimal radix.
	(c_cpp_builtins): Register built-in __DEC_EVAL_METHOD__ define.
	Call builtin_define_decimal_float_constants for each type.
	* c-lex.c (interpret_float): Decode decimal float types from CPP_N
	flags.  Use real_from_string3, which can handle binary or decimal
	floats.
	* c-tree.h (enum c_typespec_keyword): Add cts_dfloat32,
	cts_dfloat64, cts_dfloat128.
	* tree.c (build_common_tree_nodes_2): Add decimal float types.
	* tree.h (enum tree_index): Add new enumeration values
	TI_DFLOAT32_TYPE, TI_DFLOAT64_TYPE, TI_DFLOAT128_TYPE,
	TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE, TI_DFLOAT128_PTR_TYPE.
	(dfloat32_type_node): New macro.
	(dfloat64_type_node, dfloat128_type_node): Likewise.
	(dfloat32_ptr_type_node, dfloat64_ptr_type_node): Likewise.
	(dfloat128_ptr_type_node): Likewise.
	* c-pretty-print.c (pp_c_floating_constant): Append 32, 64 and 128
	bit decimal floating point types with "df", "dd" and "dl".
	* c-format.h (enum format_lengths): Add new enumeration values
	FMT_LEN_H, FMT_LEN_D and FMT_LEN_DD.
	* c-format.c (printf_length_specs, scanf_length_specs): Add
	entries for H, D, DD.
	(print_char_table, scan_char_table): Use new entries.
	(asm_fprintf_char_table, gcc_diag_char_table,
	gcc_cdiag_char_table, gcc_cxxdiag_char_table): Adjust for longer
	length arrays.
	* defaults.h (DECIMAL32_TYPE_SIZE): Define.
	(DECIMAL64_TYPE_SIZE): Likewise.
	(DECIMAL128_TYPE_SIZE): Likewise.
	(TARGET_DEC_EVAL_METHOD): Likewise.
	* doc/extend.texi (Decimal Float): New node.
	(Constructing Calls): Document decimal float built-ins.
	* doc/tm.texi: Document TARGET_DECIMAL_FLOAT_SUPPORTED_P hook.
	* Makefile.in (USER_H): Add $(srcdir)/ginclude/decfloat.h.
	* ginclude/decfloat.h: New file.

Co-Authored-By: Ben Elliston <bje@au.ibm.com>
Co-Authored-By: Janis Johnson <janis187@us.ibm.com>

From-SVN: r108629
2005-12-16 17:38:26 +11:00
R. Kelley Cook 6c912b0cb6 Update FSF address.
From-SVN: r101313
2005-06-25 01:11:52 +00:00
Kazu Hirata d3471d77af * ginclude/stddef.h: Fix a comment typo.
From-SVN: r88445
2004-10-03 13:25:05 +00:00
Richard Henderson 7a3ea2011b c-parse.in (OFFSETOF, [...]): New.
* c-parse.in (OFFSETOF, offsetof_member_designator): New.
        (primary): Handle offsetof.  Add error productions for faux functions.
        Move component_ref objc checking to build_component_ref.
        (reswords): Add offsetof.
        (rid_to_yy): Add offsetof.
        * c-tree.h (build_offsetof): Declare.
        * c-common.h (objc_is_public): Declare.
        * c-typeck.c (build_component_ref): Check objc_is_public.
        (build_offsetof): New.
        * stub-objc.c (objc_is_public): New.
        * objc/objc-act.c, objc/objc-act.h (objc_is_public): Rename
        from is_public.
        * ginclude/stddef.h (offsetof): Use __builtin_offsetof.
        * doc/extend.texi (Offsetof): Move from C++ section to C section
        and rewrite for __builtin_offsetof.
cp/
        * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
        * parser.c (struct cp_parser): Remove in_offsetof.
        (cp_parser_new): Don't set it.
        (cp_parser_unary_expression): Don't check it.
        (cp_parser_postfix_open_square_expression): Split out from ...
        (cp_parser_postfix_expression): ... here.
        (cp_parser_postfix_dot_deref_expression): Likewise.
        (cp_parser_builtin_offsetof): New.
        (cp_parser_primary_expression): Use it.
testsuite/
        * g++.dg/template/dependent-expr4.C: Use __builtin_offsetof.

From-SVN: r82549
2004-06-01 08:12:23 -07:00
Mark Mitchell 263ee05239 re PR c++/13275 (Implementation of offsetof macro)
PR c++/13275
	* c-common.h (enum rid): Add RID_OFFSETOF.
	* c-parser.in (rid_to_yy): Ignore RID_OFFSETOF.
	* ginclude/stddef.h (offsetof): Reimplement for C++, using
	__offsetof__.
	* doc/extend.texi: Document __offsetof__.

	PR c++/13275
	* lex.c (reswords): Add "__offsetof" and "__offsetof__".
	* parser.c (cp_parser): Add in_offsetof_p.
	(cp_parser_new): Initialize it.
	(cp_parser_primary_expression): Handle __offsetof__ (...).
	(cp_parser_postfix_expression): Allow casts to pointer type and
	uses of "->" in a constant expression if implementing offsetof.
	(cp_parser_unary_expression): Allow the use of "&" in a constant
	expression if implementing offsetof.

	PR c++/13275
	* g++.dg/other/offsetof2.C: Remove XFAIL.
	* g++.dg/parse/offsetof1.C: New test.
	* g++.gd/parse/offsetof2.C: Likewise.

From-SVN: r74702
2003-12-16 16:09:23 +00:00
Nathan Sidwell 300e89a2b6 re PR c++/11072 (Implementation of offsetof macro)
PR c++/11072
	* ginclude/stddef.h (offsetof): Remove cast to 'char &'. Explain why.
testsuite:
	PR c++/11072
	* g++.dg/other/offsetof2.C: XFAIL.
	* g++.dg/other/offsetof5.C: New.

From-SVN: r68831
2003-07-02 14:30:53 +00:00
Nathan Sidwell ad27e65a22 stddef.h: Provide C++ safe offsetof.
.:	* ginclude/stddef.h: Provide C++ safe offsetof.
testsuite:
	* g++.dg/other/offsetof2.C: New test.

From-SVN: r65936
2003-04-22 12:28:51 +00:00
Nathanael Nerode e531258e68 float.h, [...]: GCC, not GNU CC.
* ginclude/float.h, ginclude/iso646.h, ginclude/stdarg.h,
	ginclude/stdbool.h, ginclude/stddef.h: GCC, not GNU CC.

From-SVN: r64291
2003-03-13 02:58:40 +00:00
Loren J. Rittle 081d6fb956 * gcc/ginclude/stddef.h: Support the FreeBSD 5 typedef system.
From-SVN: r57830
2002-10-04 21:16:07 +00:00
Kazu Hirata 981f6289ab ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.0: Likewise.
	* ChangeLog.1: Likewise.
	* ChangeLog.2: Likewise.
	* ChangeLog.4: Likewise.
	* ChangeLog.6: Likewise.
	* config.gcc: Likewise.
	* dwarfout.c: Likewise.
	* reload1.c: Likewise.
	* simplify-rtx.c: Likewise.
	* unwind-sjlj.c: Likewise.
	* config/avr/avr.h: Likewise.
	* config/d30v/d30v.h: Likewise.
	* config/frv/frv.c: Likewise.
	* config/frv/frv.h: Likewise.
	* config/ip2k/ip2k.h: Likewise.
	* config/m88k/m88k-move.sh: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/stormy16/stormy16.h: Likewise.
	* doc/extend.texi: Likewise.
	* doc/interface.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/md.texi: Likewise.
	* doc/rtl.texi: Likewise.
	* doc/tm.texi: Likewise.
	* doc/trouble.texi: Likewise.
	* ginclude/float.h: Likewise.
	* treelang/treelang.texi: Likewise.

From-SVN: r57179
2002-09-15 22:48:06 +00:00
Richard Henderson d57a4b98c4 Makefile.in (USER_H): Add ginclude/float.h.
* Makefile.in (USER_H): Add ginclude/float.h.
        (FLOAT_H): Remove.
        (stmp-int-hdrs, install-mkheaders): Don't handle FLOAT_H.
        (mostlyclean): Don't remove float.h intermediate files.
        (distclean): Don't remove float.h.
        * config.gcc: Remove all float_format references.
        * configure.in (float_format, float_h_file): Remove.

        * c-common.c: Include tree-inline.h.
        (builtin_define_with_int_value): New.
        (builtin_define_type_precision): Use it.
        (builtin_define_float_constants): New.
        (cb_register_builtins): Use it.  Define __FLT_RADIX__ and
        __FLT_EVAL_METHOD__.
        * defaults.h (TARGET_FLT_EVAL_METHOD): New.
        * config/i386/i386.h (TARGET_FLT_EVAL_METHOD): New.
        * config/m68k/m68k.h (TARGET_FLT_EVAL_METHOD): New.
        * doc/tm.texi (INTEL_EXTENDED_IEEE_FORMAT): Mention moto 96-bit format.
        (TARGET_FLT_EVAL_METHOD): New.

        * config/float-c4x.h, config/float-i128.h, config/float-i32.h,
        config/float-i386.h, config/float-i64.h, config/float-m68k.h,
        config/float-sh.h, config/float-sparc.h, config/float-vax.h: Remove.
        * ginclude/float.h: New.

From-SVN: r56769
2002-09-03 13:21:35 -07:00
Stan Shebs 825abef4dc stddef.h (_BSD_SIZE_T_DEFINED_): Define if not defined, plays nice with Darwin headers.
* ginclude/stddef.h (_BSD_SIZE_T_DEFINED_): Define if not defined,
        plays nice with Darwin headers.
        (_BSD_RUNE_T_DEFINED_): Likewise. (from Andr

Co-Authored-By: Andreas Tobler <toa@pop.agri.ch>

From-SVN: r55971
2002-08-02 06:09:14 +00:00
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
Bryce McKinlay 5cb265ec67 stddef.h: Define _BSD_WCHAR_T_DEFINED_ if _BSD_WCHAR_T_ gets undefined.
* ginclude/stddef.h: Define _BSD_WCHAR_T_DEFINED_ if _BSD_WCHAR_T_
	gets undefined. For Darwin.

From-SVN: r48672
2002-01-09 04:56:25 +00:00
Joseph Myers 29f7a20865 configure.in: Prepend ${srcdir}/config/${cpu_type}/ instead of ${srcdir}/ginclude/ to every...
* configure.in: Prepend ${srcdir}/config/${cpu_type}/ instead of
	${srcdir}/ginclude/ to every entry in extra_headers.
	* configure: Regenerate.
	* ginclude/math-3300.h: Rename to config/m68k/math-3300.h.
	* ginclude/math-68881.h: Rename to config/m68k/math-68881.h.
	* ginclude/ppc-asm.h: Rename to config/rs6000/ppc-asm.h.
	* ginclude/proto.h: Rename to config/convex/proto.h.

From-SVN: r48454
2002-01-01 23:21:01 +00:00
Franz Sirl 8a155ecc2a ppc-asm.h (JUMP_TARGET): New macro.
2001-12-01  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

	* ginclude/ppc-asm.h (JUMP_TARGET): New macro.
	* config/rs6000/tramp.asm: Use it.

From-SVN: r47509
2001-12-01 08:34:13 +00:00
Richard Henderson 30102605e7 Cray T3E port.
From-SVN: r45539
2001-09-11 01:52:39 -07:00
Fred Fish b7a0c86f58 * ginclude/stddef.h: Fix typo, __SIZE__TYPE__ should be __SIZE_TYPE__.
From-SVN: r45209
2001-08-27 20:23:37 +00:00
David Edelsohn 710fdaadee eabi.asm: Define 64-bit versions of FPR save/restore routines.
* config/rs6000/eabi.asm: Define 64-bit versions of FPR
        save/restore routines.
        * ginclude/ppc-asm.h: Define 64-bit FUNC_* macros.

From-SVN: r44862
2001-08-13 13:37:17 -04:00
Stan Shebs ee890fe2a1 Add Darwin (Mac OS X kernel) native support.
* config.gcc (powerpc-*-darwin*): Add native bits.
        * config/darwin.c: New file, generic Darwin support functions.
        * config/darwin.h: New file, generic Darwin definitions.
        * config/darwin-protos.h: New file, generic Darwin prototypes.
        * rs6000/darwin.h: New file, Darwin for PowerPC.
        * rs6000/t-darwin: New file, Darwin makefile fragment.
        * rs6000/rs6000.h (OBJECT_MACHO): New macro.
        (TARGET_MACHO): Ditto.
        (rs6000_abi): Add ABI_DARWIN.
        (RS6000_REG_SAVE): Add ABI_DARWIN case.
        (RS6000_SAVE_AREA): Ditto.
        (FP_ARG_MAX_REG): Ditto.
        (RETURN_ADDRESS_OFFSET): Ditto.
        * rs6000/rs6000.c (rs6000_legitimize_address): Add TARGET_MACHO
        cases.
        (rs6000_emit_move): Add ABI_DARWIN cases.
        (print_operand): Ditto.
        (first_reg_to_save): Ditto.
        (rs6000_stack_info): Ditto, also align stack by 16 instead of 8.
        (debug_stack_info): Ditto.
        (rs6000_emit_prologue): Ditto.
        (rs6000_emit_epilogue): Ditto.
        (output_profiler_hook): Ditto.
        (output_function_profiler): Ditto.
        (rs6000_add_gc_roots): Call machopic_add_gc_roots if TARGET_MACHO.
        (output_mi_thunk): Add TARGET_MACHO case.
        (add_compiler_stub): Ditto.
        (output_compiler_stub): Ditto.
        (no_previous_def): Ditto.
        (output_call): Ditto.
        (machopic_output_stub): Ditto.
        (rs6000_machopic_legitimize_pic_address): Ditto.
        (toc_section): Ditto.
        * rs6000/rs6000.md (addsi3_high): New TARGET_MACHO pattern.
        (macho_high): Ditto.
        (macho_low): Ditto.
        (movsi_low): Ditto.
        (load_macho_picbase): Ditto.
        (call): Add TARGET_MACHO case to modify function.
        (call_value): Ditto.
        (call_nonlocal_sysv): Add ABI_DARWIN case.
        (call_value_nonlocal_sysv): Ditto.
        * rs6000/rs6000-protos.h (rs6000_machopic_legitimize_pic_address):
        Add prototype.
        (machopic_output_stub): Ditto.
        * ginclude/stddef.h: Test _BSD_WCHAR_T_DEFINED_.

From-SVN: r41277
2001-04-12 02:13:00 +00:00
Joseph Myers 19552aa572 c-common.c (boolean_increment): New function.
* c-common.c (boolean_increment): New function.
	* c-common.h (enum c_tree_index): Add CTI_C_BOOL_TYPE,
	CTI_C_BOOL_TRUE and CTI_C_BOOL_FALSE.
	(c_bool_type_node, c_bool_true_node, c_bool_false_node): Define.
	(boolean_increment): Declare.
	* c-convert.c (convert): Allow for BOOLEAN_TYPE.
	* c-decl.c (init_decl_processing): Create boolean nodes.
	(finish_struct): Allow for _Bool bitfields.
	* c-parse.in (reswords): Add _Bool.
	(rid_to_yy): Allow for RID_BOOL.
	* c-typeck.c (default_conversion): Make booleans promote to int.
	(convert_arguments, build_unary_op, build_modify_expr,
	convert_for_assignment): Allow for booleans.
	* ginclude/stdbool.h: Make conforming to C99.

cp:
	* typeck.c (build_unary_op): Use boolean_increment from
	c-common.c, moving the relevant code there.

testsuite:
	* gcc.dg/c99-bool-1.c: New test.

From-SVN: r37428
2000-11-13 14:14:44 +00:00
Joseph Myers c5ab7f9110 stddef.h: Don't declare wint_t unless __need_wint_t.
* ginclude/stddef.h: Don't declare wint_t unless __need_wint_t.
	* c-common.h (enum c_tree_index): Add CTI_WINT_TYPE.
	(wint_type_node): Define.
	* c-decl.c (WINT_TYPE): Define.
	(init_decl_processing): Create the wint_type_node type.
	* c-common.c (T_WI): Define.
	(print_char_table): Use T_WI for %lc format.

From-SVN: r35481
2000-08-04 17:00:48 +01:00
Jason Merrill be78ffb226 collect2.c (resolve_lib_name): Move '/' check to more rational place.
* collect2.c (resolve_lib_name): Move '/' check to more rational place.

        * ginclude/stddef.h (NULL): define for non-gnu C++ parsers as 0.

From-SVN: r34687
2000-06-24 18:19:46 -04: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
Loren J. Rittle 17eb795180 * ginclude/stddef.h: Correct usage of _BSD_RUNE_T_ for FreeBSD.
From-SVN: r31988
2000-02-15 21:04:53 +00:00
Geoff Keating 79f4e1c0af ppc-asm.h (FUNC_START): Use USER_LABEL_PREFIX.
* ginclude/ppc-asm.h (FUNC_START): Use USER_LABEL_PREFIX.
(FUNC_END): Likewise.

From-SVN: r31808
2000-02-06 03:14:46 +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
Martin v. Löwis c8b313e75f * ginclude/stdbool.h: Support compilation as C++.
From-SVN: r31201
2000-01-04 10:12:22 +00:00
Richard Henderson e05eb76168 cccp.c (main): Define __STDC_VERSION__ as necessary.
* cccp.c (main): Define __STDC_VERSION__ as necessary.
        * cppinit.c (cpp_handle_option): Likewise.

        * ginclude/stdarg.h (va_copy): Use __STDC_VERSION__ to
        determine when to define.

From-SVN: r31022
1999-12-18 20:43:20 -08:00
Richard Henderson 223dca6a20 cppp.c (main): Set trigraphs and __STRICT_ANSI__ as appropriate for -lang-c89 and -std=*.
* cppp.c (main): Set trigraphs and __STRICT_ANSI__ as
        appropriate for -lang-c89 and -std=*.
        * cppinit.c (cpp_handle_option): Likewise.
        (new_pending_define): New, split out from cpp_handle_option.
        * gcc.c (default_compilers): Don't define __STRICT_ANSI__
        or enable trigraphs for -ansi/-std=*.

        * ginclude/stdarg.h (__va_copy): New.
        (va_copy): Don't define for C89.

From-SVN: r30921
1999-12-14 08:05:23 -08:00
Loren J. Rittle 370c81d682 t-freebsd: Do not override USER_H.
* config/t-freebsd: Do not override USER_H.
        * ginclude/stddef.h: Generalize check for _MACHINE_ANSI_H_.

From-SVN: r30017
1999-10-15 03:04:53 -06: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 5c9f708d43 Makefile.in (USER_H): Remove va-foo.h.
* Makefile.in (USER_H): Remove va-foo.h.

        * ginclude/{va-alpha.h,va-arc.h,va-c4x.h,va-clipper.h,va-h8300.h,
        va-i860.h,va-i960.h,va-m32r.h,va-m88k.h,va-mips.h,va-mn10200.h,
        va-mn10300.h,va-pa.h,va-ppc.h,va-pyr.h,va-sh.h,va-sparc.h,
        va-spur.h,va-v850.h}: Remove.

From-SVN: r29424
1999-09-14 20:42:26 -07: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
Zack Weinberg f84300c426 stdbool.h: Make the typedef name _Bool, with bool a #defined alias.
1999-08-29 08:38 -0700  Zack Weinberg  <zack@bitmover.com>

	* stdbool.h: Make the typedef name _Bool, with bool a #defined
	alias.

From-SVN: r28972
1999-08-29 15:46:14 +00:00
Richard Henderson b7df86dc88 Kill CYGNUS LOCAL tags.
From-SVN: r28311
1999-07-28 01:32:34 -07:00
Richard Henderson 4cc833b7a8 rs6000.h (struct rs6000_args): Add sysv_gregno.
* rs6000.h (struct rs6000_args): Add sysv_gregno.
        * rs6000.c (init_cumulative_args): Init sysv_gregno.
        (function_arg_boundary): Align DFmode.
        (function_arg_advance): Restructure for ABI_V4; use sysv_gregno
        to get fp reg and stack overflow correct.
        (function_arg): Likewise.
        (function_arg_pass_by_reference): True for TFmode for ABI_V4.
        (setup_incoming_varargs): Restructure for ABI_V4; use
        function_arg_advance to skip final named argument.
        (expand_builtin_saveregs): Properly unskip the last integer arg
        when doing varargs.  Adjust overflow location calculation.

        * ginclude/va-ppc.h (struct __va_list_tag): Make gpr and fpr
        explicitly unsigned.
        (__VA_FP_REGSAVE): Use new OFS argument instead of AP->fpr directly.
        (__VA_GP_REGSAVE): Similarly.
        (__va_longlong_p): Delete.
        (__va_arg_type_violation): New declaration.
        (va_arg): Restructure.  Flag promotion errors.  Align double.
        TFmode passed by reference.

        * rs6000.md (movdi_32+1): Use GEN_INT after arithmetic
        in the HOST_BITS_PER_WIDE_INT > 32 case.

From-SVN: r28199
1999-07-20 17:26:00 -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
Richard Henderson 2c4974b72a va-ppc.h (__va_start_common): Let __builtin_saveregs do the work.
* va-ppc.h (__va_start_common): Let __builtin_saveregs do the work.
        * rs6000.c (expand_builtin_saveregs): For V4, initialize a private
        va_list struct, and return a pointer to it.
        (setup_incoming_varargs): V4 save area based off virtual_stack_vars
        instead of frame_pointer.

From-SVN: r26710
1999-04-30 08:06:23 -07:00
J"orn Rennecke 9ab70a9bd7 sh.h (PASS_IN_REG_P): For TARGET_HITACHI, don't pass structures in registers.
* sh.h (PASS_IN_REG_P):  For TARGET_HITACHI, don't pass structures
	in registers.
	* expr.h (PRETEND_OUTGOING_VARARGS_NAMED): Provide default definition.
	* function.c (assign_parms): Honour PRETEND_OUTGOING_VARARGS_NAMED.
	* calls.c (expand_call): Likewise.
	* sh.c (sh_expand_prologue): For TARGET_HITACHI, don't push varargs /
	stdarg arguments.
	* sh.h (CPP_SPEC): Add -D__HITACHI__ for -mhitachi.
	(FUNCTION_ARG):  For TARGET_HITACHI, don't pass unnamed
	arguments in registers.
	(PRETEND_OUTGOING_VARARGS_NAMED): Define.
	* va-sh.h (entire file): If __HITACHI__ is defined, use sh[123]
	flavour varargs.

From-SVN: r25440
1999-02-25 14:02:32 +00:00
Jeff Law a0d66c8d67 dummy import to prevent merge lossage
From-SVN: r24349
1998-12-16 15:24:51 -07:00
J"orn Rennecke 225e4f43cc Add SH4 support:
* config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define.
	(___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define.
	* sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS.
	(fp_reg_names, assembler_dialect): New variables.
	(print_operand_address): Handle SUBREGs.
	(print_operand): Added 'o' case.
	Don't use adj_offsettable_operand on PRE_DEC / POST_INC.
	Name of FP registers depends on mode.
	(expand_block_move): Emit different code for SH4 hardware.
	(prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate.
	(from_compare): Likewise.
	(add_constant): New argument last_value.  Changed all callers.
	(find_barrier): Don't try HImode load for FPUL_REG.
	(machine_dependent_reorg): Likewise.
	(sfunc_uses_reg): A CLOBBER cannot be the address register use.
	(gen_far_branch): Emit a barrier after the new jump.
	(barrier_align): Don't trust instruction lengths before
	fixing up pcloads.
	(machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG.
	Use auto-inc addressing for fp registers if doubles need to
	be loaded in two steps.
	Set sh_flag_remove_dead_before_cse.
	(push): Support for TARGET_FMOVD.  Use gen_push_fpul for fpul.
	(pop): Support for TARGET_FMOVD.  Use gen_pop_fpul for fpul.
	(calc_live_regs): Support for TARGET_FMOVD.  Don't save FPSCR.
	Support for FIRST_XD_REG .. LAST_XD_REG.
	(sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG.
	(sh_expand_epilogue): Likewise.
	(sh_builtin_saveregs): Use DFmode moves for fp regs on SH4.
	(initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account.
	(arith_reg_operand): FPUL_REG is OK for SH4.
	(fp_arith_reg_operand, fp_extended_operand) New functions.
	(tertiary_reload_operand, fpscr_operand): Likewise.
	(commutative_float_operator, noncommutative_float_operator): Likewise.
	(binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise.
	(emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise.
	(expand_df_unop, expand_df_binop, expand_fp_branch): Likewise.
	(emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise.
	* sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only.
	(CONDITIONAL_REGISTER_USAGE): Likewise.
	(HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define.
	(TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define.
	(TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define.
	(target_flag): Add -m4, m4-single, m4-single-only, -mfmovd.
	(OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer
	to -1 and sh_flag_remove_dead_before_cse to 1.
	(ASSEMBLER_DIALECT): Define to assembler_dialect.
	(assembler_dialect, fp_reg_names): Declare.
	(OVERRIDE_OPTIONS): Add code for TARGET_SH4.
	Hide names of registers that are not accessible.
	(CACHE_LOG): Take TARGET_CACHE32 into account.
	(LOOP_ALIGN): Take TARGET_HARWARD into account.
	(FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define.
	(FIRST_PSEUDO_REGISTER: Now 49.
	(FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers.
	(HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG.
	(HARD_REGNO_MODE_OK): Update.
	(enum reg_class): Add DF_REGS and FPSCR_REGS.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise.
	(SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update.
	(CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define.
	(NPARM_REGS): Eight floating point parameter registers on SH4.
	(BASE_RETURN_VALUE_REG): SH4 also passes double values
	in floating point registers.
	(GET_SH_ARG_CLASS) Likewise.
	Complex float types are also returned in float registers.
	(BASE_ARG_REG): Complex float types are also passes in float registers.
	(FUNCTION_VALUE): Change mode like PROMOTE_MODE does.
	(LIBCALL_VALUE): Remove trailing semicolon.
	(ROUND_REG): Round when double precision value is passed in floating
	point register(s).
	(FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are
	passed on the stack.
	(FUNCTION_ARG): Little endian adjustment for SH4 SFmode.
	(FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4.
	(TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account.
	(INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD.
	(MODE_DISP_OK_8): Not for SH4 DFmode.
	(GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode.
	Allow indexed addressing for PSImode after reload.
	(LEGITIMIZE_ADDRESS): Not for SH4 DFmode.
	(LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode.
	Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS.
	(DOUBLE_TYPE_SIZE): 64 for SH4.
	(RTX_COSTS): Add PLUS case.
	Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case.
	(REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS,
	MAC_REGS, PR_REGS, DF_REGS.
	(REGISTER_NAMES): Use fp_reg_names.
	(enum processor_type): Add PROCESSOR_SH4.
	(sh_flag_remove_dead_before_cse): Declare.
	(rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare.
	(PREDICATE_CODES): Add binary_float_operator,
	commutative_float_operator, fp_arith_reg_operand, fp_extended_operand,
	fpscr_operand, noncommutative_float_operator.
	(ADJUST_COST): Use different scale for TARGET_SUPERSCALAR.
	(SH_DYNAMIC_SHIFT_COST): Cheaper for SH4.
	* sh.md (attribute cpu): Add value sh4.
	(attrbutes fmovd, issues): Define.
	(attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv.
	(function units memory, int, mpy, fp): Make dependent on issue rate.
	(function units issue, single_issue, load_si, load): Define.
	(function units load_store, fdiv, gp_fpul): Define.
	(attribute hit_stack): Provide proper default.
	(use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4.
	(udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns.
	(udivsi3, divsi3): Emit special patterns for SH4 hardware,
	(mulsi3_call): Now uses match_operand for function address.
	(mulsi3): Also emit code for SH1 case.  Wrap result in REG_LIBCALL /
	REG_RETVAL notes.
	(push, pop, push_e, pop_e): Now define_expands.
	(push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders.
	(movsi_ie): Added y/i alternative.
	(ic_invalidate_line_i, movdf_i4): New insns.
	(movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters.
	(reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders.
	(movdf): Add special code for SH4.
	(movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible.
	(call_valuei, calli, call_value): Likewise.
	(movsf): Emit no-op move.
	(mov_nop, movsi_y): New insns.
	(blt, sge): generalize to handle DFmode.
	(return predicate): Call emit_fpscr_use and remove_dead_before_cse.
	(block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4.
	(block_move_real_i4, block_lump_real_i4, fpu_switch): New insns.
	(fpu_switch0, fpu_switch1, movpsi): New expanders.
	(fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters.
	(toggle_sz): New insn.
	(addsf3, subsf3, mulsf3, divsf3): Now define_expands.
	(addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns.
	(macsf3): Make use of fpscr visible.  Disable for SH4.
	(floatsisf2): Make use of fpscr visible.
	(floatsisf2_i4): New insn.
	(floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4.
	(ieee_ccmpeqsf_t): Likewise.
	(fix_truncsfsi2): Emit different code for SH4.
	(fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns.
	(cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns.
	(negsf2, sqrtsf2, abssf2): Now expanders.
	(adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders.
	(negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns.
	(muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns.
	(fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders.
	(fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns.
	(fix_truncdfsi2_i4_2+1): New splitters.
	(negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns.
	(extendsfdf2, truncdfsf2): New expanders.
	(truncdfsf2_i4): New insn.
	* t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4.
	(MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4.
	* float-sh.h: When testing for __SH3E__, also test for
	__SH4_SINGLE_ONLY__ .
	* va-sh.h (__va_freg): Define to float.
	(__va_greg, __fa_freg, __gnuc_va_list, va_start):
        Define for __SH4_SINGLE_ONLY__ like for __SH3E__ .
        (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise.
	(__PASS_AS_FLOAT): Use different definition for __SH4__ and
	 __SH4_SINGLE__.
	(TARGET_SH4_P): Define.
	(va_arg): Use it.
	* sh.md (movdf_k, movsf_i): Tweak the condition so that
	init_expr_once is satisfied about the existence of load / store insns.
	* sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie):
        change m constraint in source operand to mr / mf .
	* va-sh.h (__va_arg_sh1): Use __asm instead of asm.
	* (__VA_REEF): Define.
	(__va_arg_sh1): Use it.
	* va-sh.h (va_start, va_arg, va_copy): Add parenteses.

From-SVN: r23777
1998-11-23 08:50:42 +00:00
Jeffrey A Law 9bce98db12 i860.c (single_insn_src_p): Add missing parens.
* i860.c (single_insn_src_p): Add missing parens.
        * ginclude/math-3300.h: Likewise.

From-SVN: r23727
1998-11-19 14:23:27 -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