Commit Graph

600 Commits

Author SHA1 Message Date
Mark Mitchell 4bb8ca281f re PR c++/10779 (Error cascade for unknown type in function prototype)
* c-common.h (c_parse_error): Declare it.
	* c-common.c (c_parse_error): New function.
	* c-parse.y (yyerror): Use it.

	* parser.c (struct cp_parser): Add in_template_argument_list_p.
	(cp_parser_error): Use c_parse_error.
	(cp_parser_name_lookup_error): New function.
	(cp_parser_new): Initialize it.
	(cp_parser_declarator): Add parenthesized_p parameter.
	(cp_parser_nested_name_specifier_opt): Use
	cp_parser_name_lookup_error.
	(cp_parser_parenthesized_expression_list): Improve comments.
	(cp_parser_condition): Adjust call to cp_parser_declarator.
	(cp_parser_template_parameter): Adjust call to
	cp_parser_parameter_declaration.
	(cp_parser_template_argument_list): Set
	in_template_argument_list_p.
	(cp_parser_explicit_instantiation): Adjust call to
	cp_parser_declarator.
	(cp_parser_simple_type_specifier): Remove unncessary code.
	(cp_parser_using_declaration): Use cp_parser_name_lookup_error.
	(cp_parser_init_declarator): Handle member function definitions.
	(cp_parser_direct_declarator): Adjust call to
	cp_parser_declarator.
	(cp_parser_type_id): Adjust call to cp_parser_declarator.
	(cp_parser_parameter_declaration_list): Avoid backtracking where
	possible.
	(cp_parser_parameter_declaration): Add parenthesized_p parameter.
	(cp_parser_function_definition): Remove.
	(cp_parser_member_declaration): Do not backtrack to look for
	function definitions.
	(cp_parser_exception_declaration): Adjust call to
	cp_parser_declarator.
	(cp_parser_single_declaration): Handle function definitions via
	cp_parser_init_declarator.
	(cp_parser_save_member_function_body): New function.

	PR c++/10779
	PR c++/12160
	* g++.dg/parse/error3.C: New test.
	* g++.dg/parse/error4.C: Likewise.
	* g++.dg/abi/mangle4.C: Tweak error messages.
	* g++.dg/lookup/using5.C: Likewise.
	* g++.dg/other/error2.C: Likewise.
	* g++.dg/parse/typename5.C: Likewise.
	* g++.dg/parse/undefined1.C: Likewise.
	* g++.dg/template/arg2.C: Likewise.
	* g++.dg/template/ttp3.C: Likewise.
	* g++.dg/template/type1.C: Likewise.
	* g++.old-deja/g++.other/crash32.C: Likewise.
	* g++.old-djea/g++.pt/defarg8.C: Likewise.

From-SVN: r74624
2003-12-15 06:28:23 +00:00
Kazu Hirata d91edf86b0 ChangeLog.7: Fix comment typos.
* ChangeLog.7: Fix comment typos.
	* c-common.c: Likewise.
	* c-pretty-print.c: Likewise.
	* cgraphunit.c: Likewise.
	* et-forest.h: Likewise.
	* expr.c: Likewise.
	* gcse.c: Likewise.
	* genautomata.c: Likewise.
	* genrecog.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-zone.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* loop.c: Likewise.
	* optabs.c: Likewise.
	* pretty-print.h: Likewise.
	* regrename.c: Likewise.
	* rtl.h: Likewise.
	* sched-rgn.c: Likewise.
	* target.h: Likewise.
	* value-prof.c: Likewise.
	* web.c: Likewise.

From-SVN: r73795
2003-11-21 06:52:23 +00:00
Matt Austern 968b41a166 c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY field instead of hanging an attribute object off the decl.
* c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY
	field instead of hanging an attribute object off the decl.
	* tree.h (DECL_VISIBLITY): New accessor macro for
	symbol_visibility field in struct tree_decl.
	(enum symbol_visibility): Move definition to before tree_decl.
	(struct tree_decl): Define new two-bit field, symbol_visibility.
	(decl_visibility): Remove declaration.
	* varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY
	instead of decl_visibility.
	(default_binds_local_p_1):  Use DECL_VISIBILITY	instead of
	decl_visibility.
	(decl_visibility): Remove.
	* cp/decl.c (duplicate_decls): copy DECL_VISIBILITY field.
	* cp/method.c (use_thunk): give thunk same visibility as function.
	* cp/optimize.c (maybe_clone_body): copy DECL_VISIBILITY field.

From-SVN: r73320
2003-11-06 22:08:26 +00:00
Joseph Myers ac054e28e6 c-common.c (expand_tree_builtin): Ensure creal and cimag functions do not return lvalues.
* c-common.c (expand_tree_builtin): Ensure creal and cimag
	functions do not return lvalues.

testsuite:
	* gcc.dg/builtins-28.c: New test.

From-SVN: r72727
2003-10-20 23:03:34 +01:00
Zack Weinberg d1d3865f99 c-common.c (registered_builtin_types): New static.
* c-common.c (registered_builtin_types): New static.
	(c_common_type_for_mode): Consult registered_builtin_types.
	(c_register_builtin_type): Add type to registered_builtin_types.
	* optabs.c (init_floating_libfuncs): Initialize libfuncs for
	all MODE_FLOAT modes, not just the ones corresponding to
	float_type_node, double_type_node, and long_double_type_node.

From-SVN: r72711
2003-10-20 18:28:27 +00:00
Steven Bosscher 1998463c54 c-common.c (c_common_truthvalue_conversion): Warn if the address of a non-weak function is used as a truth value.
gcc/
	* c-common.c (c_common_truthvalue_conversion): Warn if the
	address of a non-weak function is used as a truth value.

cp/
	* cvt.c (ocp_convert): Move warning to C common code.

testsuite/
	* gcc.dg/weak/weak-3.c: Fix for new warning.

From-SVN: r72409
2003-10-12 22:09:29 +00:00
Jason Merrill 4b011bbf6b re PR middle-end/6392 (Problems with __restrict__ type qualifier (array))
PR c++/6392
        * cp/tree.c (build_cplus_array_type): Handle all quals the same.
        (cp_build_qualified_type_real): Look through arrays first.
        * c-common.c (c_build_qualified_type): Look through arrays first.
        (c_apply_type_quals_to_decl): Look through arrays.

        * c-common.c (c_apply_type_quals_to_decl): Unset TREE_READONLY for
        types with constructors.

From-SVN: r72259
2003-10-09 04:38:46 -04:00
Ziemowit Laski 264fa2db22 MERGE OF objc-improvements-branch into MAINLINE.
2003-09-24  Ziemowit Laski  <zlaski@apple.com>

        MERGE OF objc-improvements-branch into MAINLINE.
	See 'gcc/ChangeLog' and 'gcc/testsuite/ChangeLog' for
	the gory details.

From-SVN: r71748
2003-09-25 01:26:01 +00:00
Nathan Sidwell ff42324ea3 * c-common.c (c_common_type_for_mode): Check for VOIDmode.
From-SVN: r71732
2003-09-24 09:15:21 +00:00
Richard Henderson 3504b199c2 c-common.c (c_common_signed_or_unsigned_type): Examine mode, not precision.
* c-common.c (c_common_signed_or_unsigned_type): Examine mode,
        not precision.
	* g++.dg/opt/enum1.C: New.

From-SVN: r71677
2003-09-22 23:04:14 -07:00
Richard Henderson ddd2d57e72 c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.

From-SVN: r71619
2003-09-20 22:07:20 -07:00
Roger Sayle 96123432ff tree.def (FFS_EXPR, [...]): Delete unused tree codes.
* tree.def (FFS_EXPR, CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR,
	PARITY_EXPR): Delete unused tree codes.
	* c-common.c (c_common_truthvalue_conversion): Delete references
	to FFS_EXPR and POPCOUNT_EXPR.
	* c-pretty-print.c (pp_c_postfix_expression): Remove FFS_EXPR.
	(pp_c_expression): Likewise.
	* expr.c (expand_expr): Delete RTL expansion of FFS_EXPR, CLZ_EXPR,
	CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR.
	* fold-const.c (tree_expr_nonnegative_p): Remove FFS_EXPR, CLZ_EXPR,
	CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR.  Add support for calls to
	BUILT_IN_FFS, BUILT_IN_PARITY and BUILT_IN_POPCOUNT and their long
	and long long variants.

	* cp/lex.c (init_operators): Remove operator_name_info for FFS_EXPR.
	* cp/class.c (instantiate_type): Remove FFS_EXPR case.

	* f/com.c (ffecom_overlap_): Remove FFS_EXPR case.
	(ffecom_tree_canonize_ref_): Likewise.
	(ffe_truthvalue_conversion): Likewise.

	* java/expr.c (java_truthvalue_conversion): Remove FFS_EXPR case.
	* java/check-init.c (check_init): Likewise.

From-SVN: r71525
2003-09-18 15:06:02 +00:00
Jason Merrill 72954a4f44 c-common.c (handle_warn_unused_result_attribute): New function.
* c-common.c (handle_warn_unused_result_attribute): New function.
	(c_common_attribute_table): Add warn_unused_result.
	(c_expand_expr): Issue warning when result of inlined function
	with warn_unused_result attribute is ignored.
	* calls.c (expand_call): Issue warning when result of function
	with warn_unused_result attribute is ignored.
	* c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Define.
	* expr.c (expr_wfl_stack): Define.
	(expand_expr) <case EXPR_WITH_FILE_LOCATION>: If ignore,
	pass const0_rtx as target.  Chain locations into expr_wfl_stack.
	* tree-inline.c (expand_call_inline): Set STMT_EXPR_WARN_UNUSED_RESULT
	bit if inlined function has warn_unused_result attribute.
	* input.h (expr_wfl_stack): Declare.
	* doc/extend.texi: Document warn_unused_result attribute.

	* gcc.dg/attr-warn-unused-result.c: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r71424
2003-09-16 09:58:27 +02:00
Andreas Jaeger c034f12167 invoke.texi (Warning Options): Describe -Wold-style-definition.
2003-09-15  Andreas Jaeger  <aj@suse.de>
            Kaveh R. Ghazi <ghazi@caip.rutgers.edu>

	* doc/invoke.texi (Warning Options): Describe -Wold-style-definition.
	* c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition.
	* c-parse.in: Warn about old-style parameter definition.
	* c-common.c: Define warn_old_style_defintion.
	* c-common.h: Declare it.
	* c.opt: Add Wold-style-defintion.

testsuite:
2003-09-15  Andreas Jaeger  <aj@suse.de>

	* gcc.dg/Wold-style-definition-1.c: New test.

From-SVN: r71400
2003-09-15 11:31:17 +02:00
Mark Mitchell 9649812aae langhooks-def.h (lhd_register_builtin_type): New function.
* langhooks-def.h (lhd_register_builtin_type): New function.
	(LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
	* langhooks.h (lang_hooks_for_types): Add register_builtin_type.
	* langhooks.c (lhd_register_builtin_type): New function.
	* c-common.h (c_register_builtin_type): Declare.
	* c-common.c (c_register_builtin_type): New function.
	* c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.
	* config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg,
	__float80, and __float128 macros.
	* config/ia64/ia64.c (ia64_init_builtins): Create __fpreg,
	__float80, and __float128 types.

	* cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.

	* gcc.dg/ia64-types1.c: New test.
	* gcc.dg/ia64-types2.c: Likewise.

From-SVN: r71227
2003-09-09 03:35:31 +00:00
Matt Austern 47ab33b220 Correct the behavior of __func__ for C++ special member functions.
* c-common.c (fname_as_string): Use lang_hooks.decl_printable_name
	with verbosity 0, instead of DECL_NAME, for human-readable string.
	* g++.dg/ext/fnname1.C: New test. (__func__ for C++.)
	* g++.dg/ext/fnname2.C: Likewise.
	* g++.dg/ext/fnname3.C: Likewise.

From-SVN: r71088
2003-09-04 21:32:48 +00:00
Gabriel Dos Reis 12ea3302e6 pretty-print.h (pp_maybe_newline_and_indent): New macro.
* pretty-print.h (pp_maybe_newline_and_indent): New macro.
	* c-pretty-print.h (c_pretty_printer): Now typedef to the
	structure.  Be consistent with pretty-print.h abd cxx-pretty-print.h
	(struct c_pretty_print_info): Document.  Add new fields.
	(pp_type_specifier_seq): Rename from pp_c_type_specifier.
	(pp_direct_abstract_declarator): New macro.
	(pp_ptr_operator): Likewise.
	(pp_simple_type_specifier): Likewise.
	(pp_expression): Likewise.
	(pp_parameter_list): Rename from pp_parameter_declaration.
	* c-pretty-print.c (pp_c_whitespace): Now a function.
	(pp_c_left_paren): Likewise.
	(pp_c_right_paren): Likewise.
	(pp_c_dot): Likewise.
	(pp_c_ampersand): Likewise.
	(pp_c_arrow): Likewise.
	(pp_c_semicolon): Likewise.
	(pp_c_type_cast): New function.
	(pp_c_space_for_pointer_operator): Likewise.
	(pp_c_call_argument_list): Likewise.
	(pp_c_cv_qualifier): Adjust prototype.
	(pp_c_type_qualifier_list): Likewise.
	(pp_c_pointer): Likewise.  Handle REFERENCE_TYPE here.
	(pp_c_type_specifier): Rename from pp_c_simple_type_specifier.
	Adjust to follow standard grammar.
	(pp_c_specifier_qualifier_list): Adjusr prototype.  Handle
	REFERENCE_TYPE.  Tidy.
	(pp_c_parameter_type_list): Adjust prototype.  Tidy.
	(pp_c_parameter_declaration): Remove.
	(pp_c_abstract_declarator): Adjust prototype.
	(pp_c_direct_abstract_declarator): Likewise.
	(pp_c_type_id): Likewise.
	(pp_c_storage_class_specifier): Likewise.
	(pp_c_function_specifier): Likewise.
	(pp_c_declaration_specifiers): Likewise.
	(pp_c_direct_declarator): Likewise.
	(pp_c_declarator): Likewise.
	(pp_c_declarator): Likewise.
	(pp_c_declaration): Likewise.
	(pp_c_attributes): Likewise.  Tidy.
	(pp_c_function_definition): Adjust prototype.
	(pp_c_char): Likewise.
	(pp_c_string_literal): Likewise.
	(pp_c_integer_constant): Likewise.
	(pp_c_character_constant): Likewise.
	(pp_c_bool_constant): Likewise.
	(pp_c_enumeration_constant): Likewise.
	(pp_c_floating_constant): Likewise.
	(pp_c_constant): Likewise.
	(pp_c_identifier): Likewise.
	(pp_c_primary_expression): Likewise.  Remove TARGET_EXPR case.  Tidy.
	(pp_c_initializer): Adjust prototype.
	(pp_c_init_declarator): Likewise.
	(pp_c_initializer_list): Likewise.
	(pp_c_id_expression): Likewise.
	(pp_c_postfix_expression): Likewise.
	(pp_c_expression_list): Likewise.
	(pp_c_unary_expression): Likewise.
	(pp_c_cast_expression): Likewise.
	(pp_c_multiplicative_expression): Likewise.
	(pp_c_additive_expression): Likewise.
	(pp_c_shift_expression): Likewise.
	(pp_c_relational_expression): Likewise.
	(pp_c_equality_expression): Likewise.
	(pp_c_and_expression): Likewise.
	(pp_c_exclusive_or_expression): Likewise.
	(pp_c_inclusive_or_expression): Likewise.
	(pp_c_logical_and_expression): Likewise.
	(pp_c_logical_or_expression): Likewise.
	(pp_c_conditional_expression): Likewise.
	(pp_c_assignment_expression): Likewise.
	(pp_c_expression): Likewise.  Tidy.
	(pp_c_statement): Likewise.  Document.
	(pp_c_pretty_printer_init): Adjust prototype. Tidy.

	* c-lang.c (c_initialize_diagnostics): Update.
	* c-common.h (strip_pointer_operator): Declare.
	* c-common.c (strip_pointer_operator): Define.

cp/
	* cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag.
	(cxx_pretty_printer): Adjust base type.
	(pp_cxx_function_specifier): Declare.
	* cxx-pretty-print.c (pp_cxx_whitespace): New macro.
	(pp_cxx_left_paren): Likewise.
	(pp_cxx_right_paren): Likewise.
	(pp_cxx_dot): Likewise.
	(pp_cxx_arrow): Likewise.
	(pp_cxx_semicolon): Likewise.
	(pp_cxx_identifier): Likewise.
	(pp_cxx_cv_qualifier_seq): Likewise.
	(pp_cxx_storage_class_specifier): Likewise.
	(pp_cxx_expression_list): Likewise.
	(pp_cxx_space_for_pointer_operator): Likewise.
	(pp_cxx_init_declarator): Likewise.
	(pp_cxx_call_argument_list): Likewise.
	(pp_cxx_nonconsecutive_character): Tidy.
	(pp_cxx_conversion_function_id): New function.
	(pp_cxx_template_id): Likewise.
	(pp_cxx_class_name): Likewise.
	(pp_cxx_template_keyword_if_needed): Likewise.
	(pp_cxx_nested_name_specifier): Likewise.
	(pp_cxx_unqualified_id): Tidy
	(pp_cxx_qualified_id): Handle more nodes.
	(pp_cxx_primary_expression): Tidy.
	(pp_cxx_postfix_expression): Likewise.
	(pp_cxx_new_expression): Tidy.
	(pp_cxx_delete_expression): Likewise.
	(pp_cxx_cast_expression): New function.
	(pp_cxx_pm_expression): Tidy.
	(pp_cxx_conditional_expression): Likewise.
	(pp_cxx_assignment_operator): New function.
	(pp_cxx_assignment_expression): Tidy.
	(pp_cxx_expression): New function.
	(pp_cxx_function_specifier): Likewise.
	(pp_cxx_decl_specifier_seq): Likewise.
	(pp_cxx_simple_type_specifier): Tidy.
	(pp_cxx_type_specifier_seq): Likewise.
	(pp_cxx_ptr_operator): New function.
	(pp_cxx_implicit_parameter_type): Likewise.
	(pp_cxx_parameter_declaration): Tidy.
	(pp_cxx_parameter_declaration_clause): New function.
	(pp_cxx_exception_specification): Likewise.
	(pp_cxx_direct_declarator): Tidy.
	(pp_cxx_declarator): Likewise.
	(pp_cxx_ctor_initializer): New function.
	(pp_cxx_function_definition): Likewise.
	(pp_cxx_abstract_declarator): Tidy.
	(pp_cxx_direct_abstract_declarator): Likewise.
	(pp_cxx_type_id): Likewise.
	(pp_cxx_exception_declaration): New function.
	(pp_cxx_statement): Likewise.
	(pp_cxx_simple_declaration): Likewise.
	(pp_cxx_template_parameter_list): Likewise.
	(pp_cxx_template_parameter): Likewise.
	(pp_cxx_template_declaration): Likewise.
	(pp_cxx_explicit_specialization): Likewise.
	(pp_cxx_explicit_instantiation): Likewise.
	(pp_cxx_declaration): Tidy.
	(pp_cxx_pretty_printer_init): Initialize more fields.

From-SVN: r70777
2003-08-25 19:10:50 +00:00
Mark Mitchell 43dc123f52 re PR target/8795 ([PPC] Altivec related bugs concerning gcc 3.3 and mainline)
PR c++/8795
	* tree.h (build_method_type_directly): Declare.
	* c-common.c (handle_vector_size_attributes): Handle METHOD_TYPEs.
	(vector_size_helper): Likewise.
	* tree.c (build_method_type_directly): New function.
	(build_method_type): Use it.

	PR c++/8795
	* cp-tree.h (build_cplus_method_type): Remove.
	* call.c (standard_conversion): Use build_method_type_directly
	instead of build_cplus_method_type.
	* class.c (build_clone): Likewise.
	(adjust_clone_args): Likewise.
	* decl.c (build_ptrmem_type): Likewise.
	(grokdeclarator): Likewise.
	(check_function_type): Likewise.
	* decl2.c (grok_method_quals): Likewise.
	(maybe_retrofit_in_chrg): Likewise.
	* pt.c (copy_default_args_to_explicit_spec): Likewise.
	(tsubst_function_type): Likewise.
	(tsubst): Likewise.
	* tree.c (build_cplus_method_type): Remove.
	* typeck.c (merge_types): Use build_method_type_directly.

	PR c++/8795
	* g++.dg/ext/altivec-1.C: New test.

From-SVN: r70773
2003-08-25 15:47:43 +00:00
Mark Mitchell b6343a3395 re PR middle-end/11996 (Compiling libjava ICE's.)
PR java/11996
	Revert this change:
	2003-08-19  Mark Mitchell  <mark@codesourcery.com>
	* c-common.c (c_common_signed_or_unsigned_type): Correctly handle
	types with precisions other than those given by native machine
	modes.

From-SVN: r70625
2003-08-20 22:36:08 +00:00
Mark Mitchell 4b0d3cbe3e re PR c++/11946 (fun and merriment with enums as function arguments)
PR c++/11946
	* convert.c (convert_to_integer): Use CONVERT_EXPR (instead of
	NOP_EXPR) when necessary.
	* c-common.c (c_common_signed_or_unsigned_type): Correctly handle
	types with precisions other than those given by native machine
	modes.

	PR c++/11684
	* cp-tree.h (grok_op_properties): Change prototype.
	* decl.c (grok_op_properties): Add complain parameter.
	(grokfndecl): Pass it.
	* pt.c (tsubst_decl): Adjust accordingly.

	PR c++/10926
	* decl.c (start_method): Return immediately if push_template_decl
	does not like the declaration.
	* pt.c (push_template_decl_real): Disallow member template
	destructors.

	PR c++/11036.C
	* cp-tree.h (add_binding): Add prototype.
	* class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate.
	(maybe_warn_about_overly_private_class): Use
	CLASSTYPE_DESTRUCTORS.
	(pushclass): Adjust call to set_identifier_type_value.
	* decl.c (add_binding): Give it external linkage.
	(push_local_binding): Adjust call to add_binding.
	(push_class_binding): Likewise.
	(set_identifier_type_value_with_scope): Change prototype.  Use
	add_binding for global bindings.
	(set_identifier_type_value): Adjust accordingly.
	(pushtag): Likewise.
	(pushdecl): Use set_identifier_type_value, not
	set_identifier_type_value_with_scope.
	(pushdecl_namespace_level): Adjust calls to
	SET_IDENTIFIER_TYPE_VALUE to pass a DECL.
	(pushdecl_class_level): Likewise.
	(lookup_tag): Use select_decl.
	(select_decl): Improve comment.
	(record_builtin_type): Do not call pushdecl.
	(cxx_init_decl_processing): Do not call xref_tag for bad_alloc.
	(cp_finish_decl): Adjust call to set_identifier_type_value.
	(check_elaborated_type_specifier): Improve checks for invalid uses
	of typedefs.
	(xref_tag): Adjust call to check_elaborated_type_specifier.
	* decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR.
	* name-lookup.c (set_namespace_binding): Use add_binding.
	* parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL,
	rather than an IDENTIFIER_NODE, to represent built-in types, if
	requested by the caller.
	(cp_parser_postfix_expression): Adjust call.
	(cp_parser_type_specifier): Likewise.
	(cp_parser_elaborated_type_specifier): Adjust call to
	check_elaborated_type_specifier.
	* typeck2.c (build_functional_cast): Do not perform name lookups.

	PR c++/10717
	* decl.c (expand_static_init): Remove unncessary code.

	PR c++/10926
	* g++.dg/template/dtor2.C: New test.

	PR c++/11684
	* g++.dg/template/operator1.C: New test.
	* g++.dg/parse/operator4.C: New test.

	PR c++/11946.C
	* g++.dg/expr/enum1.C: New test.
	* gcc.dg/c99-bool-1.c: Remove bogus warning.

	PR c++/11036.C
	* g++.dg/parse/elab2.C: New test.
	* g++.dg/parse/typedef4.C: Change error message.
	* g++.old-deja/g++.robertl/eb133.C: Remove bogus error markers.
	* g++.old-deja/g++.robertl/eb133a.C: Remove bogus error markers.
	* g++.old-deja/g++.robertl/eb133b.C: Remove bogus error markers.

From-SVN: r70593
2003-08-20 07:06:47 +00:00
Kazu Hirata a98ebe2e37 builtins.c: Fix comment typos.
* builtins.c: Fix comment typos.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-pretty-print.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cgraphunit.c: Likewise.
	* cppfiles.c: Likewise.
	* dwarfout.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* haifa-sched.c: Likewise.
	* pretty-print.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.

From-SVN: r70583
2003-08-19 23:22:00 +00:00
Kazu Hirata 59e4e217ae c-common.c: Fix comment formatting.
* c-common.c: Fix comment formatting.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* cppinit.c: Likewise.
	* cpplib.h: Likewise.
	* emit-rtl.c: Likewise.
	* input.h: Likewise.
	* line-map.h: Likewise.
	* opts.c: Likewise.
	* opts.h: Likewise.
	* simplify-rtx.c: Likewise.

From-SVN: r70577
2003-08-19 21:04:38 +00:00
Andrew Pinski 02a2edc088 *** empty log message ***
From-SVN: r70573
2003-08-19 13:12:44 -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
Roger Sayle 03aa99d49f c-common.c (flag_noniso_default_format_attributes): Delete.
* c-common.c (flag_noniso_default_format_attributes): Delete.
	(built_in_attribute): Don't define/undefine DEF_FN_ATTR.
	(c_attrs_initialized): Delete.
	(c_common_nodes_and_builtins): Don't test c_attrs_initialized,
	always call c_init_attributes.
	(c_init_attributes): Don't define/undefine DEF_FN_ATTR.  Don't
	set c_attrs_initialized when done.
	(c_common_insert_default_attributes): Delete.
	* c-common.h (flag_noniso_default_format_attributes): Delete.
	(c_coomon_insert_default_attributes): Delete prototype.
	* c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set
	flag_noniso_default_format_attributes.

	* c-decl.c (c_insert_default_attributes): Delete.
	* c-tree.h (c_insert_default_attributes): Delete prototype.

	* attribs.c (decl_attributes): Don't call insert_default_attributes
	langhook.  Update function description comment.
	* langhooks.h (lang_hooks): Remove insert_default_attributes field.
	* langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete.
	* c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
	* system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro.

cp/
	* decl.c (cxx_insert_default_attributes): Delete.
	* cp-tree.h (cxx_insert_default_attributes): Don't prototype.
	* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.

objc/
	* objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.

From-SVN: r70155
2003-08-04 20:44:20 +00:00
Roger Sayle 178b2b9f0f builtin-types.def (BT_SSIZE): New primitive type.
* builtin-types.def (BT_SSIZE): New primitive type.
	(BT_FN_INT_PTR_CONST_STRING_VALIST_ARG,
	BT_FN_STRING_CONST_STRING_CONST_STRING_INT,
	BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR,
	BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR): New function types.
	* builtins.def (BUILT_IN_DCGETTEXT, BUILT_IN_DGETTEXT,
	BUILT_IN_FSCANF, BUILT_IN_GETTEXT, BUILT_IN_STRFMON,
	BUILT_IN_STRFTIME, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): New builtins.
	* builtin-attrs.def: Remove DEF_FN_ATTR construct and the last
	few functions that define default attributes using it.
	* c-common.c (c_common_insert_default_attributes): Do nothing.

	* doc/extend.texi: Document these "new" builtins.

From-SVN: r70113
2003-08-03 03:23:18 +00:00
Jan Hubicka a0c8285b03 re PR c/10320 (gcc 3.4 gets rid of static inline function that does not get inlined)
* gcse.c (insert_store): Ignore fake edges.

	* c-common.c (flag_vtable_gc): Kill.
	* c-common.g (flag_vtable_gc): Kill.
	* c-opts (c_common_handle_option): Kill.
	* c.opt (fvtable-gc): Kill.
	* final.c (final_scan_insn): Do not call assemble_vtable_entry.
	* output.h (assemble_vtable_entry, assemble_vtable_inherit): Kill.
	* varasm.c (assemble_vtable_entry, assemble_vtable_inherit): Kill.

	* invoke.texi (-ftable-gc): Kill documentation.

	PR C/10320
	* tree-inline.c (inlinable_function_p): Don't set DECL_UNINLINABLE
	just because function body is missing.

	* i386.c (pic_symbolic_operand): Properly detect RIP relative unspecs.

	* class.c (build_vtable_entry_ref): Kill.
	(build_vtbl_ref_1): Do not call build_vtable_entry_ref.
	(build_vfn_ref): Do not call build_vtable_entry_ref.
	* cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill.
	* cp-tree.h (prepare_assemble_variable): Kill.
	* cp-decl.c (prepare_assemble_variable): Kill.

From-SVN: r69964
2003-07-30 17:27:17 +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
Mark Mitchell 7b6d72fcfb re PR c++/11667 (wider-than-int enums never compare equal to 0)
PR c++/11667
	* c-common.c (shorten_compare): Take into account differences
	between C and C++ representation for enumeration types.
	* tree.h (set_min_and_max_values_for_integral_type): Declare.
	* stor-layout.c (set_min_and_max_values_for_integral_type): New
	function, broken out from ...
	(fixup_signed_type): ... here and ...
	(fixup_unsigned_type): ... here.

	PR c++/11667
	* call.c (standard_conversion): Allow all integral->enumeral
	conversions, after marking them as bad.
	* decl.c (finish_enum): Make sure that all enumerators are
	properly converted to the underlying type.
	(build_enumerator): Set DECL_CONTEXT for namespace-scope
	enumeration types.
	* pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly.
	(tsubst_enum): Tidy.

	* Make-lang.in (typeck.o): Depend on convert.h.
	(class.o): Likewise.
	(rtti.o): Likewise.
	* call.c: Include convert.h.
	(convert_arg_to_ellipsis): Use convert_to_real.
	* class.c: Include convert.h.
	(build_base_path): Use convert_to_integer.
	* rtti.c: Include convert.h.
	(build_headof): Use convert_to_integer.
	* typeck.c: Include convert.h.
	(decay_conversion): Use convert_to_integer.
	(build_unary_op): Use build_nop.
	(get_delta_difference): Use convert_to_integer.
	(build_ptrmemfunc): Avoid unncessary conversions.

From-SVN: r69909
2003-07-29 01:14:24 +00:00
Hans-Peter Nilsson 85617eba1e c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn when warn_declaration_after_statement.
* c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn
	when warn_declaration_after_statement.  Call pedwarn_c90, not
	pedwarn.  Correct message: it's "ISO C90", not "ISO C89".
	* c-common.c (warn_declaration_after_statement): Define.
	* c-common.h (warn_declaration_after_statement): Declare.
	* c.opt (Wdeclaration-after-statement): New.
	* c-errors.c (pedwarn_c90): New function.
	* c-opts.c (c_common_handle_option) <case
	OPT_Wdeclaration_after_statement>: New.
	* c-tree.h (pedwarn_c90): Declare.
	* doc/invoke.texi (Option Summary): Document
	-Wdeclaration-after-statement.
	(Warning Options): Ditto.

Co-Authored-By: Michael Culbertson <Michael.J.Culbertson@wheaton.edu>

From-SVN: r69899
2003-07-28 20:03:25 +00:00
Roger Sayle 868b8cda7b builtins.def (BUILT_IN_PRINTF, [...]): Changed from front-end builtins to normal builtins, using DEF_LIB_BUILTIN.
* builtins.def (BUILT_IN_PRINTF, BUILT_IN_FPRINTF): Changed from
	front-end builtins to normal builtins, using DEF_LIB_BUILTIN.
	(BUILT_IN_PRINTF_UNLOCKED, BUILT_IN_FPRINTF_UNLOCKED): Changed
	from front-end to normal builtins, using DEF_EXT_LIB_BUILTIN.
	(DEF_FRONT_END_LIB_BUILTIN): Delete.
	(DEF_EXT_FRONT_END_LIB_BUILTIN): Delete.
	(BUILT_IN_FWRITE_UNLOCKED): Wrap long line.

	* builtins.c (build_string_literal): New function to construct
	a char* pointer to a string literal.
	(expand_builtin_fputs): Change 2nd argument from "int ignore" to
	"rtx target" to be consistent with other expand_builtin_* functions.
	Change 3rd argument from "int unlocked" to "bool unlocked".
	(expand_builtin_printf): Rewrite of c_expand_builtin_printf from
	c-common.c to avoid front-end dependencies.  Optimize printf("")
	as a no-op when the result isn't required.  Handle embedded NULs
	in format string.
	(expand_builtin_fprintf): A rewrite of c_expand_builtin_fprintf
	from c-common.c to avoid front-end dependencies.  Likewise, optimize
	fprintf(fp,"") as a no-op when the result isn't required, evaluating
	fp for side-effects.  Handle embedded NULs in format string.
	(expand_builtin_sprintf): Fix typo.
	(expand_builtin): Don't expand BUILT_IN_FPRINT{,_UNLOCKED} when not
	optimizing.  Adjust calls of expand_builtin_fputs to match the API
	change. Expand BUILT_IN_PRINTF and BUILT_IN_PRINTF_UNLOCKED using
	expand_builtin_printf.  Likewise, expand BUILT_IN_FPRINTF_UNLOCKED
	and BUILT_IN_FPRINTF using expand_builtin_fprintf.

	* c-common.c (is_valid_printf_arglist): Delete.
	(c_expand_builtin): Delete.
	(c_expand_builtin_printf): Moved to builtins.c. Delete.
	(c_expand_builtin_fprintf): Moved to builtins.c.  Delete.
	(c_expand_expr): No longer treat CALL_EXPRs specially.
	(CALLED_AS_BUILT_IN): Delete.

From-SVN: r69760
2003-07-24 21:04:12 +00:00
Jason Merrill de7df9ebdc tree.h (boolean_type_node): Move from C/C++/Java frontends.
* tree.h (boolean_type_node): Move from C/C++/Java frontends.
        (boolean_true_node, boolean_false_node): Likewise.
        (enum tree_index): Add TI_BOOLEAN_{TYPE,FALSE,TRUE}.
        * tree.c (build_common_tree_nodes): Init boolean_type_node.
        (build_common_tree_nodes_2): Init boolean_{true,false}_node.
        * stor-layout.c (set_sizetype): Handle an early BOOLEAN_TYPE.
        * c-common.h (truthvalue_type_node): Renamed from boolean_type_node.
        (truthvalue_true_node): Renamed from boolean_true_node.
        (truthvalue_false_node): Renamed from boolean_false_node.
        * c-decl.c: Just set truthvalue_* to integer_*.
        * c-*.[ch]: s/boolean/truthvalue/.  s/c_bool/boolean/.
        * cp/decl.c: Just set truthvalue_* to boolean_*.
        * java/java-tree.h: Move boolean_type_node et al to the back end.

From-SVN: r69758
2003-07-24 16:48:13 -04:00
Kazu Hirata 938d968ed3 alias.c: Fix comment formatting.
* alias.c: Fix comment formatting.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* combine.c: Likewise.
	* cpplib.c: Likewise.
	* diagnostic.c: Likewise.
	* dojump.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* jump.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* recog.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.

From-SVN: r69689
2003-07-22 23:15:30 +00:00
Nathan Sidwell c6e4cc53e5 c-common.c (handle_packed_attribute): Don't pack a struct via a typedef.
* c-common.c (handle_packed_attribute): Don't pack a struct via a
	typedef. Propagate packedness from a main variant.
testsuite:
	* gcc.dg/pack-test-3.c: New test.

From-SVN: r69668
2003-07-22 09:26:01 +00:00
Alexandre Oliva fb5d2a87ad c-common.c (c_common_type_for_mode): Return integer types for pointer modes.
* c-common.c (c_common_type_for_mode): Return integer types for
pointer modes.

From-SVN: r69661
2003-07-22 02:26: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
Gabriel Dos Reis eb8221eaf2 c-common.c: Don't undefine GCC_DIAG_STYLE.
* c-common.c: Don't undefine GCC_DIAG_STYLE.
	(fname_decl): Don't use xxx_with_decl.
	(c_add_case_label): Likewise.
	(handle_section_attribute): Likewise.
	(handle_alias_attribute): Likewise.
	(handle_no_instrument_function_attribute): Likewise.
	(handle_no_limit_stack_attribute): Likewise.
	* c-objc-common.c (c_tree_printer): Print IDENTIFIER_NODEs.
	* c-format.c (gcc_cdiag_char_table): Add '%E' format-specifier.

From-SVN: r69573
2003-07-18 23:05:53 +00:00
Steven Bosscher d944c82dce c-common.c (c_estimate_num_insns_1): Don't handle METHOD_CALL_EXPR.
2003-07-17  Steven Bosscher  <steven@gcc.gnu.org>

	* c-common.c (c_estimate_num_insns_1): Don't handle
	METHOD_CALL_EXPR.
	* expr.c (safe_from_p): Likewise.
	* gengtype.c (adjust_field_tree_exp): Likewise.
	* stmt.c (warn_if_unused_value): Likewise
	* tree.c (first_rtl_op): Likewise.
	* tree.def: Don't define METHOD_CALL_EXPR.
	* java/lang.c (java_estimate_num_insns_1): Don't handle
	METHOD_CALL_EXPR.

From-SVN: r69511
2003-07-17 13:25:21 +00:00
Andrew Pinski d07605f570 re PR c/10962 (lookup_field is a linear search on a linked list (can be slow if large struct))
2003-07-16  Andrew Pinski  <pinskia@physics.uc.edu>
ChangeLog:
        PR c/10962
        * ggc.h: Add header guards.
        * c-decl.c (finish_struct): Sort fields if
        number greater than 15 and there are no
        anonymous structs/unions.
        * c-common.h: Include ggc.h.
        (sorted_fields_type): New struct.
        (field_decl_cmp): New prototype.
        (resort_sorted_fields): New prototype.
        (DECL_DECLARES_TYPE_NON_TEMPLATE_P): New macro.
        * c-tree.h: (lang_type): Use pointer to sorted_fields_type
        as s, removing other fields.
        * c-typeck.c (lookup_field): Use s in lang_type.
        These were mostly moved from cp/class.c:
        * c-common.c (field_decl_cmp): New static function.
        (field_decl_cmp): New function.
        (resort_sorted_fields): New function.
cp/ChangeLog:
        * class.c (field_decl_cmp): Remove.
        (resort_field_decl_cmp): Remove.
        (resort_sorted_fields): Remove.
        (add_fields_to_vec): Rename to ...
        (add_fields_to_record_type): this.
        (finish_struct_1): Change to be using
        sorted_fields_type's fields.
        * cp-tree.h (lang_decl): In lang_decl_u3
        change sorted_fields to be a pointer to
        sorted_fields_type.
        (resort_sorted_fields): Remove prototype.
        * search.c (lookup_field_1): Change to be using
        sorted_fields_type's fields.

From-SVN: r69470
2003-07-16 11:45:56 -07:00
Geoffrey Keating 2d799c0954 c-common.c (c_common_type_for_mode): Handle V4DFmode.
* c-common.c (c_common_type_for_mode): Handle V4DFmode.
	* tree.c: (build_common_tree_nodes_2): Likewise.
	* tree.h (enum tree_index): Add TI_V4DF_TYPE.
	(V4DF_type_node): New.

From-SVN: r69382
2003-07-15 05:44:30 +00:00
Geoffrey Keating d1bd0ded61 Index: ChangeLog
2003-07-10  Geoffrey Keating  <geoffk@apple.com>

	* c-decl.c (finish_decl): Handle 'used' here...
	* cgraphunit.c (cgraph_finalize_function): ... and here ...
	* c-common.c: (handle_used_attribute): ... not here.

	* configure.in (onstep): Support --enable-intermodule.
	* Makefile.in (OBJS-common): New.
	(OBJS-md): New.
	(OBJS-archive): New.
	(OBJS): Build from OBJS-common, OBJS-md, OBJS-archive.
	(OBJS-onestep): New.
	(libbackend.a): Support @onestep@.
	(libbackend.o): New.
	* configure: Regenerate.

	* c-common.h (c_reset_state): New prototype.
	(c_parse_file): New prototype.
	(finish_file): Move prototype from c-tree.h.
	* c-decl.c: Include <hashtab.h>.
	(builtin_decls): New.
	(current_file_decl): New.
	(duplicate_decls): Add extra parameter. Change all callers.  Don't
	output duplicate common symbols.
	(link_hash_hash): New.
	(link_hash_eq): New.
	(poplevel): Handle popping of the top level.
	(warn_if_shadowing): Handle TRANSLATION_UNIT_DECL.
	(pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate.
	(pushdecl_top_level): Likewise.
	(redeclaration_error_message): Handle TRANSLATION_UNIT_DECL.
	(c_init_decl_processing): Create TRANSLATION_UNIT_DECL.
	(finish_decl): Handle TRANSLATION_UNIT_DECL.
	(merge_translation_unit_decls): New.
	(c_write_global_declarations): New.
	(c_reset_state): New.
	(implicitly_declare): Handle TRANSLATION_UNIT_DECL.
	* c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New.
	* c-objc-common.c (c_cannot_inline_tree_fn): Handle
	TRANSLATION_UNIT_DECL.
	(c_objc_common_finish_file): Call merge_translation_unit_decls.
	* c-opts.c (in_fnames): Rename from in_fname.
	(c_common_decode_option): Handle multiple input filenames.
	(c_common_post_options): Likewise.
	(c_common_parse_file): Likewise; also, call c_parse_file rather than
	yyparse.
	* c-parse.in: Move cleanup code to c_parse_file.
	(free_parser_stacks): Move contents to c_parse_file.
	(c_parse_file): New.
	* c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT
	for integer types.
	(C_DECL_FILE_SCOPE): New.
	(finish_file): Move prototype to c-common.h.
	(merge_translation_unit_decls): New prototype.
	(comptypes): Add extra parameter to prototype.
	(c_write_global_declarations): New prototype.
	* c-typeck.c (tagged_types_tu_compatible_p): New.
	(function_types_compatible_p): Add extra parameter, change all callers.
	(type_lists_compatible_p): Likewise.
	(comptypes): Likewise.
	(struct tagged_tu_seen): New.
	(tagged_tu_seen_base): New.
	(build_unary_op): Handle TRANSLATION_UNIT_DECL.
	(c_mark_addressable): Remove #if 0 code.
	* calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add
	comment explaining why it shouldn't have to.
	* cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY
	options.
	* cppinit.c (cpp_read_next_file): New.
	(cpp_read_main_file): Use it.
	* cpplib.c (undefine_macros): New.
	(cpp_undef_all): New.
	* cpplib.h (cpp_read_next_file): Prototype.
	(cpp_undef_all): Prototype.
	* langhooks-def.h (write_global_declarations): Remove prototype.
	* toplev.h (write_global_declarations): Add prototype.
	* tree.c (decl_type_context): Use switch statement, handle
	TRANSLATION_UNIT_DECL.
	* tree.def: Update documentation for TRANSLATION_UNIT_DECL.
	(TRANSLATION_UNIT_DECL): New kind of tree.
	* tree.h: Update documentation for TRANSLATION_UNIT_DECL.
	* Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies.
	* doc/invoke.texi: Make attempt to document new functionality.

	2003-05-19  Per Bothner <bothner@apple.com>

	* gcc.c (combine_inputs): New.
	(process_command): Set combine_inputs.
	(do_spec_1): Handle combine_inputs.
	(main): Likewise.

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

	* decl.c (cp_finish_decl): Handle 'used' attribute.

	* cp-lang.c (c_reset_state): New dummy routine.
	* cp-tree.h (finish_file): Move prototype to c-common.h.
	* parser.c (c_parse_file): Rename from yyparse; don't call finish_file.

From-SVN: r69224
2003-07-11 08:33:21 +00:00
Jan Hubicka 084c177908 java-tree.h (DECL_NUM_STMTS): Rename to...
* java-tree.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	* lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
	New static functions.
	(LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
	* parser.y (add_stmt_to_compound): Do not account statements.

	* cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	(start_function): Use DECL_ESTIMATED_INSNS.
	* optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS.

	* decl2.c (maybe_emit_vtables): Fix marking vtables as needed in
	unit-at-a-time

	* c-common.c (c_estimate_num_insns_1): New static function.
	(c_estimate_num_insns): New global function.
	* c-common.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	(c_estimate_num_insns): Declare.
	* c-decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* c-semantics.c (add_stmt): Do not account statements.
	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS):
	New.
	* langhooks.h (lang_hooks_for_tree_inlining): Add
	estimate_num_insns
	* params.def (max-inline-insns-auto, max-inline-insns-auto): set
	to 100.
	(max-inline-insns): set to 300.
	(min-inline-insns): set to 10.
	* tree-inline.c (struct inline_data): Rename inlined_stmts to
	inlined-insns.
	(INSNS_PER_STMT): Kill.
	(inlinable_function_p): Compute and store body size.
	(expand_call_inline): Likewise.
	(optimize_inline_calls): Likewise.

From-SVN: r69113
2003-07-09 00:31:20 +00:00
Zack Weinberg e6cc3a24c2 cpplib.h (CPP_AT_NAME, [...]): New token types.
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types.
	(struct cpp_options): Add narrow_charset, wide_charset,
	bytes_big_endian fields.  Remove EBCDIC field.
	(cpp_init_iconv, cpp_interpret_string): New external interfaces.

	* cpphash.h: Include <iconv.h> if we have it, otherwise
	provide a dummy definition of iconv_t.
	(struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields.
	(_cpp_valid_ucn): Update prototype.
	(_cpp_destroy_iconv): New prototype.

	* doc/cpp.texi: Document character set handling.
	* doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=.
	* doc/extend.texi: Delete entire section on multiline strings.
	Rewrite section on __FUNCTION__ etc now that these are
	variables in C.

	* cppucnid.tab, cppucnid.pl: New files.
	* cppucnid.h: New generated file.
	* cppcharset.c: Include cppucnid.h.  Lots of commentary added.
	(iconv_open, iconv, iconv_close): Provide dummy definitions
	if !HAVE_ICONV.
	(SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv,
	_cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn,
	emit_numeric_escape, convert_hex, convert_oct, convert_escape,
	cpp_interpret_string, narrow_str_to_charconst,
	wide_str_to_charconst): New.
	(ucn_valid_in_identifier): Use a binary search through the
	ucnranges table defined in cppucnid.h, not a long chain of if
	statements.
	(_cpp_valid_ucn): Add a limit pointer.  Downgrade "universal
	character names are only valid in C++ and C99" to a warning.
	Issue the "meaning of \[uU] is different in traditional C"
	warning here.  Take care not to let iconv see an invalid UCS
	value if we get a malformed UCN.  Issue an error if we don't
	have iconv.
	(cpp_interpret_charconst): Moved here from cpplex.c.  Use
	cpp_interpret_string to do the heavy lifting.

	* cppinit.c (cpp_create_reader): Initialize bytes_big_endian,
	narrow_charset, wide_charset fields of options structure.
	(cpp_destroy): Call _cpp_destroy_iconv.
	* cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn.
	(maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete.
	(cpp_interpret_charconst): Moved to cppcharset.c.
	* cpplib.c (dequote_string): Delete.
	(interpret_string_notranslate): New.
	(do_line, do_linemarker): Use interpret_string_notranslate.

	* Makefile.in (cppcharset.o): Depend on cppucnid.h.

	* c-common.c (fname_string, combine_strings): Delete.
	* c-common.h (fname_string, combine_strings): Delete prototypes.
	* c-lex.c (ignore_escape_flag): Delete.
	(cb_ident): Use cpp_interpret_string, not lex_string.
	(get_nonpadding_token): New function.
	(c_lex): Handle Objective-C @-prefixed identifiers and strings here.
	Adjust calls to lex_string.  Don't write *value twice.
	(lex_string): Now handles string constant concatenation.
	Most of the work handed off to cpp_interpret_string.
	Call fix_string_type here.
	* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with
	FUNC_NAME, throughout.
	(OBJC_STRING): New token type.
	(primary:STRING): No need to call fix_string_type here.
	(primary:objc_string): Make that OBJC_STRING.
	(objc_string nonterminal): Delete.
	(yylexname): Delete code to handle fake string constants.
	(yylexstring): Delete entirely.
	(_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING.  No need
	to handle CPP_ATSIGN.

	* c.opt (-fexec-charset=, -fwide-exec-charset=): New options.
	* c-opts.c (missing_arg, c_common_handle_option): Handle
	OPT_fexec_charset_ and OPT_fwide_exec_charset_.
	(c_common_init): Set cpp_opts->bytes_big_endian, not
	cpp_opts->EBCDIC.  Call cpp_init_iconv.
	(print_help): Document -fexec-charset= and -fexec-wide-charset=.
	(TARGET_EBCDIC): Delete default definition.

	* objc/objc-act.c (build_objc_string_object): No need to
	handle string constant concatenation.

cp:
	* parser.c (cp_lexer_read_token): No need to handle string
	constant concatenation.

testsuite:
	* gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c
	everywhere.
	* gcc.dg/concat.c: Concatenation of string constants with
	__FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error.
	* gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp.
	* gcc.dg/cpp/escape-2.c: Use wide character constants where
	necessary to avoid multi-character character constant warning.
	* gcc.dg/cpp/escape.c: Likewise.
	* gcc.dg/cpp/ucs.c: Likewise.
	Remove backslashes from dg-bogus comments, as they confuse Tcl.
	Fix a typo.

libstdc++-v3:
	* testsuite/22_locale/collate/compare/wchar_t/2.cc
	* testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
	* testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
	* testsuite/22_locale/collate/hash/wchar_t/2.cc
	* testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
	* testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
	* testsuite/22_locale/collate/transform/wchar_t/2.cc
	* testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
	* testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
	XFAIL on all targets.

From-SVN: r68952
2003-07-05 00:24:00 +00:00
Kaveh R. Ghazi 5f1989e65d c-aux-info.c: Include toplev.h after c-tree.h.
gcc:
	* c-aux-info.c: Include toplev.h after c-tree.h.
	* c-common.c: Likewise.
	(GCC_DIAG_STYLE): Undef.
	* c-semantics.c (GCC_DIAG_STYLE): Define.
	* c-tree.h (GCC_DIAG_STYLE): Likewise.
	* diagnostic.h (inform): Move prototype to toplev.h.
	* jump.c: Include diagnostic.h before toplev.h.
	* toplev.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG): Define.
	(warning, error, fatal_error, pedwarn, sorry, inform,
	error_for_asm, warning_for_asm): Mark with ATTRIBUTE_GCC_CXXDIAG.

cp:
	* cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define.
	(cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with
	ATTRIBUTE_GCC_CXXDIAG.

From-SVN: r68910
2003-07-04 01:55:50 +00:00
Neil Booth 37fa72e9d3 c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
	(fix_string_type, check_case_value, c_common_nodes_and_builtins,
	c_add_case_label, finish_label_addr_expr, boolean_increment):
	Use c_dialect_ macros.
	* c-common.h (enum c_language_kind): Extend.
	(c_dialect_cxx, c_dialect_objc): New.
	(flag_objc): Remove.
	(c_common_init_options): Update prototype.
	* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
	macros.
	* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
	macros.
	* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
	* c-lang.c (c_init_options): Remove.
	(c_language): Define.
	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
	* c-lex.c (lex_charconst): Use c_dialect_cxx().
	* c-opts.c (lang_flags): Make function-local.
	(c_common_init_options): Use c_dialect_ macros.  Handle
	C++ diagnostic requirements.
	(c_common_handle_option, c_common_post_options): Use flag_cxx.
	* c-parse.in (init_reswords): Use c_dialect_objc ().
	* c-pch.c (get_ident): Use c_language.
	* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
	* c-typeck.c (comptypes, build_c_cast): Similarly.
	* objc/objc-lang.c (c_language): Define.
	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
	(objc_init_options): Remove.
cp:
	* Make-lang.in: Update.
	* cp-lang.c (c_language): Define.
	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
	* cp-tree.h (cxx_init_options): Remove.
	* lex.c: Don't include diagnostic.h.
	(cxx_init_options): Remove.

From-SVN: r68734
2003-06-30 19:36:25 +00:00
Jan Hubicka 4d7d0451bc c-common.c (handle_used_attribute): Use mark_referenced.
* c-common.c (handle_used_attribute): Use mark_referenced.
	* varasm.c (mark_referenced): Break out from ...
	(assemble_name): ... here.
	* tree.h (mark_referenced): Declare.

From-SVN: r68500
2003-06-25 22:14:26 +00:00
Kazu Hirata 71c0e7fc96 basic-block.h: Fix comment formatting.
* basic-block.h: Fix comment formatting.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-format.c: Likewise.
	* coverage.c: Likewise.
	* cpplib.h: Likewise.
	* cpppch.c: Likewise.
	* dbxout.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* profile.c: Likewise.
	* real.h: Likewise.
	* sched-deps.c: Likewise.

From-SVN: r68369
2003-06-23 15:27:37 +00:00
Andreas Jaeger a742c759f9 c-common.c: Change _Bool to bool reverting part of the last patch.
* c-common.c: Change _Bool to bool reverting part of the last
	patch.

From-SVN: r68256
2003-06-20 12:00:22 +02:00
Andreas Jaeger 35b1a6faeb c-aux-info.c: Convert to ISO C99.
* c-aux-info.c: Convert to ISO C99.
	* c-pragma.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-convert.c: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-dump.c: Likewise.
	* c-decl.c: Likewise
	* c-format.c: Likewise.
	* c-incpath.c: Likewise.
	* c-incpath.h: Likewise.

From-SVN: r68218
2003-06-19 21:43:59 +02:00
Aldy Hernandez 9f629a2191 c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro.
2003-06-13  Aldy Hernandez  <aldyh@redhat.com>

        * c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro.

        * simplify-rtx.c (simplify_subreg): Same.

        * emit-rtl.c (gen_lowpart_common): Same.

From-SVN: r67911
2003-06-13 19:27:29 +00:00