Commit Graph

335 Commits

Author SHA1 Message Date
Manuel López-Ibáñez 92ef5cf999 re PR other/23572 (No warning for assigning a value to a 'float' variable that overflows with option -Wextra)
2007-03-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR other/23572
	* c-lex.c (interpret_float): On overflow, emit pedantic warning if
	infinities not supported, otherwise emit warning if -Woverflow. On
	underflow, emit warning if -Woverflow.
	* real.c (real_from_string): Return -1 if underflow, +1 if overflow
	and 0 otherwise.
	* real.h (real_from_string): Update declaration
testsuite/
	* gcc.dg/float-range-4.c: New.
	* gcc.dg/float-range-1.c: Update. Test for a warning.
	* gcc.dg/float-range-3.c: New.
	* gcc.dg/float-range-5.c: New.

From-SVN: r123137
2007-03-22 23:04:24 +00:00
Roger Sayle 8646f3df36 re PR middle-end/27428 (ICE with goto in erroneous code)
PR middle-end/27428
	* c-lex.c (c_lex_with_flags) <CPP_N_INVALID>: Increment errorcount
	to indicate the cpplib has issued an error message for us.

	* gcc.dg/pr27428-1.c: New test case.

From-SVN: r115080
2006-06-29 21:57:23 +00:00
Mike Stump c22cacf346 Whitespace fixups
From-SVN: r113893
2006-05-18 22:16:23 +00:00
Richard Henderson bc4071dd66 directives.c (struct pragma_entry): Add is_deferred.
libcpp/
	* directives.c (struct pragma_entry): Add is_deferred.  Add ident
	entry to value union.
	(end_directive): Don't eat the line if in_deferred_pragma.
	(run_directive): Remove pragma hacks.
	(insert_pragma_entry): Remove.
	(new_pragma_entry): New.
	(register_pragma_1): Split out of register_pragma.  Only handle
	the lookup tree and return the new entry.
	(cpp_register_pragma): Fill in the pragma entry here.
	(cpp_register_deferred_pragma): New.
	(register_pragma_internal): New.
	(_cpp_init_internal_pragmas): Use register_pragma_internal.
	(do_pragma): Allow pragma expansion after namespace.  For deferred
	pragmas, don't slurp the line into a string.
	(destringize_and_run): Save tokens for deferred pragmas.
	(cpp_handle_deferred_pragma): Remove.
	* macro.c (builtin_macro): Remove pragma token hack.
	(_cpp_push_token_context): Rename from push_token_context and export.
	* internal.h (struct lexer_state): Add pragma_allow_expansion.
	(_cpp_push_token_context): Declare.
	* lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
	a token.  Update the line number correctly if so.
	(_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
	(cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
	* include/cpplib.h (PRAGMA_EOL): New.
	(CPP_TOKEN_FLD_PRAGMA): New.
	(struct cpp_token): Add val.pragma.
	(struct cpp_options): Remove defer_pragmas.
	(cpp_handle_deferred_pragma): Remove.
	(cpp_register_deferred_pragma): Declare.

gcc/
	* c-lex.c (c_lex_with_flags) <CPP_PRAGMA>: Smuggle pragma id
	via integer constant.
	(pragma_lex): Remove.
	* c-pch.c (c_common_pch_pragma): Accept the name as an argument,
	rather than parsing it.
	* c-pragma.c (handle_pragma_weak, handle_pragma_redefine_extname,
	handle_pragma_extern_prefix): Add %< %> quotes.
	(registered_pragmas): New.
	(c_register_pragma_1): New.
	(c_register_pragma): Use it.
	(c_register_pragma_with_expansion): Likewise.
	(c_invoke_pragma_handler): New.
	(init_pragma): Use cpp_register_deferred_pragma directly for
	pch_preprocess.
	* c-pragma.h (enum pragma_kind): New.
	(pragma_handler): New.
	(c_invoke_pragma_handler): Declare.
	* c-common.c (c_parse_error): Pretty print CPP_PRAGMA and
	CPP_PRAGMA_EOL.
	* c-common.h (c_common_pch_pragma): Update decl.
	* Makefile.in (c-parser.o): Update dependencies.
	(GTFILES): Add c-pragma.h.
	* c-parser.c (struct c_token): Add pragma_kind.
	(struct c_parser): Add in_pragma.
	(c_lex_one_token): Always initialize keyword and pragma_kind.
	Extract data for CPP_PRAGMA.
	(c_parser_peek_2nd_token): Deny CPP_PRAGMA_EOL.
	(c_parser_consume_token): Don't allow CPP_PRAGMA unless errors.
	Don't allow CPP_PRAGMA_EOL if in_pragma.
	(c_parser_consume_pragma): New.
	(c_parser_skip_until_found): Stop on CPP_PRAGMA_EOL.
	(c_parser_skip_to_end_of_parameter): Likewise.
	(c_parser_skip_to_end_of_block_or_statement): Likewise.
	(c_parser_skip_to_pragma_eol): New.
	(c_parser_external_declaration): Handle CPP_PRAGMA.
	(c_parser_compound_statement_nostart): Likewise.
	(c_parser_statement_after_labels): Likewise.
	(c_parser_pragma): New.
	(pragma_lex): Likewise.
	(c_parser_pragma_pch_preprocess): New.
	(c_parser_new): Merge into ...
	(c_parse_file): ... here.  Call c_parser_pragma_pch_preprocess.

gcc/cp/
	* lex.c (handle_pragma_java_exceptions): Fix whitespace.
	* parser.c (struct cp_token): Add pragma_kind.
	(eof_token): Update to match.
	(struct cp_lexer): Add in_pragma; rearrange next for better packing.
	(cp_parser_initial_pragma): New.
	(cp_lexer_new_main): Use it.  Don't bother clearing
	c_lex_return_raw_strings.
	(cp_lexer_get_preprocessor_token): Always initialize keyword
	and pragma_kind fields.  Handle CPP_PRAGMA.
	(cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when 
	in_pragma is set.
	(cp_lexer_handle_pragma): Remove.  Update callers to cp_parser_pragma.
	(cp_lexer_print_token) <CPP_PRAGMA>: Don't print as a string.
	(cp_parser_skip_to_pragma_eol): New.
	(cp_parser_error): Use it.
	(cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL;
	rearrange with switch statement.
	(cp_parser_skip_to_end_of_statement): Likewise.
	(cp_parser_skip_to_end_of_block_or_statement): Likewise.
	(cp_parser_skip_to_closing_brace): Likewise.
	(cp_parser_skip_until_found): Likewise.
	(cp_parser_statement): Add in_compound argument; update callers.
	Use it to decide how to handle pragma parsing.
	(cp_parser_labeled_statement): Add in_compound argument; pass
	it on to cp_parser_statement.
	(cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL.
	(cp_parser_declaration_seq_opt): Likewise.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_member_specification_opt): Likewise.
	(cp_parser_function_definition_after_decl): Likewise.
	(cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs.
	(cp_parser_pragma): New.
	(pragma_lex): New.

gcc/testsuite/
	* g++.dg/parse/pragma2.C: Update expected error lines.

From-SVN: r109336
2006-01-04 08:33:38 -08:00
Volker Reichelt ab84748af1 re PR c++/23333 (accepts invalid pure specifier)
2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	PR c++/23333
	* include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.

	* c-lex.c (c_lex_with_flags): Add PURE_ZERO to cpp_flags if
	number is a single digit '0'.

	* parser.c (cp_parser_pure_specifier): Check for PURE_ZERO to
	identify a single '0'.

	* g++.dg/parse/error25.C: Add more tests.

From-SVN: r108947
2005-12-22 12:01:44 +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
Richard Henderson 75ce3d489c c-lex.c (pragma_lex): Rename from c_lex.
* c-lex.c (pragma_lex): Rename from c_lex.
        * c-pch.c: Update for pragma_lex rename.
        * c-pragma.c, c-pragma.h, config/ia64/ia64-c.c: Likewise.
        * config/m32c/m32c-pragma.c, config/darwin-c.c: Likewise.
        * config/rs6000/rs6000-c.c, config/c4x/c4x-c.c: Likewise.
        * config/sol2-c.c, config/v850/v850-c.c: Likewise.
        * doc/tm.texi: Likewise.
cp/
        * lex.c: Update for pragma_lex rename.
        * parser.c: Likewise.

From-SVN: r107544
2005-11-26 14:31:12 -08:00
DJ Delorie b9b8dde302 toplev.h: Add comment about the first parameter for warning().
* toplev.h: Add comment about the first parameter for warning().
* errors.h: Likewise.

* c.opt (Wpragmas): New.
* doc/invoke.texi: Document it.

* function.c (do_warn_unused_parameter): Add warning control to
warning call.
* c-decl.c (warn_if_shadowing): Likewise.
* c-lex.c (cb_def_pragma): Likewise.
* c-pragma.c (GCC_BAD, GCC_BAD2): Likewise.
(pop_alignment): Likewise.
(handle_pragma_pack): Likewise.
(apply_pragma_weak): Likewise.
(handle_pragma_weak): Likewise.
(handle_pragma_redefine_extname): Likewise.
(add_to_renaming_pragma_list): Likewise.
(handle_pragma_extern_prefix): Likewise.
(maybe_apply_renaming_pragma): Likewise.
(handle_pragma_visibility): Likewise.

* config/c4x/c4x-c.c (BAD): Likewise.
(c4x_parse_pragma): Likewise.
* config/ia64/ia64-c.c (ia64_hpux_handle_builtin_pragma): Likewise.
* config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise.
(rs6000_pragma_longcall): Likewise.
* config/v850/v850-c.c (pop_data_area): Likewise.
(ghs_pragma_section): Likewise.
(ghs_pragma_section): Likewise.
(ghs_pragma_interrupt): Likewise.
(ghs_pragma_starttda): Likewise.
(ghs_pragma_startsda): Likewise.
(ghs_pragma_startzda): Likewise.
(ghs_pragma_endtda): Likewise.
(ghs_pragma_endsda): Likewise.
(ghs_pragma_endzda): Likewise.

From-SVN: r102168
2005-07-19 16:19:16 -04:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Gabriel Dos Reis 7973fd2aed libiberty.h (XOBFINISH): New.
libiberty/
2005-06-06  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * libiberty.h (XOBFINISH): New.

gcc/
2005-06-06  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * c-lex.c (lex_string): Use XOBFINISH.
        * collect2.c (extract_string, dump_file): Likewise.
        * dbxout.c (dbxout_finish_complex_stabs): Likewise.
        * gcc.c (init_spec, build_search_list, convert_filename,
        set_collect_gcc_options, do_spec_2, do_spec_1, main):
        * Likewise.
        * genpreds.c (write_predicate_subfunction): Likewise.
        * genflags.c (main): Likewise.
        * read-rtl.c (mode_attr_index, apply_macro_to_string,
        join_c_conditions, read_quoted_string, read_braced_string,
        read_rtx_1): Likewise.
        * stringpool.c (ggc_alloc_string): Likewise.
        * tlink.c (obstack_fgets, recompile_files): Likewise.

From-SVN: r100678
2005-06-06 21:14:31 +00:00
DJ Delorie 44c21c7f03 c-common.c (unsigned_conversion_warning): Move warning control from if() to warning(OPT_*).
* c-common.c (unsigned_conversion_warning): Move warning control
from if() to warning(OPT_*).
(c_common_truthvalue_conversion): Likewise.
(c_do_switch_warnings): Likewise.
* c-decl.c (diagnose_mismatched_decls): Likewise.
(diagnose_mismatched_decls): Likewise.
(define_label): Likewise.
(grokdeclarator): Likewise.
* c-format.c (check_format_info): Likewise.
* c-lex.c (interpret_integer): Likwise.
(lex_string): Likewise.
* c-opts.c (c_common_post_options): Likewise.
* c-parser.c (c_parser_unary_expression): Likewise.
* c-pragma.c (handle_pragma_redefine_extname): Likewise.
(handle_pragma_extern_prefix): Likewise.
* c-typeck.c (build_binary_op): Likewise.
* gcse.c (is_too_expensive): Likewise.
* opts.c (decode_options): Likewise.
* stor-layout.c (place_field): Likewise.
* tree-cfg.c (remove_bb): Likewise.

* c.opt (-Wreturn-type): Add Var(warn_return_type).
* flags.h (warn_return_type): Remove.
* toplev.c (warn_return_type): Likewise.

From-SVN: r100135
2005-05-24 23:59:00 -04:00
DJ Delorie d4ee4d2525 diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
2005-04-23 17:29:07 -04:00
Kazu Hirata a5cb820a49 * c-lex.c (WCHAR_TYPE_SIZE, WCHAR_BYTES): Remove.
From-SVN: r98245
2005-04-17 01:44:41 +00:00
Kazu Hirata d4ff96d5fc builtin-attrs.def, [...]: Update copyright.
* builtin-attrs.def, c-lex.c, c-pragma.h, reg-stack.c,
	config/mips/vr.h: Update copyright.

From-SVN: r96369
2005-03-13 14:06:48 +00:00
Geoffrey Keating 47e204910a Index: libcpp/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* directives.c (glue_header_name): Update call to cpp_spell_token.
	* internal.h (_cpp_interpret_identifier): New.
	* charset.c (_cpp_interpret_identifier): New.
	(_cpp_valid_ucn): Allow UCN version of '$'.
	* lex.c (lex_identifier): Add extra parameter to indicate if initial
	character was '$' or '\'.  Support identifiers with UCNs.
	(forms_identifier_p): Allow UCNs.
	(_cpp_lex_direct): Pass extra parameter to lex_identifier.
	(utf8_to_ucn): New.
	(cpp_spell_token): Add FORSTRING parameter.  Use it.
	(cpp_token_as_text): Update call to cpp_spell_token.
	(cpp_output_token): Write UCNs back out.
	(stringify_arg): Update call to cpp_spell_token.
	(paste_tokens): Likewise.
	(cpp_macro_definition): Likewise.
	* macro.c (stringify_arg): Likewise.
	(paste_tokens): Likewise.
	(cpp_macro_definition): Likewise.
	* include/cpplib.h: Add parameter to cpp_spell_token.

Index: gcc/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* c-lex.c (c_lex_with_flags): Add parameter to call to
	cpp_spell_token.

Index: gcc/testsuite/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/ucnid-1.c: New.
	* gcc.dg/ucnid-2.c: New.
	* gcc.dg/ucnid-3.c: New.
	* gcc.dg/ucnid-4.c: New.
	* gcc.dg/ucnid-5.c: New.
	* gcc.dg/ucnid-6.c: New.
	* gcc.dg/cpp/ucnid-1.c: New.
	* gcc.dg/cpp/ucnid-2.c: New.
	* gcc.dg/cpp/ucnid-3.c: New.
	* g++.dg/other/ucnid-1.C: New.

From-SVN: r96333
2005-03-12 10:44:06 +00:00
Per Bothner 6037d88d58 c-tree.h (struct c_declarator): New id_loc field.
* c-tree.h (struct c_declarator): New id_loc field.
	* c-pragma.h (c_lex_with_flags): Take position reference.
	* c-lex.c (c_lex_with_flags): Set passed-in location from cpp token,
	iff USE_MAPPED_LOCATION. (Type doesn't match otherwise.)
	(c_lex): Pass dummy location to c_lex_with_flags.
	* c-parser.c (c_lex_one_token): Set c_token's location using
	c_lex_with_flags, instead of input_location, which might be "ahead".
	(c_parser_direct_declarator): Set declarator's id_loc from
	c_token's id_loc.
	* c-decl.c (grokdeclarator): Set DECL_SOURCE_LOCATION from
	declarator's id_loc, rather than probably-imprecise input_location.
	(build_id_declarator): Initialize c_declarator's id_loc field.

From-SVN: r96329
2005-03-11 22:37:46 -08:00
Zack Weinberg b6ff777cfc c-lex.c (cb_def_pragma): Clean up code for making location palatable to diagnostic.c.
* c-lex.c (cb_def_pragma): Clean up code for making location
	palatable to diagnostic.c.

From-SVN: r89691
2004-10-27 17:24:20 +00:00
Nathan Sidwell 51e63e60b3 c-lex.c (get_nonpadding_token): Remove.
* c-lex.c (get_nonpadding_token): Remove.
	(c_lex_with_flags): Push timevar and eat padding here.  Improve
	stray token diagnostic.
	(lex_string): Replace logic with switch statement, eat padding
	token here.
	* cp/parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
	padding token checking.
testsuite:
	* gcc.dg/cpp/direct2.c: Adjust expected errors, robustify parser
	resyncing.
	* gcc.dg/cpp/direct2s.c: Likewise.

From-SVN: r89577
2004-10-26 09:20:14 +00:00
Joseph Myers 6d84156b87 c-lex.c (interpret_float): Give a pedwarn rather than a warning for an out-of-range floating point constant.
* c-lex.c (interpret_float): Give a pedwarn rather than a warning
	for an out-of-range floating point constant.
	* builtins.c (fold_builtin_inf): Give a pedwarn rather than a
	warning if the target format does not support infinities.

testsuite:
	* gcc.dg/float-range-1.c, gcc.dg/float-range-2.c: New tests.

From-SVN: r88793
2004-10-08 21:25:42 +01:00
Joseph Myers 3f75a25471 c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
	c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
	c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
	code formatting conventions.

From-SVN: r88462
2004-10-03 21:53:05 +01:00
Matt Austern c162c75e43 c-common.c (fix_string_type): Build the unqualified array type unconditionally...
2004-09-20  Matt Austern <austern@apple.com>
	    Zack Weinberg  <zack@codesourcery.com>

	* c-common.c (fix_string_type): Build the unqualified array
	type unconditionally, then use c_build_qualified_type to get
	the proper const-qualified variant, and set its
	TYPE_MAIN_VARIANT to refer to the unqualified type.
	* c-lex.c (c_lex_return_raw_string): New global.
	(c_lex_with_flags): Honor it.
	* c-pragma.h: Declare it.

cp:
	* decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
	Apply lbasename to input_filename before passing to get_fileinfo.
	* semantics.c (begin_class_definition): Likewise.
	* lex.c (handle_pragma_interface): Apply get_fileinfo to the
	correct filename.  Rename variables to be less confusing.
	(handle_pragma_implementation): Likewise.  Disable "appears
	after file is included" diagnostic.

	* parser.c (struct cp_token): Add in_system_header fiag.
	(CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
	(CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
	(CPP_NONE, cp_lexer_read_token): Delete.
	(struct cp_lexer): Remove first_token, string_tokens,
	main_lexer_p fields.  Clarify comments.
	(struct cp_token_cache): Now just a pair of pointers.
	(CP_LEXER_BUFFER_SIZE): New #define.
	(CPP_PURGED): New fake token type.
	(cp_lexer_new_from_token_array, cp_lexer_destroy)
	(cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
	(cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
	New functions.
	(cp_lexer_new_from_tokens): Now a simple wrapper around
	cp_lexer_new_from_token_array.
	(cp_lexer_set_source_position_from_token): Also update
	in_system_header.
	(cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
	Don't wrap round.
	(cp_lexer_token_difference): Dont handle wrapping round.
	(cp_lexer_new_main): Enable pragma deferral and raw strings,
	read the entire translation unit through c_lex_with_flags into
	this lexer's buffer, then turn raw strings back off again.
	(cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
	(cp_lexer_get_preprocessor_token): No need to handle not being
	the main lexer.  Set token->in_system_header too.
	(cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
	to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
	(cp_lexer_peek_nth_token): Likewise.
	(cp_lexer_purge_token): Mark the token PURGED, don't shift all
	the other tokens down.
	(cp_lexer_purge_tokens_after): Likewise.
	(cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
	about there being no tokens.
	(cp_lexer_print_token): Revise to give useful information on
	all tokens.
	(struct cp_parser): Add field translate_strings_p.
	(cp_parser_new): Initialize it.
	(cp_parser_translation_unit): Destroy the lexer when done.
	(cp_parser_parameter_declaration): Restructure saving of
	default arguments.
	(cp_parser_save_member_function_body): Likewise.
	(cp_parser_check_for_invalid_template_id)
	(cp_parser_nested_name_specifier_opt, cp_parser_template_id):
	Adjust calls to cp_lexer_advance_token.
	(cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
	No need to fiddle c_lex_string_translate.
	(cp_parser_primary_expression, cp_parser_linkage_specification)
	(cp_parser_asm_definition, cp_parser_asm_specification_opt)
	(cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
	Use cp_parser_string_literal.
	(cp_parser_attribute_list): Save and restore
	parser->translate_strings_p, not c_lex_string_translate.
	(cp_parser_cache_group): Delete.
	(cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
	not take a cache argument.

From-SVN: r87786
2004-09-21 02:22:45 +00:00
Joseph Myers bda6743181 c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
	c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
	in diagnostics.  Use %' for English apostrophes.
	* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
	(pedwarn_c90, pedwarn_c99): Use it.
	* c-decl.c (lookup_label): Quote label name in diagnostic.
	* c-parse.in (yyprint): Use ' instead of ` for left quote.
	* c-typeck.c (warn_for_assignment): Likewise.

testsuite:
	* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
	gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
	gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
	gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
	Update expected messages.

From-SVN: r87413
2004-09-13 00:53:29 +01:00
Zack Weinberg 5d709b0013 c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h.
* c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h.
	(extract_interface_info): Delete prototype.
	* c-decl.c (extract_interface_info): Delete stub.
	* c-lex.c (get_fileinfo): Initialize file_info_tree here, if
	it's not already been done ...
	(init_c_lex): ... not here.
	(fe_file_change): Don't call extract_interface_info.
cp:
	* cp-tree.h (interface_only, interface_unknown): Delete declarations;
	comment explaining them moved to c-common.h.
	* lex.c (interface_only, interface_unknown, extract_interface_info):
	Delete definitions.
	(cxx_finish): Don't reset interface_unknown.
	(handle_pragma_interface): Don't set interface_only and
	interface_unknown; just the like-named fields in finfo.
	(handle_pragma_implementation): Adjust comment.
	* decl2.c (cp_finish_file): Don't reset interface_only and
	interface_unknown.
	* method.c (synthesize_method): Don't reset interface_unknown or
	call extract_interface_info.
	* pt.c (pop_tinst_level): Don't call extract_interface_info.
	* decl.c (start_cleanup_fn): Don't save or restore interface_only
	and interface_unknown.
	(make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
	and use the result instead of the interface_only/interface_unknown
	globals.
	(start_preparsed_function): Likewise.
	* lex.c (cxx_make_type): Likewise.
	* semantics.c (begin_class_definition): Likewise.
	(expand_body): Don't call extract_interface_info.

From-SVN: r87329
2004-09-10 23:56:31 +00:00
Nathan Sidwell 366de0ce7d c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
	* c-common.c (c_type_hash, c_common_nodes_and_builtins,
	c_expand_expr, boolean_increment, nonnull_check_p,
	check_function_arguments_recurse, fold_offsetof_1): Likewise.
	* c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros,
	builtin_define_type_max): Likewise.
	* c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level,
	implicit_decl_warning, builtin_function, build_compound_literal,
	complete_array_type, grokdeclarator, get_parm_info,
	start_function, store_parm_decls_oldstyle,
	c_write_global_declarations): Likewise.
	* c-format.c (get_constant, decode_format_attr,
	maybe_read_dollar_number, get_flag_spec, check_format_arg,
	check_format_types, format_type_warning,
	find_char_info_specifier_index, init_dynamic_asm_fprintf_info,
	init_dynamic_diag_info, handle_format_attribute): Likewise.
	* c-gimplify.c (push_context, pop_context, finish_bc_block):
	* c-lex.c (c_lex_with_flags, lex_string): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-pch.c (pch_init): Likewise.
	* c-pragma.c (maybe_apply_pragma_weak): Likewise.
	* c-pretty-print.c (pp_c_tree_decl_identifier): Likewise.
	* c-typeck.c (c_incomplete_type_error, composite_type,
	common_pointer_type, common_type, same_translation_unit_p,
	tagged_types_tu_compatible_p, finish_init, pop_init_level,
	set_designator, set_nonincremental_init_from_string,
	process_init_element, c_finish_if_stmt): Likewise.
	* caller-save.c (init_caller_save, save_call_clobbered_regs,
	insert_restore, insert_save, insert_one_insn): Likewise.
	* calls.c (emit_call_1, compute_argument_block_size,
	precompute_arguments, expand_call, emit_library_call_value_1,
	store_one_arg): Likewise.

From-SVN: r87140
2004-09-07 10:19:00 +00:00
Ziemowit Laski e5a002e353 c-common.h: Update comments about ObjC/ObjC++ entry points.
[gcc/ChangeLog]
2004-08-28  Ziemowit Laski  <zlaski@apple.com>

	* c-common.h: Update comments about ObjC/ObjC++ entry points.
	(objc_is_reserved_word): New prototype.
	(get_current_scope, objc_mark_locals_volatile): Move prototypes to
	separate section; these are call-backs.
	* c-lex.c (c_lex_with_flags): Call objc_is_reserved_word() to detect
	ObjC/ObjC++ "@" keywords.
	* c-tree.h (get_current_scope, objc_mark_locals_volatile): Remove
	prototypes; they already live in c-common.h.
	* stub-objc.c: Update copyright notice.
	(objc_is_reserved_word): New stub.

[gcc/cp/ChangeLog]
2004-08-28  Ziemowit Laski  <zlaski@apple.com>

	* Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
	CXX_AND_OBJCXX_OBJS.
	(CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
	separately on the link line.

[gcc/objc/ChangeLog]
2004-08-28  Ziemowit Laski  <zlaski@apple.com>

	* objc-act.c (objc_is_reserved_word): New function.

From-SVN: r86702
2004-08-28 20:58:56 +00:00
Nathan Sidwell 7d60be94d6 tree.h (build_int_cst): New, sign extended constant.
* tree.h  (build_int_cst): New, sign extended constant.
	(build_int_cstu): New, zero extended constant.
	(build_int_cst_wide): Renamed from build_int_cst.
	* tree.c (build_int_cst, build_int_cstu): New.
	(build_int_cst_wide): Renamed from build_int_cst.
	(make_vector_type, build_common_tree_nodes,
	build_common_tree_nodes_2): Adjust build_int_cst calls.
	* builtins.c (expand_builtin_prefetch, expand_builtin_strstr,
	expand_builtin_strpbrk, expand_builtin_fputs,
	build_string_literal, expand_builtin_printf,
	expand_builtin_sprintf, fold_builtin_classify_type,
	fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii,
	fold_builtin_toascii, fold_builtin_isdigit,
	simplify_builtin_strstr, simplify_builtin_strpbrk,
	fold_builtin_fputs, simplify_builtin_sprintf): Likewise.
	* c-common.c (start_fname_decls, fix_string_type, shorten_compare,
	DEF_ATTR_INT): Likewise.
	* c-decl.c (complete_array_type, check_bitfield_type_and_width):
	Likewise.
	* c-lex.c (interpret_integer, lex_charconst): Likewise.
	* c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Likewise.
	* c-typeck.c (really_start_incremental_init, push_init_level,
	set_nonincremental_init_from_string): Likewise.
	* calls.c (load_register_parameters): Likewise.
	convert.c (convert_to_pointer): Likewise.
	coverage.c (coverage_counter_alloc, tree_coverage_counter_ref,
	build_fn_info_type, build_fn_info_value, build_ctr_info_value,
	build_gcov_info): Likewise.
	* except.c (init_eh, assign_filter_values): Likewise.
	* expmed.c (store_fixed_bit_field, extract_bit_field,
	extract_fixed_bit_field, extract_split_bit_field, expand_shift,
	expand_mult_const, expand_mult_highpart_adjust, extract_high_half,
	expand_sdiv_pow2, expand_divmod, make_tree): Likewise.
	* expr.c (convert_move, emit_group_load, emit_group_store,
	expand_assignment, store_constructor, store_field,
	expand_expr_real_1, reduce_to_bit_field_precision): Likewise.
	fold-const.c (force_fit_type, int_const_binop, fold_convert_const,
	invert_truthvalue, optimize_bit_field_compare,
	decode_field_reference, all_ones_mask_p, constant_boolean_node,
	fold_div_compare, fold, fold_read_from_constant_string,
	fold_negate_const, fold_abs_const, fold_not_const, round_up,
	round_down): Likewise.
	* function.c (assign_parm_setup_block): Likewise.
	* stmt.c (shift_return_value, expand_case, estimate_case_costs):
	Likewise.
	* stor-layout.c (layout_type, initialize_sizetypes,
	set_min_and_max_values_for_integral_type): Likewise.
	* tree-chrec.c (chrec_fold_multiply_poly_poly,
	reset_evolution_in_loop): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.
	* tree-complex.c (build_replicated_const): Likewise.
	* tree-eh.c (honor_protect_cleanup_actions,
	lower_try_finally_onedest, lower_try_finally_copy,
	lower_try_finally_switch): Likewise.
	* tree-mudflap.c (mf_build_string, mx_register_decls,
	mudflap_register_call, mudflap_enqueue_constant): Likewise.
	* tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref):
	Likewise.
	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_cond,
	loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type):
	Likewise.
	* tree-ssa-loop-ivcanon.c (create_canonical_iv,
	canonicalize_loop_induction_variables): Likewise.
	* tree-vectorizer.c (vect_create_index_for_array_ref,
	vect_transform_loop_bound, vect_compute_data_ref_alignment):
	Likewise.

	* config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start,
	alpha_gimplify_va_arg_1): Likewise.
	* config/arm/arm.c (arm_get_cookie_size): Likewise.
	* config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise.
	* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
	* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
	* config/mips/mips.c (mips_build_builtin_va_list, mips_va_start,
	mips_gimplify_va_arg_expr): Likewise.
	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
	* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg,
	add_compiler_branch_island): Likewise.
	* config/s390/s390.c (s390_va_start): Likewise.
	* config/sh/sh.c (sh_va_start): Likewise.
	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
	Likewise.
	* config/xtensa/xtensa.c (xtensa_va_start,
	xtensa_gimplify_va_arg_expr): Likewise.

	* objc/objc-act.c (build_objc_string_object,
	build_objc_symtab_template, init_def_list, init_objc_symtab,
	init_module_descriptor, generate_static_references,
	build_selector_translation_table, get_proto_encoding,
	build_typed_selector_reference, build_selector_reference,
	build_next_objc_exception_stuff,
	build_method_prototype_list_template, generate_descriptor_table,
	generate_protocols, build_protocol_initializer,
	build_ivar_list_template, build_method_list_template,
	build_ivar_list_initializer, generate_ivars_list,
	generate_dispatch_table, generate_protocol_list,
	build_category_initializer, build_shared_structure_initializer,
	generate_shared_structures, handle_impent,
	generate_objc_image_info): Likewise.

2004-04-25  Paolo Bonzini  <bonzini@gnu.org>

	* cfglayout.c (duplicate_insn_chain): Remove references to
	NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT.
	* cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator.
	* cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT.
	* final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove.
	* jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop,
	check_dbra_loop, loop_dump_aux): Remove references to removed notes
	and fields.
	* reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs.
	* unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove
	references to removed notes and fields.
	(subtract_reg_term, ujump_to_loop_cont): Remove.

From-SVN: r86544
2004-08-25 09:52:54 +00:00
Zack Weinberg f8ca7e49b3 flags.h (enum debug_info_type): Remove DWARF_DEBUG.
* flags.h (enum debug_info_type): Remove DWARF_DEBUG.
	* defaults.h (PREFERRED_DEBUGGING_TYPE): Remove check for
	DWARF_DEBUGGING_INFO from choice-of-definition chain;
	restructure using C89 features (#elif, #error).
	* c-lex.c, final.c, opts.c, config/cris/cris.c, config/frv/frv.c
	* config/sh/sh.h: Remove references to DWARF_DEBUG.
	* doc/invoke.texi: Remove references to DWARF version 1;
	clarify why -gdwarf-2<n> doesn't work.
cp:
	* class.c, search.c: Remove references to DWARF_DEBUG.

From-SVN: r86540
2004-08-25 07:34:54 +00:00
Nathan Sidwell 4a90aeeb51 tree.h (build_int_cst): New.
.:	* tree.h (build_int_cst): New.
	(build_int_2): Remove.
	* tree.c (build_int_2): Remove.
	(build_int_cst): New.
	(make_vector_type, build_common_tree_nodes,
	build_common_tree_nodes_2): Use build_int_cst.
	* builtins.c (expand_builtin_prefetch, expand_builtin_strstr,
	expand_builtin_strpbrk, expand_builtin_fputs,
	build_string_literal, expand_builtin_printf,
	expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop,
	fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii,
	fold_builtin_isdigit, simplify_builtin_strstr,
	simplify_builtin_strpbrk, fold_builtin_fputs,
	simplify_builtin_sprintf): Use build_int_cst.
	* c-common.c (start_fname_decls, fix_string_type,
	c_common_nodes_and_builtins, c_init_attributes,
	shorten_compare): Likewise.
	* c-decl.c (complete_array_type,
	check_bitfield_type_and_width): Likewise.
	* c-lex.c (interpret_integer, lex_charconst): Likewise.
	* c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Likewise.
	* c-typeck.c (really_start_incremental_init, push_init_level,
	set_nonincremental_init_from_string): Likewise.
	* calls.c (load_register_parameters): Likewise.
	* convert.c (convert_to_pointer): Likewise.
	* coverage.c (coverage_counter_alloc, tree_coverage_counter_ref,
	build_fn_info_type, build_ctr_info_value, build_gcov_info):
	Likewise.
	* except.c (init_eh, assign_filter_values, assign_filter_values):
	Likewise.
	* expmed.c (store_fixed_bit_field, extract_bit_field,
	extract_fixed_bit_field, extract_split_bit_field, expand_shift,
	expand_mult_const, expand_mult_highpart_adjust, extract_high_half,
	expand_sdiv_pow2, expand_divmod, make_tree): Likewise.
	* expr.c (convert_move, emit_group_load, emit_group_store,
	expand_assignment, store_constructor, store_field,
	expand_expr_real_1, reduce_to_bit_field_precision): Likewise.
	* fold-const.c (force_fit_type, int_const_binop, fold_convert_const,
	invert_truthvalue, optimize_bit_field_compare,
	decode_field_reference, all_ones_mask_p, constant_boolean_node,
	fold_div_compare, fold, fold_read_from_constant_string,
	fold_negate_const, fold_abs_const, fold_not_const): Likewise.
	* function.c (assign_parm_setup_block): Likewise.
	* stmt.c (shift_return_value, expand_end_case_type,
	estimate_case_costs): Likewise.
	* stor-layout.c (layout_type, initialize_sizetypes,
	set_min_and_max_values_for_integral_type): Likewise.
	* tree-chrec.c (chrec_fold_multiply_poly_poly,
	reset_evolution_in_loop): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.
	* tree-complex.c (build_replicated_const): Likewise.
	* tree-eh.c (honor_protect_cleanup_actions,
	lower_try_finally_onedest, lower_try_finally_copy,
	lower_try_finally_switch): Likewise.
	* tree-mudflap.c (mf_build_string, mx_register_decls,
	mudflap_register_call, mudflap_enqueue_constant): Likewise.
	* tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref):
	Likewise.
	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_cond,
	loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type):
	Likewise.

	* config/alpha/alpha.c (alpha_initialize_trampoline,
	alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst.
	* config/arm/arm.c (arm_get_cookie_size): Likewise.
	* config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise.
	* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
	* config/i860/i860.c (i860_va_start): Likewise.
	* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
	* config/mips/mips.c (mips_build_builtin_va_list, mips_va_start,
	mips_gimplify_va_arg_expr): Likewise.
	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
	* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg,
	add_compiler_branch_island): Likewise.
	* config/s390/s390.c (s390_va_start): Likewise.
	* config/sh/sh.c (sh_va_start): Likewise.
	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
	Likewise.
	* config/xtensa/xtensa.c (xtensa_va_start,
	xtensa_gimplify_va_arg_expr): Likewise.

	* objc/objc-act.c (build_objc_string_object,
	build_objc_symtab_template, init_def_list, init_objc_symtab,
	init_module_descriptor, generate_static_references,
	build_selector_translation_table, get_proto_encoding,
	build_typed_selector_reference, build_selector_reference,
	build_next_objc_exception_stuff,
	build_method_prototype_list_template, generate_descriptor_table,
	generate_protocols, build_protocol_initializer,
	build_ivar_list_template, build_method_list_template,
	build_ivar_list_initializer, generate_ivars_list,
	generate_dispatch_table, generate_protocol_list,
	build_category_initializer, build_shared_structure_initializer,
	generate_shared_structures, handle_impent,
	generate_objc_image_info): Use build_int_cst.
ada:
	* cuintp.c (UI_To_gnu): Use build_int_cst..
	* trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise.
	* utils.c (init_gigi_decls): Likewise.
	* utils2.c (build_call_raise): Likewise.
cp:
	* call.c (convert_class_to_reference,
	build_user_type_conversion_1, convert_like_real,
	build_java_interface_fn_ref, build_special_member_call): Use
	build_int_cst.
	* class.c (build_vtbl_initializer): Likewise.
	* cp-gimplify.c (cp_gimplify_expr): Likewise.
	* cvt.c (cp_convert_to_pointer): Likewise.
	* decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
	* decl2.c (start_static_initialization_or_destruction,
	generate_ctor_or_dtor_function): Likewise.
	* except.c (build_throw): Likewise.
	* lex.c (cxx_init): Likewise.
	* mangle.c (write_integer_cst): Likewise.
	* rtti.c (build_headof, get_tinfo_decl_dynamic,
	build_dynamic_cast_1, ptr_initializer, ptm_initializer,
	get_pseudo_ti_init): Likewise.
	* search.c (get_dynamic_cast_base_type): Likewise.
	* tree.c (build_shared_int_cst): Likewise.
fortran:
	* trans-array.c (gfc_trans_array_constructor_value): Use
	build_int_cst.
	* trans-const.c (gfc_build_string_const,
	gfc_init_constants, gfc_conv_mpz_to_tree,
	gfc_conv_constant_to_tree): Likewise.
	* trans-decl.c (gfc_get_symbol_decl): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_ibits,
	gfc_conv_intrinsic_len, prepare_arg_info): Likewise.
	* trans-io.c (add_case, set_error_locus, build_dt,
	transfer_expr): Likewise.
	* trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause,
	gfc_trans_stop, gfc_trans_character_select): Likewise.
	* trans-types.c (gfc_init_types, gfc_get_dtype): Likewise.
	* trans.c (gfc_trans_runtime_check): Likewise.
java:
	* boehm.c (get_boehm_type_descriptor): Use build_int_cst.
	* class.c (build_utf8_ref, build_static_field_ref,
	make_field_value, make_method_value, get_dispatch_table,
	make_class_data, emit_symbol_table, emit_catch_table): Likewise.
	* constants.c (get_tag_node,  build_ref_from_constant_pool,
	build_constants_constructor): Likewise.
	* decl.c (java_init_decl_processing): Likewise.
	* expr.c (build_java_array_length_access, build_newarray,
	expand_java_multianewarray, expand_java_pushc, expand_iinc,
	build_java_binop, build_field_ref, expand_java_add_case,
	expand_java_call, build_known_method_ref, build_invokevirtual,
	build_invokeinterface, build_jni_stub): Likewise.
	* java-gimplify.c (java_gimplify_new_array_init): Likewise.
	* jcf-parse.c (get_constant): Likewise.
	* lex.c (do_java_lex): Likewise.
	* parse.y (patch_binop, patch_unaryop, patch_cast,
	build_null_of_type, patch_newarray): Likewise.
	* resource.c (compile_resource_data): Likewise.
	* typeck.c (build_prim_array_type): Likewise.

From-SVN: r86022
2004-08-15 15:45:33 +00:00
Nathan Sidwell 5e9754afeb c-lex.c (narrowest_unsigned_type, [...]): Take low/high pair.
* c-lex.c (narrowest_unsigned_type, narrowest_signed_type): Take
	low/high pair. Do range checking directly.
	(interpret_integer): Adjust.

From-SVN: r85559
2004-08-04 14:38:27 +00:00
Bernardo Innocenti f408614568 Makefile.in (C_PRAGMA_H): New variable to track dependencies of c-pragma.h.
* Makefile.in (C_PRAGMA_H): New variable to track dependencies
	of c-pragma.h.
	* c-pragma.h (c_lex, c_lex_with_flags): Change returntype to
	enum cpp_ttype.
	* c-lex.c: Likewise.

From-SVN: r85174
2004-07-26 02:29:41 +02:00
Bernardo Innocenti 28dab13236 basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
* basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
	* c-common.c: Add missing casts from void * to other types.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-pragma.c: Likewise.
	* c-typeck.c: Likewise.
	* defaults.h: Likewise.
	* genconstants.c: Likewise.
	* gengtype-lex.l: Likewise.
	* genmodes.c: Likewise.
	* read-rtl.c: Likewise.
	* rtl.c: Likewise.

From-SVN: r85166
2004-07-26 00:17:02 +02:00
Bernardo Innocenti 5d038c4cb1 bitmap.c: Use type-safe memory allocation macros from libiberty.
* bitmap.c: Use type-safe memory allocation macros from libiberty.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-lang.c: Likewise.
	* c-lex.c: Likewise.
	* c-opts.c: Likewise.
	* c-parse.in: Likewise.
	* c-typeck.c: Likewise.
	* genconditions.c: Likewise.
	* gengtype-lex.l: Likewise.
	* gengtype-yacc.y: Likewise.
	* gengtype.c: Likewise.
	* genmodes.c: Likewise.
	* gensupport.c: Likewise.
	* read-rtl.c: Likewise.
	* read-rtl.c (read_constants): Use INSERT instead of TRUE in call to
	htab_find_slot().

From-SVN: r85163
2004-07-25 22:43:23 +02:00
Bernardo Innocenti 89658955e5 c-decl.c (groktypename, [...]): Rename variable typename to type_name.
* c-decl.c (groktypename, groktypename_in_param_context): Rename
	variable typename to type_name.
	* c-lex.c (interpret_float): Likewise.

From-SVN: r85161
2004-07-25 21:32:47 +02:00
Bernardo Innocenti e18476eb94 c-common.c: Convert ATTRIBUTE_UNUSED to ARG_UNUSED in parameter lists.
* c-common.c: Convert ATTRIBUTE_UNUSED to ARG_UNUSED in parameter
	lists.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-opts.c: Likewise.
	* c-pragma.c: Likewise.
	* c-typeck.c: Likewise.
	* gencheck.c: Likewise.
	* genconditions.c: Likewise.
	* genconfig.c: Likewise.
	* genflags.c: Likewise.
	* gengtype.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-none.c: Likewise.
	* langhooks.c: Likewise.
	* statistics.h: Likewise.
	* stub-objc.c: Likewise.
	* java/decl.c: Likewise.

From-SVN: r85128
2004-07-25 02:13:01 +02:00
Zack Weinberg 3e95a7cbf5 rtl.h (plus_constant): Delete.
* rtl.h (plus_constant): Delete.
	(plus_constant_wide): Rename to plus_constant.
	(plus_constant_for_output_wide): Delete vestigial prototype.
	(GEN_INT): Remove unnecessary cast.
	* tree.h (build_int_2, size_int_type): Delete.
	(build_int_2_wide): Rename to build_int_2.
	(size_int_wide): Rename to size_int_kind.
	(size_int_type_wide): Rename to size_int_type.
	(size_int, ssize_int, bitsize_int, sbitsize_int): Use size_int_kind.
	Remove unnecessary cast.
	* tree.c (build_int_2_wide): Rename build_int_2; update comment.
	* explow.c (plus_constant_wide): Rename plus_constant; update comment.
	* fold-const.c (size_int_wide): Rename size_int_kind. Use size_int_type.
	(size_int_type_wide): Rename size_int_type.
	(int_const_binop): Use size_int_type.
	* c-lex.c (interpret_integer): Use build_int_2.
	* final.c (split_double): Remove unnecessary casts.
	* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use build_int_2.

From-SVN: r84976
2004-07-20 23:02:36 +00:00
Per Bothner 3c20847b83 Conditionally compile support for --enable-mapped_location.
* basic-block.h (struct edge_def):  Use new source_locus typedef.
	* c-common.c (fname_decl):  Update save/clear/store of input_location.
	(c_do_switch_warnings):  Update for USE_MAPPED_LOCATION case.
	* c-decl.c:  Likewise.
	* c-dump.c (dump_stmt):  Likewise.
	* c-gimplify.c (c-gimplify.c):  Generalize using SET_EXPR_LOCATION.
	* c-lex.c (cb_line_change):  If USE_MAPPED_LOCATION use token's	src_loc
	to set input_location direction, rather than using linemap_lookup.
	(fe_file_change, cb_def_pragma):  Again use source_location directly.
	* c-opts.c (saved_lineno):  Remove static variable.
	(c_common_post_options, c_common_init):  Don't bothner to save,
	clear and restore input_Location - now handled by lang_dependent_init.
	* function.c (init_function_start):  Use new DECL_IS_BUILTIN macro.
	* xcoffout.c (xcoff_assign_fundamental_type_number):  Likewise.

From-SVN: r83919
2004-06-30 11:05:07 -07:00
Alexandre Oliva 0173bb6f2d c-pragma.h (c_lex_string_translate): Change type to int.
gcc/ChangeLog:
* c-pragma.h (c_lex_string_translate): Change type to int.
* c-parse.in: Change all assignments of c_lex_string_translate
to true and false to 1 and 0.
* c-lex.c (c_lex_string_translate): Likewise.
(lex_string): Convert string without translation in the -1
case.
gcc/cp/ChangeLog:
* parser.c: Change all assignments of c_lex_string_translate
to true and false to 1 and 0.
(cp_lexer_read_token): Convert type of the translated string.
(cp_parser_skip_to_closing_parentheses): Preserve original
value of c_lex_string_translate, and set it to -1 while
running.
(cp_parser_cache_group): Likewise.
(cp_parser_cache_group_1): Renamed.
(cp_parser_asm_operand_list): Remove redundant setting of
c_lex_string_translate.
(cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
Handle chained strings.

From-SVN: r83201
2004-06-15 21:43:21 +00:00
Jerry Quinn 785287145e Makefile.in (EXPR_H): Add insn-config.h...
2004-06-01  Jerry Quinn  <jlquinn@optonline.net>

	* Makefile.in (EXPR_H): Add insn-config.h, function.h,
	$(RTL_H), flags.h, $(TREE_H), $(MACHMODE_H), $(EXPR_H).
	(ALIAS_H, EMIT_RTL_H): New.
	(cselib.o): Replace EXPR_H with EMIT_RTL_H.
	(cfgcleanup.o): Add EMIT_RTL_H.
	(alias.o): Replace EXPR_H with EMIT_RTL_H and ALIAS_H.
	* alias.c: Replace expr.h with emit-rtl.h and alias.h.
	* attribs.c, c-lex.c, c-obj-common.c, c-semantics.c: Remove expr.h.
	* cfgcleanup.c, cselib.c: Replace expr.h with emit-rtl.h.
	* expr.h: Add include guard.  Include function.h, rtl.h, flags.h,
	tree.h, machmode.h, insn-config.h, alias.h, emit-rtl.h.
	(get_varargs_alias_set, get_frame_alias_set, record_base_value,
	record_alias_subset, new_alias_set, can_address_p): Move to alias.h.
	(set_mem_alias_set, set_mem_align, set_mem_expr, set_mem_offset,
	set_mem_size): Move to emit-rtl.h.
	* emit-rtl.h: New.
	* alias.h: New.

From-SVN: r82568
2004-06-02 02:09:45 +00:00
Eric Christopher 2152660651 target-supports.exp (check-iconv-available): New function.
2004-02-26  Eric Christopher  <echristo@redhat.com>

	* lib/target-supports.exp (check-iconv-available): New function.
	* lib/gcc-dg.exp (dg-require-iconv): New function.
	Use above.
        * gcc.dg/charset: New directory.
        * gcc.dg/charset/charset.exp: New file.
        * gcc.dg/charset/asm1.c: Ditto.
        * gcc.dg/charset/asm2.c: Ditto.
        * gcc.dg/charset/asm3.c: Ditto.
        * gcc.dg/charset/asm4.c: Ditto.
        * gcc.dg/charset/asm5.c: Ditto.
        * gcc.dg/charset/attribute1.c: Ditto.
        * gcc.dg/charset/attribute2.c: Ditto.
        * gcc.dg/charset/string1.c: Ditto.
        * g++.dg/charset: New directory.
        * g++.dg/dg.exp: Add here. Special options.
        * g++.dg/charset/charset.exp: New file.
        * g++.dg/charset/asm1.c: Ditto.
        * g++.dg/charset/asm2.c: Ditto.
        * g++.dg/charset/asm3.c: Ditto.
        * g++.dg/charset/asm4.c: Ditto.
        * g++.dg/charset/attribute1.c: Ditto.
        * g++.dg/charset/attribute2.c: Ditto.
        * g++.dg/charset/extern1.cc: Ditto.
        * g++.dg/charset/extern2.cc: Ditto.
        * g++.dg/charset/string1.c: Ditto.

2004-02-26  Eric Christopher  <echristo@redhat.com>

	* c-lex.c (c_lex_string_translate): New variable.
	(lex_string): Use to determine string translation.
	* c-pragma.h: Prototype.
	* c-parse.in (start_string_translation): New. Set above.
	(stop_string_translation): Ditto.
	(attribute, attribute_list, asm_def, asm_stmt,
	asm_operand): Use above functions.
	* cp/parser.c (cp_parser_declaration): Translate strings
	unless token is RID_EXTERN. Set c_lex_string_translate
	for recursive use.
	(cp_parser_asm_definition): Only translate argument strings
	to asms.
	(cp_parser_asm_operand_list): Ditto.
	(cp_parser_attribute_list): Do not translate attribute strings.

From-SVN: r78548
2004-02-27 02:01:10 +00:00
Per Bothner 12f9df4ec5 Represent column numbers using line-map's source_location.
The "next available source_location" is now managed internally by
	line-maps.c rather than by clients.
	* line-map.h (struct line_map):  New field column_bits.
	<from_line>:  Rename field to start_location.
	(struct line_maps):  New fields highest_location and max_column_hint.
	(linemap_check_files_exited):  New declaration.
	(linemap_line_start):  New declaration.
	(linemap_add):  Remove from_line parameter; use highest_location field.
	(SOURCE_LINE, LAST_SOURCE_LINE):  Modify to use column_bits.
	(SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION):  New macros.
	(CURRENT_LINE_MAP):  Remove macro.
	(linemap_position_for_column):  New inline function.
	* line-map.c (linemap_init):  Clear new fields.
	(linemap_check_files_exited):  New function, extracted from ...
	(linemap_free):  Use linemap_check_files_exited.
	(linemap_add):  Remove from_line parameter.  Various updates.
	(linemap_line_start):  New function.
	(linemap_lookeup):  Update for new field names.
	* cpphash.h (struct cpp_reader) <map>:  Field removed.  Because
	linemap_position_for_column may unpredictably change the current map,
	it is cleaner and simpler for us to not cache it in cpp_reader.
	(struct cpp_buffer):  New sysp field.
	Changed warned_cplusplus_comments and from_stage3 to bitfields.
	* cppinit.c (cpp_read_min_file):  pfile->map no longer exists.
	* cpplib.c (do_line, do_linemarker, _cpp_do_file_change):  Get
	current map using linemap_lookup.
	(do_linemarker):  Also set buffer's sysp field.
	(destringize_and_run):  No longer need to decrement current line.
	* cppfiles.c (_cpp_stack_file):  Set sysp from and in buffer.
	(search_path_head, open_file_failed):  Use buffer's sysp.
	(cpp_make_system_header):  Get current map using linemap_lookup.
	Also set buffer's sysp flag.
	* cppmacro.c (_cpp_builtin_macro_text):  Likewise use linemap_lookup.
	* cpphash.h (CPP_INCREMENT_LINE):  New macro.
	(struct cpp_buffer):  Moved fields saved_cur, saved_rlimit to ...
	(struct cpp_reader):  ... and adding saved_line_base field.
	* cpptrad.c (_cpp_overlay_buffer, _cpp_remove_overlay):
	Update accordingly.  Don't adjust line.
	(_cpp_scan_out_logical_line):  Use CPP_INCREMENT_LINE.
	* cpphash.c (CPP_IN_SYSTEM_HEADER):  Replaced macro by ...
	(cpp_in_system_header):  ... new inline function, using buffer's sysp.
	* cpperror.c (_cpp_begin_message):  Update to use cpp_in_system_header.
	* cpplex.c (_cpp_lex_direct):  Likewise.
	* cppmacro.c (_cpp_builtin_macro_text):  Likewise.
	* cppmacro.c (_cpp_create_definition):  Use buffer's sysp field.
	* cpplib.h (struct cpp_token):  Rename line field to src_loc.
	Remove col field as it is now subsumed by src_loc.
	* cpperror.c:  Update various field, parameter, and macro names.
	(print_location):  If col==0, try SOURCE_COLUMN of line.
	(cpp_error):  Use cur_token's src_loc field, rather than line+col.
	* cpplib.c (do_diagnostic):  Token's src_loc fields replaces line+col.
	* cpplex.c (_cpp_process_line_notes, _cpp_lex_direct,
	_cpp_skip_block_comment):  Use CPP_INCREMENT_LINE.
	(_cpp_temp_token):  Replace cpp_token's line+col fields by src_loc.
	(_cpp_get_fresh_line):  Don't need to adjust line for missing newline.
	(_cpp_lex_direct):  Use linemap_position_for_column.
	* c-ppoutput.c (maybe_print_line, print_line):  Don't take map
	parameter.  Instead get it from the line_table global.  Adjust callers.
	(print):  Remove map field.  Replace line field to src_line.
	(init_pp_output, account_for_newlines, maybe_print_line):  Adjust.
	(cb_line_change):  Use SOURCE_COLUMN.  Minor optimizations.
	(pp_file_change):  Use MAIN_FILE_P since we cannot checked print.map.
	Use LAST_SOURCE_LINE_LOCATION to "catch up" after #include.
	* cpptrad.c (copy_comment):  Rename variable.
	* c-lex.c (map):  Remove static variable, for same reason we removed
	cpp_reader's map field.
	(cb_line_change, cb_def_pragma, cb_define, cb_undef):  Hence we need
	to call linemap_lookup.
	(cb_line_change):  Token's line field replaced by src_loc.
	(fe_file_change):  Use MAINFILE_P and LAST_SOURCE_LINE macros.
	Don't save new_map.

	* cpphash.h, cpperror.c, cpplib.h:  Some renames of fileline to
	source_location.

From-SVN: r77663
2004-02-11 07:29:30 -08:00
Per Bothner 8e9ea4d72c Partially revert/redo 2003-10-01 change; fix -fworking-directory.
* c-ppoutput.c (pp_dir_change):  New function.
	* c-common.h (pp_dir_change):  New declaration.
	* cpplib.h (struct cpp_options):  Remove working_directory field.
	* cppinit.c (cpp_find_main_file, cpp_push_main_file):  Merge back to
	(cpp_read_main_file):  as before 10-01.  Call _cpp_stack_file.
	Don't handle -fworking_directory here, but in c_common_post_options.
	(read_original_directory): Don't back up when done.
	Don't clear no-longer used working_directory flag.
	* cpplib.h:  Update declarations to match.
	* c-lex.c (cb_dir_change):  Move to c-opts.c.
	(init_c_lex):  Don't set dir_change callback here, since we want
	to set it even if flag_preprocess_only.
	* c-opts.c (cb_dir_change):  Function moved from c-lex.c.
	(c_common_post_options):  Set dir_change callback.
	Call pp_dir_change if approporiate.
	(finish_options):  Don't call cpp_find_main_file here.	Hence remove
	unneeded parameter and result. Do LC_RENAME for <built-in>.
	(c_common_post_options):  Call cpp_read_main_file here instead.
	(c_common_init):  Update accordingly.
	(push_command_line_include):  Don't cpp_push_main_file.
	Do LC_RENAME rather than LC_LEASE to get back to main file.
	Compared to pre-10-01 version, inline cpp_rename_to_main_file.
	(c_common_parse_file):  Call cpp_read_main_file for subsequent main
	files, but call finish_options for all files.
	* c-opts.c (sanitize_cpp_opts):  Don't set cpp_opts->working_directory.
	* fix-header.c (read_scan_file):  Call cpp_read_main_file instead of
	cpp_find_main_file + cpp_push_main_file.
	* c-lex.c (fe_file_change):  Don't set main_input_filename here.
	* opts.c (handle_options):  Only set main_input_filename first time.

From-SVN: r77303
2004-02-04 22:52:26 -08:00
Kazu Hirata 283334f011 alloc-pool.c, c-lex.c, c-pragma.h, c-semantics.c, cfghooks.c,
cfghooks.h, cfglayout.c, cfgloopmanip.c, debug.c, debug.h,
	flow.c, genextract.c, ggc-common.c, ggc-page.c, ggc.h,
	ifcvt.c, jump.c, loop-unswitch.c, timevar.c, timevar.def,
	tree-optimize.c, vmsdbgout.c, config/fp-bit.c,
	config/alpha/alpha.c, config/alpha/alpha.h,
	config/alpha/alpha.md, config/alpha/unicosmk.h,
	config/alpha/vms.h, config/arm/linux-elf.h, config/avr/avr.c,
	config/c4x/c4x-protos.h, config/c4x/c4x.md,
	config/d30v/d30v.h, config/frv/frv.md, config/frv/frvbegin.c,
	config/frv/frvend.c, config/i386/cygming.h,
	config/i386/djgpp.h, config/i386/emmintrin.h,
	config/i386/gthr-win32.c, config/i386/i386-interix.h,
	config/i386/i386-protos.h, config/i386/openbsd.h,
	config/i386/winnt.c, config/i386/xm-mingw32.h,
	config/i386/xmmintrin.h, config/ia64/ia64.md,
	config/iq2000/iq2000.md, config/m32r/m32r.md,
	config/m68k/m68k.md, config/mcore/mcore-elf.h,
	config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h,
	config/mips/iris5gas.h, config/mips/iris6.h,
	config/mips/iris6gas.h, config/mips/linux.h,
	config/mips/mips.md, config/mips/netbsd.h,
	config/mips/openbsd.h, config/mips/windiss.h,
	config/pa/fptr.c, config/rs6000/aix.h,
	config/rs6000/altivec.h, config/rs6000/darwin.h,
	config/rs6000/xcoff.h, config/s390/s390-protos.h,
	config/s390/s390.c, config/s390/s390.h, config/s390/s390.md,
	config/sh/netbsd-elf.h, config/sh/sh.h, config/sh/vxworks.h,
	config/sparc/sol2.h: Update copyright.

From-SVN: r77018
2004-01-31 02:07:12 +00:00
Giovanni Bajo 7625e73d57 c-lex.c (c_lex): Rename to...
* c-lex.c (c_lex): Rename to...
	(c_lex_with_flags): Add new parameter to get CPP flags.
	(c_lex): Thunk to c_lex_with_flags while keeping the old interface.
	* c-pragma.h (c_lex_with_flags): Declare.

From-SVN: r76844
2004-01-29 04:19:01 +00:00
Per Bothner f4b2bde73f c-lex.c (fe_file_change): Handle a NULL new_map.
* c-lex.c (fe_file_change):  Handle a NULL new_map.
	* fix-header.c (cb_file_change):  Likewise.
	* c-ppoutput.c (pp_file_change):  Likewise.

From-SVN: r72011
2003-10-02 00:03:42 -07:00
Per Bothner efef2a5f2a c-lex.c (src_line): Remove unneeded static variable.
* c-lex.c (src_line):   Remove unneeded static variable.
	(cb_line_change):  Set input_line directly, instead of src_line.
	(get_non_padding_token):  We no longer need to compensate for the
	"horrible things" the C++ front-end does with the current line number,

From-SVN: r72010
2003-10-01 23:54:46 -07:00
Alexandre Oliva 7b9a5a662b c-ppoutput.c (cb_line_change): Revert 2003-08-04's change.
* c-ppoutput.c (cb_line_change): Revert 2003-08-04's change.
* c-lex.c (cb_line_change): Skip line changing whenever
c-ppoutput.c would.

From-SVN: r71381
2003-09-14 13:56:18 +00:00
Mike Stump 70b160738b * c-lex.c (fe_file_change): Don't transform to_line with SOURCE_LINE.
From-SVN: r71328
2003-09-11 22:03:22 -07:00
Alexandre Oliva b20d9f0c07 c.opt: Introduce -fworking-directory.
* c.opt: Introduce -fworking-directory.
* doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it.
* c-common.h (flag_working_directory): Declare.
* c-common.c (flag_working_directory): Define.
* c-opts.c (c_common_handle_options): Set it.
(sanitize_cpp_opts): Set...
* cpplib.h (struct cpp_options): ... working_directory option.
(struct cpp_callbacks): Add dir_change.
* cppinit.c (read_original_filename): Call...
(read_original_directory): New.  Look for # 1 "directory//"
and process it.
(cpp_read_main_file): Call dir_change callback if working_directory
option is set.
* gcc.c (cpp_unique_options): Pass -g*.
* c-lex.c (cb_dir_change): New.
(init_c_lex): Set dir_change callback.
* toplev.c (src_pwd): New static variable.
(set_src_pwd, get_src_pwd): New functions.
* toplev.h (get_src_pwd, set_src_pwd): Declare.
* dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd().
* dwarf2out.c (gen_compile_unit_die): Likewise.
* dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise.

From-SVN: r70189
2003-08-05 21:15:57 +00:00
Geoffrey Keating 18c8152070 c-common.c (allow_pch): Remove.
2003-07-29  Geoffrey Keating  <geoffk@apple.com>

	* c-common.c (allow_pch): Remove.
	* c-common.h (allow_pch): Remove.
	(c_common_no_more_pch): Declare.
	* c-lex.c (c_lex): Call c_common_no_more_pch when appropriate.
	* c-pch.c: Include hosthooks.h.
	(c_common_valid_pch): Don't check allow_pch.
	(c_common_read_pch): Clear valid_pch to prevent reading PCH files.
	(c_common_no_more_pch): New.
	* ggc-common.c: Include hosthooks.h.
	(gt_pch_save): Call gt_pch_get_address.
	(gt_pch_restore): Call gt_pch_use_address.
	* hooks.c (hook_voidp_size_t_null): New.
	(hook_bool_voidp_size_t_false): New.
	* hooks.h (hook_voidp_size_t_null): New.
	(hook_bool_voidp_size_t_false): New.
	* hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): New.
	(HOST_HOOKS_GT_PCH_USE_ADDRESS): New.
	(HOST_HOOKS_INITIALIZER): Add HOST_HOOKS_GT_PCH_GET_ADDRESS,
	HOST_HOOKS_GT_PCH_USE_ADDRESS.
	* hosthooks.h (struct host_hooks): Add gt_pch_get_address,
	gt_pch_use_address.
	* doc/hostconfig.texi (Host Common): Document
	HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS.
	* Makefile.in (c-pch.o): Depend on hosthooks.h.
	(ggc-common.o): Likewise.

	* config/rs6000/host-darwin.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Define.
	(HOST_HOOKS_GT_PCH_USE_ADDRESS): Define.
	(pch_address_space): New.
	(darwin_rs6000_gt_pch_get_address): New.
	(darwin_rs6000_gt_pch_use_address): New.

Index: cp/ChangeLog
2003-07-29  Geoffrey Keating  <geoffk@apple.com>

	* parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead
	of setting valid_pch by hand.

From-SVN: r69944
2003-07-29 23:36:53 +00:00
Kaveh R. Ghazi 703ad42b4b alias.c [...]: Remove unnecessary casts.
* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
	postreload.c prefix.c print-tree.c protoize.c ra-build.c
	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
	casts.

From-SVN: r69587
2003-07-19 14:47:15 +00:00