Commit Graph

255 Commits

Author SHA1 Message Date
Diego Novillo 953ff28998 [multiple changes]
2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* libgomp: New directory.
	* Makefile.def: Add target_module libgomp.
	* Makefile.in: Regenerate.
	* configure.in (target_libraries): Add target-libgomp.
	* configure: Regenerate.


contrib/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* gcc_update (files_and_dependencies): Add libgomp files.


gcc/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* omp-low.c: New file.
	* c-omp.c: New file.

2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* doc/invoke.texi: Document -fopenmp.
	* tree-dump.h (debug_function): Declare.

	* hooks.c (hook_bool_tree_bool_false): New function.
	(hook_tree_tree_null): Remove.
	(hook_tree_tree_tree_null): New.
	* hooks.h: Update to match.

	* tree-pretty-print.c (debug_tree_chain): New.
	(print_generic_expr): Handle TDF_CHAIN.
	(dump_generic_node): Handle BLOCK.
	Do not abort with incomplete SWITCH_EXPRs.
	Do not dump body of an OpenMP directive if TDF_SLIM is given.
	<case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't
	print space after directive name.
	<OMP_FOR>: Handle printing OMP_FOR_PRE_BODY.
	Handle OMP_MASTER and OMP_ORDERED.
	Handle printing of OMP_BODY just in one place, goto
	dump_omp_body in the rest of OMP_* nodes that have
	OMP_BODY.
	Don't handle clause nodes here.  Update omp statements to
	use dump_omp_clauses.
	Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC,
	OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF,
	GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED,
	GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE,
	GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE.
	Adjust output for GOMP_PARALLEL.
	(dump_omp_clauses): New.
	(print_declaration): Dump DECL_VALUE_EXPR.
	(op_symbol_1): Split out of op_symbol.
	(dumping_stmts): Remove.  Update all users.

	* cgraph.c (cgraph_analyze_queue): New.
	(cgraph_add_new_function): New.
	* cgraph.h (cgraph_analyze_queue): Declare.
	(cgraph_add_new_function): Declare.
	(cgraph_lower_function): Remove.

	* tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_*
	nodes.  Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS
	and TYPE_P nodes in its default clause.
	(empty_body_p): New.
	(tree_range_check_failed): New.
	(build5_stat): New.

	* tree.h (OMP_CLAUSE_REDUCTION_INIT,
	OMP_CLAUSE_REDUCTION_MERGE,
	OMP_CLAUSE_REDUCTION_PLACEHOLDER,
	OMP_CLAUSE_PRIVATE_DEBUG,
	OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY,
	OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY,
	OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND,
	OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL,
	OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR,
	OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT,
	OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT,
	OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
	OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST,
	OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE
	OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY,
	OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New.
	(TREE_RANGE_CHECK): New.
	(empty_body_p): Declare.
	(enum omp_clause_default_kind): New.
	(build_string_literal): Declare.
	(enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New.
	(build5_stat, build5): Declare.

	* tree-pass.h (TDF_CHAIN): Define.
	* tree-pass.h (PROP_gimple_lomp): Define.
	(pass_lower_omp): Declare.

	* diagnostic.h (debug_tree_chain): Declare.

	* builtins.c (get_builtin_sync_mode): Use 0 as last argument to
	mode_for_size.
	(expand_builtin): Handle sync BUILT_IN_*_16 builtins.
	* builtins.c (build_string_literal): Make extern.

	* gcc.c (include_spec_function): New.
	(static_spec_functions): Add it.
	(main): Move load of libgomp.spec ...
	(LINK_COMMAND_SPEC): ... here.
	(link_gomp_spec): New.
	(static_specs): Include it.
	(LINK_COMMAND_SPEC): Add link_gomp.
	(GOMP_SELF_SPECS): New.
	(driver_self_specs): Include it.
	(switch_matches): Don't mark inline.
	(main): Load libgomp.spec.

	* tree-gimple.c (is_gimple_stmt): True for OMP_MASTER,
	OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION,
	and OMP_SINGLE, OMP_FOR and OMP_PARALLEL.

	* tree-gimple.h (enum omp_parallel): Declare.
	(determine_parallel_type): Declare.
	(omp_firstprivatize_variable): Declare.
	(omp_reduction_init): Declare.
	(diagnose_omp_structured_block_errors): Declare.
	(struct walk_stmt_info): Add want_return_expr.
	(struct walk_stmt_info): Add want_bind_expr, want_locations.
	(find_omp_clause): Declare.
	(insert_field_into_struct): Declare.
	(struct walk_stmt_info): Move from tree-nested.c
	(walk_stmts): Declare.

	* c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP
	to 200505.

	* cgraphunit.c (cgraph_lower_function): Make static.
	(cgraph_finalize_pending_functions): New.
	(cgraph_finalize_function): Call it.
	(cgraph_finalize_compilation_unit): Likewise.

	* builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
	BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
	(BT_FN_UINT_UINT): New.
	(DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7,
	DEF_FUNCTION_TYPE_VAR_4): Document.
	(BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT,
	BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR,
	BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_UINT,
	BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New.

	* builtins.def: Update DEF_BUILTIN comment to include COND argument.
	Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins
	into separate files.
	(DEF_GOMP_BUILTIN): New.
	(BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER,
	BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END,
	BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END,
	BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
	BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT,
	BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END,
	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
	BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT,
	BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END,
	BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START,
	BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New.
	* sync-builtins.def: New file, moved from builtins.def.
	* omp-builtins.def: New file, moved from builtins.def.

	* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.

	* gimple-low.c (lower_function_body): Clear data.
	(lower_stmt): Do not handle COMPOUND_EXPR.
	Remove call to print_node_brief.

	* c-tree.h (c_finish_omp_clauses): New prototype.
	(C_DECL_THREADPRIVATE_P): Define.
	(lookup_name_no_remap, c_omp_remap_private): Remove
	(c_begin_omp_parallel, c_finish_omp_parallel): Update.
	(check_for_loop_decls): Update decl.
	(lookup_name_no_remap, c_omp_remap_private): Declare.
	(build_indirect_ref, build_modify_expr, pushdecl,
	pushdecl_top_level): Move to c-common.h.

	* dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp
	before the switch, but just in the 2 places that need it.

	* c-decl.c (diagnose_mismatched_decls): Do not check for
	mismatched thread-local attributes when OLDDECL is marked
	threadprivate and NEWDECL has no thread-local attributes.
	(merge_decls): Merge C_DECL_THREADPRIVATE_P.
	(c_gimple_diagnostics_recursively): Rename from
	c_warn_unused_result_recursively.  Invoke
	diagnose_omp_structured_block_errors.
	(check_for_loop_decls): Return a singular decl found.

	* langhooks.c (lhd_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls.
	(lhd_omp_firstprivatize_type_sizes): New.
	(lhd_omp_assignment): New.
	(lhd_omp_predetermined_sharing): New.

	* langhooks.h (struct gimplify_omp_ctx): Forward declare.
	(struct lang_hooks_for_types): Add
	omp_firstprivatize_type_sizes, omp_privatize_by_reference,
	omp_predetermined_sharing, omp_disregard_value_expr,
	omp_private_debug_clause, omp_clause_default_ctor,
	omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor.

	(c_finish_omp_clauses): New.
	(c_finish_bc_stmt): Diagnose break within omp for.
	(c_begin_omp_parallel, c_finish_omp_parallel): New.
	(build_unary_op): Return error_mark after reporting
	a readonly_error.
	(build_modify_expr): Likewise.

	* gimplify.c: Include optabs.h and pointer-set.h.
	(enum gimplify_omp_var_data): Declare.
	(struct gimplify_omp_ctx): Declare.
	(struct gimplify_ctx): Add fields prev_context, combined_pre_p
	and combined_ctxp.
	(gimplify_ctxp, gimplify_omp_ctxp): New local variables.
	(push_gimplify_context, pop_gimplify_context): Allow nesting.
	(splay_tree_compare_decl_uid): New.
	(new_omp_context): New.
	(delete_omp_context): New.
	(gimple_add_tmp_var): Call omp_add_variable.
	(gimplify_bind_expr): Likewise.
	(gimplify_var_or_parm_decl): If omp_notice_variable returned
	true, disregard DECL_VALUE_EXPR on the decl if any.
	(gimplify_expr_in_ctx): New.
	(omp_firstprivatize_variable, omp_firstprivatize_type_sizes
	omp_add_variable, omp_notice_variable, omp_is_private
	gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1
	gimplify_adjust_omp_clauses, gimplify_omp_parallel
	gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p
	gimplify_omp_atomic_fetch_op, goa_stabilize_expr
	gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex
	gimplify_omp_atomic): New.
	(gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL and OMP_ATOMIC.
	(gimplify_body): Verify gimplify_ctxp is empty after gimplification.

	* c-pragma.h (enum pragma_kind): Add
	PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER,
	PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR,
	PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED,
	PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR,
	PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION,
	PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE,
	PRAGMA_OMP_THREADPRIVATE.

	* tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE,
	OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE,
	OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION,
	OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE,
	OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
	OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define.

	* print-tree.c (print_node): Dump DECL_VALUE_EXPR.

	* tree-ssa-dce.c (find_control_dependence): Do not assume that
	ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR).

	* tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for
	OpenMP directives.
	(struct nesting_info): Add field_map,
	suppress_expansion, debug_var_chain.
	(create_nesting_tree): Initialize them.
	(lookup_field_for_decl): Use field_map.
	(get_nonlocal_debug_decl, get_local_debug_decl): New.
	(convert_local_omp_clauses): New.
	(finalize_nesting_tree_1): Add debug_var_chain to toplevel block.
	(walk_body): Split out of walk_function.
	(convert_nonlocal_omp_clauses, convert_local_omp_clauses): New.
	(convert_nonlocal_reference): Handle omp statements.
	(convert_local_reference): Likewise.
	(unnest_nesting_tree_1): Split out of finalize_nesting_tree_1.
	(unnest_nesting_tree): New.
	(lower_nested_functions): Call it.
	(insert_field_into_struct): Make extern.
	(struct walk_stmt_info): Move to tree-gimple.h.
	(walk_stmts): Make extern.

	* omp-builtins.def: New file.

	* tree-iterator.c (expr_only): Clarify comment.

	* c-common.h (pushdecl_top_level, pushdecl,
	build_modify_expr, build_indirect_ref,
	c_finish_omp_master, c_finish_omp_critical,
	c_finish_omp_ordered, c_finish_omp_barrier,
	c_finish_omp_atomic, c_finish_omp_flush,
	c_finish_omp_for, c_split_parallel_clauses,
	omp_clause_default_kind, c_omp_sharing_predetermined,
	c_omp_remap_decl): Declare.

	* Makefile.in (BUILTINS_DEF): Add omp-builtins.def.
	(OBJS-common): Add omp-low.o.
	(c-omp.o, omp-low.o): Add.
	(gimplify.o): Add dependency on $(OPTABS_H).
	(GTFILES): Add omp-low.c.
	(gt-stringpool.h): Add.

	* tree-cfg.c (set_bb_for_stmt): Do not update the
	block-to-labels map if we are currently expanding to RTL.
	(tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P
	checks.
	Handle IDENTIFIER_NODE.
	(tree_verify_flow_info): Do not ICE when emitting error
	messages about invalid labels.
	(dump_function_to_file): Reset CFUN before emitting the body
	of the function.
	(debug_function): New.

	* passes.c (init_optimization_passes): Schedule
	pass_lower_omp.

	* langhooks-def.h (lhd_omp_predetermined_sharing,
	lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes):
	Declare.
	(LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
	(LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE,
	LANG_HOOKS_OMP_PREDETERMINED_SHARING,
	LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
	LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE,
	LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR,
	LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
	LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP,
	LANG_HOOKS_OMP_CLAUSE_DTOR): Define.
	(LANG_HOOK_DECLS): Use them.


2006-01-18  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
	    Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* c-parser.c (pragma_omp_clause): Define.
	(c_parser_declaration_or_fndef): Document OpenMP syntax.
	(c_parser_compound_statement): Likewise.
	(c_parser_statement): Likewise.
	(c_parser_pragma): Handle omp pragmas.
	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
	OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define.
	(c_parser_omp_clause_name, check_no_duplicate_clause,
	c_parser_omp_variable_list,
	c_parser_omp_var_list_parens, c_parser_omp_clause_copyin,
	c_parser_omp_clause_copyprivate,
	c_parser_omp_clause_default,
	c_parser_omp_clause_firstprivate, c_parser_omp_clause_if,
	c_parser_omp_clause_lastprivate,
	c_parser_omp_clause_nowait,
	c_parser_omp_clause_num_threads,
	c_parser_omp_clause_ordered, c_parser_omp_clause_private,
	c_parser_omp_clause_reduction,
	c_parser_omp_clause_schedule, c_parser_omp_clause_shared,
	c_parser_omp_all_clauses, c_parser_omp_structured_block,
	c_parser_omp_atomic, c_parser_omp_barrier,
	c_parser_omp_critical, c_parser_omp_flush,
	c_parser_omp_for_loop, c_parser_omp_for,
	c_parser_omp_master, c_parser_omp_ordered,
	c_parser_omp_sections_scope, c_parser_omp_sections,
	c_parser_omp_parallel, c_parser_omp_single,
	c_parser_omp_construct, c_parser_omp_threadprivate): New.
	* c-pragma.c (init_pragma): Do omp pragma registration here.
	* c.opt (fopenmp): New flag.


2006-01-18  Eric Christopher  <echristo@apple.com>

	* gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif.
	* config/darwin.h (GOMP_SELF_SPECS): Define.


testsuite/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>
            Uros Bizjak  <uros@kss-loka.si>

	* testsuite/gcc.dg/gomp: New directory.

From-SVN: r109902
2006-01-18 14:21:25 -05: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 10e6657a20 c-common.c, [...]: Revert 2005-11-18 lookup_name patch.
gcc/
        * c-common.c, config/darwin-c.c, c-decl.c, c-tree.h, c-objc-common.h,
        langhooks-def.h, langhooks.h: Revert 2005-11-18 lookup_name patch.
        * c-tree.h (lookup_name): Move declaration ...
        * c-common.h (lookup_name): ... here.
        * config/darwin-c.c: Include c-common.h.
        * config/t-darwin: Update dependencies.
gcc/cp/
        * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch.
        * name-lookup.c (lookup_name): Remove prefer_type argument.
        (lookup_name_prefer_type): New.
        * decl.c (lookup_and_check_tag): Use them.
        * pt.c (tsubst_friend_class): Likewise.
        (lookup_template_class): Likewise.
        (tsubst_copy_and_build): Likewise.
        * name-lookup.h (lookup_name_prefer_type): New.
        (lookup_name): Remove declaration.

From-SVN: r107325
2005-11-21 13:27:29 -08:00
Mike Stump 7bbd0aab4c c-common.c (handle_cleanup_attribute): Use a lang hook for lookup_name.
* c-common.c (handle_cleanup_attribute): Use a lang hook for lookup_name.
	* config/darwin-c.c (darwin_pragma_unused): Likewise.
	* c-decl.c (lookup_name_two) Remove.
	* c-tree.h (lookup_name_two): Remove.
	* c-objc-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
	* langhooks-def.h (LANG_HOOKS_LOOKUP_NAME): Add.
	(LANG_HOOKS_DECLS): Add initializer for LANG_HOOKS_LOOKUP_NAME.
	* langhooks.h (lang_hooks_for_decls): Add lookup_name.

cp:
	* cp-objcp-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
	* name-lookup.c (lookup_name_two): Remove.
	(lookup_name_one): Add.
	* name-lookup.h (lookup_name_two): Remove.
	(lookup_name_one): Add.

From-SVN: r107196
2005-11-18 23:40:29 +00:00
Mike Stump 988037306d c-decl.c (lookup_name_two): Add.
* c-decl.c (lookup_name_two): Add.
	* c-tree.h (lookup_name_two): Likewise.
	* c-common.c (handle_cleanup_attribute): Use lookup_name_two instead.
	* config/darwin-c.c (darwin_pragma_unused): Likewise.

cp:
	* name-lookup.c (lookup_name_two): Add.
	* name-lookup.h: Likewise.

testsuite:
	* g++.old-deja/g++.mike/unused.C: Add.

From-SVN: r107062
2005-11-16 02:08:11 +00:00
Kaveh R. Ghazi db857e7d05 Makefile.in (C_TREE_H): Update dependencies.
* Makefile.in (C_TREE_H): Update dependencies.
	* c-tree.h: Include toplev.h.
	* diagnostic.h (diagnostic_set_info): Add format attribute.
	* rtl-error.c (diagnostic_for_asm): Likewise.

From-SVN: r102309
2005-07-23 15:22:46 +00:00
Joseph Myers 73f397d429 re PR c/22013 (ICE in gimple_add_tmp_var, at gimplify.c:535)
PR c/22013
	PR c/22098
	* langhooks.h (struct lang_hooks): Add expr_to_decl.
	* langhooks.c (lhd_expr_to_decl): New.
	* langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL):
	New.
	(LANG_HOOKS_INITIALIZER): Update.
	* tree.c (recompute_tree_invarant_for_addr_expr): Call
	expr_to_decl langhook.
	* c-tree.h (c_expr_to_decl): Declare.
	* c-typeck.c (c_expr_to_decl): New.
	(build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR
	specially.
	* c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define.

testsuite:
	* gcc.c-torture/compile/pr22013-1.c,
	gcc.c-torture/execute/pr22098-1.c,
	gcc.c-torture/execute/pr22098-2.c,
	gcc.c-torture/execute/pr22098-3.c: New tests.

From-SVN: r101630
2005-07-05 18:50:24 +01:00
Joseph Myers ea40ba9c04 c-common.h (GCC_DIAG_STYLE): Define.
* c-common.h (GCC_DIAG_STYLE): Define.
	* c-tree.h (GCC_DIAG_STYLE): Do not define.  Change minimum GCC
	version for format checking to 4.1.
	* c-format.c: Include toplev.h after c-common.h.
	(enum format_type): Add gcc_tdiag_format_type.
	(gcc_tdiag_length_specs, gcc_tdiag_flag_pairs,
	gcc_tdiag_flag_specs, gcc_tdiag_char_table): New.
	(format_types_orig): Add gcc_tdiag.
	(init_dynamic_diag_info): Support gcc_tdiag formats.
	(handle_format_attribute): Likewise.
	* toplev.h (NO_FRONT_END_DIAG, ATTRIBUTE_GCC_FE_DIAG): Remove.
	(GCC_DIAG_STYLE): Default to __gcc_tdiag__.  Change minimum GCC
	version for format checking to 4.1.
	(warning0, warning, error, pedwarn, sorry): Use
	ATTRIBUTE_GCC_DIAG.
	* config/rs6000/rs6000.c (altivec_expand_builtin), varasm.c
	(finish_aliases_1): Do not use %qE.
	* config/arm/arm.c, config/i386/i386.c, config/mmix/mmix.c,
	config/pdp11/pdp11.c, stor-layout.c, tree-eh.c, tree-ssa.c:
	Correct format bugs.
	* config/v850/v850-protos.h (v850_output_aligned_bss): Change size
	parameter to unsigned HOST_WIDE_INT.
	* config/v850/v850.c (v850_output_aligned_bss): Likewise.

cp:
	* cp-tree.h (GCC_DIAG_STYLE): #undef before defining.  Change
	minimum GCC version for format checking to 4.1.

testsuite:
	* gcc.dg/format/gcc_diag-1.c: Update.

From-SVN: r101543
2005-07-03 01:38:49 +01:00
Joseph Myers f2a71bbcb2 c-tree.h (default_function_array_conversion): Take and return struct c_expr.
* c-tree.h (default_function_array_conversion): Take and return
	struct c_expr.
	* c-typeck.c (default_function_array_conversion): Split into
	array_to_pointer_conversion and function_to_pointer_conversion.
	Take and return struct c_expr.
	(array_to_pointer_conversion): Do not handle type qualifiers or
	COMPOUND_EXPRs specially.
	(build_function_call): Call function_to_pointer_conversion for
	function designators.
	(build_unary_op): Call array_to_pointer_conversion, not
	default_function_array_conversion.
	(digest_init, output_init_element): Likewise.
	* c-parser.c: All callers of default_function_array_conversion
	changed.

From-SVN: r101440
2005-06-29 23:13:56 +01:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Joseph Myers 46bdb9cffb c-tree.h (default_function_array_conversion): Declare.
* c-tree.h (default_function_array_conversion): Declare.
	* c-typeck.c (default_function_array_conversion): Export.  Correct
	comment.
	(default_conversion): Do not call
	default_function_array_conversion.  Do not allow FUNCTION_TYPE.
	(build_function_call): Call default_function_array_conversion on
	the function.
	(convert_arguments): Do not call it on the function arguments.
	(build_unary_op): Do not allow ARRAY_TYPE or FUNCTION_TYPE for
	TRUTH_NOT_EXPR.  Call default_function_array_conversion for taking
	address of ARRAY_REF.
	(build_compound_expr): Do not call
	default_function_array_conversion.
	(build_c_cast): Do not call default_function_array_conversion.
	(convert_for_assignment): Do not call default_conversion.
	(digest_init): Call default_function_array_conversion to convert
	string constants and compound literals to pointers, but not
	otherwise.
	(output_init_element): Likewise.
	(build_asm_expr): Do not call default_function_array_conversion.
	(c_process_expr_stmt): Likewise.
	(c_objc_common_truthvalue_conversion): Likewise.  Do not allow
	FUNCTION_TYPE.
	* c-parser.c (c_parser_expression_conv): New.
	(c_parser_asm_operands, c_parser_expr_list): Add convert_p
	argument.  All callers changed.  Call
	default_function_array_conversion if convert_p.
	(c_parser_initializer, c_parser_initval): Call
	default_function_array_conversion except for string constants and
	compound literals.
	(c_parser_initelt): Call default_function_array_conversion for
	ObjC expression received.
	(c_parser_statement_after_labels): Call c_parser_expression_conv
	for return and expression statements.
	(c_parser_paren_condition, c_parser_for_statement,
	c_parser_conditional_expression): Call c_parser_expression_conv.
	(c_parser_expr_no_commas, c_parser_conditional_expression,
	c_parser_binary_expression, c_parser_cast_expression,
	c_parser_unary_expression): Call
	default_function_array_conversion.

objc:
	* objc-act.c (my_build_string_pointer): New.
	(objc_get_class_reference, get_super_receiver): Call
	my_build_string_pointer instead of my_build_string when building
	function arguments.

testsuite:
	* gcc.dg/noncompile/20040203-3.c: Update expected message.

From-SVN: r100984
2005-06-15 16:55:47 +01:00
Roger Sayle 43f6dfd3ec c-tree.h (parser_build_unary_op): New prototype.
* c-tree.h (parser_build_unary_op): New prototype.
	* c-typeck.c (parser_build_unary_op): New function to construct
	a unary operation in the C parser.
	* c-parser.c (c_parser_unary_expression):  Use the new function
	parser_build_unary_op when appropriate.

From-SVN: r99471
2005-05-09 20:48:33 +00:00
Joseph Myers 6fb58bba49 re PR c/15698 (no error in presence of broken builtin fn + K&R declaration)
PR c/15698
	* c-tree.h (C_DECL_BUILTIN_PROTOTYPE): New.
	* c-decl.c (current_function_prototype_built_in,
	current_function_prototype_arg_types): New.
	(merge_decls): Keep source location of prototype followed by
	nonprototype declaration.  Update C_DECL_BUILTIN_PROTOTYPE.
	(builtin_function): Set C_DECL_BUILTIN_PROTOTYPE.
	(start_function): Always set current_function_prototype_locus,
	current_function_prototype_built_in and
	current_function_prototype_arg_types.  Check for external
	prototype whether or not visible for external function and set
	current_function_prototype_arg_types accordingly.
	(store_parm_decls_oldstyle): Use
	current_function_prototype_arg_types for checking old-style
	definition against prototype.  Give warnings only if
	current_function_prototype_built_in).

testsuite:
	* gcc.dg/builtins-30.c: Update expected messages.
	* gcc.dg/pr15698-1.c, gcc.dg/pr15698-2.c, gcc.dg/pr15698-3.c,
	gcc.dg/pr15698-4.c, gcc.dg/pr15698-5.c, gcc.dg/pr15698-6.c,
	gcc.dg/pr15698-7.c, pr15698-8.c: New tests.

From-SVN: r99118
2005-05-02 20:39:04 +01:00
Joseph Myers 187230a795 re PR c/12913 (Jumps into variable length array scope not rejected)
PR c/12913
	* c-tree.h (struct c_label_list): Update comment.
	(struct c_label_context): Rename to struct c_label_context_se.
	(label_context_stack): Rename to label_context_stack_se.
	(C_DECL_UNJUMPABLE_VM, C_DECL_UNDEFINABLE_VM, struct
	c_label_context_vm, label_context_stack_vm, c_begin_vm_scope,
	c_end_vm_scope): New.
	(C_DECL_DECLARED_BUILTIN, C_DECL_USED): Use FUNCTION_DECL_CHECK.
	* c-decl.c (pop_scope): Call c_end_vm_scope.
	(pushdecl): Call c_begin_vm_scope for variably modified
	declarations.
	(define_label): Check for jumping into scope of identifier with
	variably modified type.  Push label on stack for those defined at
	current context of identifiers with variably modified type.
	(start_function): Create stack level for context of identifiers
	with variably modified type.
	(finish_function): Pop stack level for context of identifiers with
	variably modified type.
	* c-typeck.c (label_context_stack): Rename to
	label_context_stack_se.
	(label_context_stack_vm, c_begin_vm_scope, c_end_vm_scope): New.
	(c_finish_goto_label): Check for jumping into scope of identifier
	with variably modified type.  Push label on stack for those jumped
	to from current context of identifiers with variably modified
	type.
	(struct c_switch): Add blocked_vm.
	(c_start_case): Initialize blocked_vm.
	(do_case): Check blocked_vm.
	(c_finish_case): Add comment.
	(c_begin_stmt_expr, c_finish_stmt_expr): Update for renamed
	variable label_context_stack.

objc:
	* objc-act.c (objc_start_function): Create stack level for context
	of identifiers with variably modified type.

testsuite:
	* gcc.dg/c99-vla-jump-1.c, gcc.dg/c99-vla-jump-2.c,
	gcc.dg/c99-vla-jump-3.c, gcc.dg/c99-vla-jump-4.c,
	gcc.dg/c99-vla-jump-5.c: New tests.

From-SVN: r98464
2005-04-20 17:41:48 +01:00
Kazu Hirata da25d93e46 * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): Remove.
From-SVN: r97836
2005-04-08 17:07:49 +00:00
Joseph Myers 16ef3accae re PR c++/772 (Statement expressions issues)
PR c/772
	PR c/17913
	* c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR,
	C_DECL_UNDEFINABLE_STMT_EXPR, struct c_label_list, struct
	c_label_context, label_context_stack): New.
	* c-decl.c (define_label): Check for jumps into statement
	expressions.  Add label to list of defined labels.
	(start_function): Push context on label_context_stack.
	(finish_function): Pop context from label_context_stack.
	* c-typeck.c (label_context_stack): New.
	(c_finish_goto_label): Check for jumps into statement
	expressions.  Add label to list of jumped to labels.
	(struct c_switch): Add blocked_stmt_expr.
	(c_start_case): Initialize it.
	(do_case): Check it.
	(c_finish_case): Verify !blocked_stmt_expr.
	(c_begin_stmt_expr):  Push context on label_context_stack.
	Increment blocked_stmt_expr.  Mark labels jumped to from outside
	as undefinable.
	(c_finish_stmt_expr): December blocked_stmt_expr.  Mark labels
	defined in the statement expression and no longer jumpable to.
	Mark labels jumped to from just outside the statement expression
	as again definable.  Pop context from label_context_stack.
	* doc/extend.texi (Statement Exprs): Update.

objc:
	* objc-act.c (objc_start_function): Push context on
	label_context_stack.

testsuite:
	* gcc.dg/stmt-expr-label-1.c, gcc.dg/stmt-expr-label-2.c,
	gcc.dg/stmt-expr-label-3.c : New tests.
	* gcc.c-torture/execute/medce-2.c: Remove.

From-SVN: r97273
2005-03-30 20:56:39 +01:00
Richard Henderson aab038d54a re PR c/20519 (completed type not selected properly with typeof)
PR c/20519
        * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call.
        (build_compound_literal): Likewise.  Propagate decl type into the
        initializer.
        (finish_decl): Likewise.  Use new return value from complete_array_type
        for zero sized arrays.
        (complete_array_type): Move ...
        * c-common.c (complete_array_type): ... here.  Change first argument
        to pointer-to-type-node.  Consistently use sizetype for the index
        except for zero sized arrays.  Detect zero sized arrays for pedantic
        mode diagnostics.  Create a new type node instead of modifying the
        old node in place.
        * c-tree.h (complete_array_type): Move decl ...
        * c-common.h (complete_array_type): ... here.
cp/
        * decl.c (cp_complete_array_type): Rename from complete_array_type.
        Use the new complete_array_type in c-common.c.  Update all callers.
        * cp-tree.h (cp_complete_array_type): Update to match.

From-SVN: r97223
2005-03-29 17:35:15 -08:00
Joseph Myers 522ddfa254 c-common.h (default_conversion): Remove.
* c-common.h (default_conversion): Remove.
	(perform_integral_promotions): Add.
	* c-tree.h (default_conversion): Add.
	* c-typeck.c (perform_integral_promotions): New, split out from
	default_conversion.
	* c-common.c (check_case_value): Use perform_integral_promotions,
	not default_conversion.
	(c_add_case_label): Don't continue processing case label after
	found to be pointer.

cp:
	* cp-tree.h (perform_integral_promotions): Remove.
	(default_conversion): Add.

From-SVN: r96916
2005-03-23 01:29:08 +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
Joseph Myers 766beb4020 re PR c/8927 (Gcc give error for wrong line of C code.)
PR c/8927
	* c-tree.h (undeclared_variable, build_external_ref): Add extra
	argument.
	* c-decl.c (undeclared_variable): Take location as argument.
	* c-typeck.c (build_external_ref): Likewise.
	* c-parser.c (c_parser_postfix_expression): Pass location of
	identifier to build_external_ref.

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

From-SVN: r95773
2005-03-02 02:50:25 +00:00
Joseph Myers 27bf414caa c-parser.c: New file.
* c-parser.c: New file.
	* c-parse.in: Remove.
	* Makefile.in (c-parse.o-warn, c-parse.o, c-parse.c, c-parse.y):
	Remove.
	(c-parser.o): Add dependencies.
	(C_AND_OBJC_OBJC, C_OBJS, gcc.srcextra, GTFILES, distclean,
	maintainer-clean, TAGS): Update.
	* c-config-lang.in (gtfiles): Update.
	* gengtype-lex.l: Don't handle "@@".
	* stub-objc.c (objc_get_class_ivars, objc_build_throw_stmt,
	objc_build_synchronized, objc_begin_try_stmt,
	objc_begin_catch_clause, objc_finish_catch_clause,
	objc_build_finally_clause, objc_finish_try_stmt): New.
	* c-tree.h (struct c_declspecs): Add declspecs_seen_p and
	type_seen_p.
	(c_parse_init): Update comment.
	* c-decl.c (c_init_decl_processing): Update comment.
	(build_null_declspecs, declspecs_add_qual, declspecs_add_type,
	declspecs_add_scspec, declspecs_add_attrs): Initialize and update
	new c_declspecs members.

objc:
	* Make-lang.in (objc/objc-parse.o-warn, objc/objc-parse.o,
	objc/objc-parse.c, objc/objc-parse.y): Remove
	(OBJC_OBJS, objc.srcextra, objc.tags, objc.mostlyclean,
	objc.distclean, objc.maintainer-clean): Update for new parser.
	* config-lang.in (gtfiles): Update for new parser.

testsuite:
	* gcc.dg/cpp/separate-1.c, gcc.dg/noncompile/971104-1.c,
	gcc.dg/noncompile/990416-1.c: Adjust expected messages for new
	parser.

From-SVN: r95558
2005-02-25 23:20:48 +00:00
Kazu Hirata 647eea9dd8 c-tree.h, [...]: Fix comment typos.
* c-tree.h, combine.c, expmed.c, flow.c, libgcc2.c,
	simplify-rtx.c, tree-ssa-live.h: Fix comment typos.  Follow
	spelling conventions.

From-SVN: r94939
2005-02-12 15:17:56 +00:00
Kazu Hirata ad616de14c basic-block.h, [...]: Update copyright.
* basic-block.h, c-common.c, c-cppbuiltin.c, c-lang.c,
	c-tree.h, cfgbuild.c, cgraph.c, cgraph.h, collect2.c,
	combine.c, config.gcc, coverage.h, cse.c, cselib.c,
	defaults.h, df.c, dwarf2asm.c, dwarf2out.c, explow.c, expr.c,
	flow.c, fold-const.c, gcse.c, ggc-page.c, gimple-low.c,
	gimplify.c, ifcvt.c, langhooks-def.h, lcm.c, optabs.h,
	output.h, postreload-gcse.c, postreload.c, recog.c,
	resource.c, rtl.def, rtlanal.c, sched-deps.c, sched-rgn.c,
	targhooks.h, toplev.c, tree-data-ref.c, tree-eh.c,
	tree-flow.h, tree-loop-linear.c, tree-mudflap.h, tree-nrv.c,
	tree-optimize.c, tree-outof-ssa.c, tree-pass.h,
	tree-scalar-evolution.c, tree-ssa-copy.c, tree-ssa-dce.c,
	tree-ssa-dse.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c,
	tree-ssa-pre.c, tree-ssa.c, tree-vectorizer.c, tree.def,
	unwind-dw2-fde-darwin.c, var-tracking.c: Update copyright.

From-SVN: r93827
2005-01-18 11:36:31 +00:00
Kazu Hirata 103a83e0fa c-tree.h, [...]: Remove unused prototypes.
* c-tree.h, coverage.h, langhooks-def.h, optabs.h, output.h,
	rtl.h, targhooks.h, tree-flow.h, tree-mudflap.h, tree.h:
	Remove unused prototypes.

From-SVN: r93651
2005-01-14 17:53:28 +00:00
Richard Henderson 4744afba0f re PR middle-end/16417 (crappy code (gcc.c-torture/compile/20020210-1.c) in arguments causes ICE)
PR middle-end/16417
        * c-decl.c (store_parm_decls): Clarify get_pending_sizes insertion
        comment.
        * c-objc-common.c (c_cannot_inline_tree_fn): Remove pending sizes
        checks.
        * c-tree.h (struct lang_decl): Remove pending_sizes.
        * function.c: Include tree-gimple.h
        (assign_parm_setup_reg): Remove callee-copies code.
        (gimplify_parm_type, gimplify_parameters): New functions.
        (expand_pending_sizes): Remove.
        (expand_function_start): Don't call it.
        * gimplify.c (gimplify_expr): Examine DECL_VALUE_EXPR for PARM_DECL.
        (gimplify_body): Add do_parms argument.  Use gimplify_parameters.
        (gimplify_function_tree): Setup cfun.  Update gimplify_body call.
        * tree-gimple.h (gimplify_body): Update decl.
        * tree-inline.c (initialize_inlined_parameters): Update gimplify_body
        call.
        * tree.h (gimplify_parameters): Declare.
        * Makefile.in (function.o): Depend on TREE_GIMPLE_H.

From-SVN: r92373
2004-12-18 20:42:14 -08:00
Ziemowit Laski c7baa14599 c-tree.h (struct lang_type): Rename 'objc_protocols' field to 'objc_info'.
[gcc/ChangeLog]
2004-12-07  Ziemowit Laski  <zlaski@apple.com>

        * c-tree.h (struct lang_type): Rename 'objc_protocols' field
        to 'objc_info'.

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

        * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
        field to 'objc_info'.

From-SVN: r91833
2004-12-07 23:46:11 +00:00
Ziemowit Laski 66237a39fc c-tree.h (struct lang_type): Add 'objc_protocols' field.
[gcc/ChangeLog]
2004-12-06  Ziemowit Laski  <zlaski@apple.com>

        * c-tree.h (struct lang_type): Add 'objc_protocols' field.

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

        * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.

From-SVN: r91803
2004-12-07 03:52:22 +00:00
Kazu Hirata 4e2fb7de2d c-typeck.c (c_size_in_bytes, [...]): Make them static.
* c-typeck.c (c_size_in_bytes, record_maybe_used_decl):
	Make them static.
	* c-tree.h: Remove the corresponding prototypes.

From-SVN: r90504
2004-11-11 23:13:12 +00:00
Joseph Myers 81da229b08 c-tree.h (enum c_typespec_kind, [...]): New.
* c-tree.h (enum c_typespec_kind, struct c_typespec,
	parser_xref_tag): New.
	(struct c_declspecs): Add tag_defined_p.  Adjust definition of
	typedef_p.
	(declspecs_add_type): Adjust prototypes.
	* c-parse.in (%union): Add tstype.
	(typespec_nonattr, typespec_attr, typespec_reserved_nonattr,
	typespec_reserved_attr, typespec_nonreserved_nonattr,
	structsp_attr, structsp_nonattr): Change to tstype.  Update
	actions.
	* c-decl.c (build_null_declspecs): Initialize tag_defined_p.
	(declspecs_add_type): Update to take struct c_typespec argument.
	Set tag_defined_p and typedef_p as appropriate.
	(xref_tag): Rename to parser_xref_tag and replace by wrapper.
	Update to return struct c_typespec.
	(shadow_tag_warned): Don't let empty declarations with qualifiers
	or storage class specifiers redeclare a tag if a previous
	declaration is visible.

testsuite:
	* gcc.dg/c99-tag-3.c, gcc.dg/declspec-14.c: New tests.

From-SVN: r89021
2004-10-14 01:34:01 +01:00
Joseph Myers 9bf242660a c-tree.h (readonly_error): Remove.
* c-tree.h (readonly_error): Remove.
	* c-typeck (enum lvalue_use): New.
	(lvalue_or_else, readonly_error): Use it.  All callers changed.
	(readonly_error): Make static.

testsuite:
	* gcc.dg/lvalue-2.c: New test.

From-SVN: r88362
2004-09-30 23:52:06 +01:00
Joseph Myers 98c3a78277 c-tree.h (enum c_typespec_keyword): New.
* c-tree.h (enum c_typespec_keyword): New.
	(struct c_declspecs): Adjust description of "type".  Remove
	specbits, explicit_int_p and explicit_char_p.  Rename
	typedef_signed_p to explicit_signed_p.  Add default_int_p, long_p,
	short_p, signed_p, unsigned_p and complex_p.
	(finish_declspecs): New.
	* c-parse.in (datadef, datadecl, setspecs, decl, component_decl,
	typename): Call finish_declspecs.
	* c-decl.c (finish_declspecs): New.
	(declspecs_add_type): Check for combinations which cannot occur in
	valid specifier lists.  Update comments.
	(shadow_tag_warned): Remove checks done in finish_declspecs.
	Don't report useless type name if type defaulted to int.
	(grokdeclarator): Remove checks and actions done in
	finish_declspecs.  Don't allow for type being NULL.  Update for
	datastructures changes.  Initialize decl_attr.
	(build_null_declspecs, quals_from_declspecs): Update for
	datastructures changes.

testsuite:
	* gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c:
	Update expected messages.
	* gcc.dg/declspec-13.c: New test.

From-SVN: r87660
2004-09-17 19:18:05 +01:00
Joseph Myers 3b53cddc38 c-tree.h (struct c_declspecs): Add const_p, volatile_p and restrict_p.
* c-tree.h (struct c_declspecs): Add const_p, volatile_p and
	restrict_p.
	(struct c_declarator): Change u.array.quals and pointer_quals to
	int.  Add u.array.attrs.
	(quals_from_declspecs): New.
	* c-decl.c (quals_from_declspecs): New.
	(shadow_tag_warned): Give more specific message for useless type
	qualifiers.
	(build_array_declarator, set_array_declarator_inner,
	grokdeclarator, make_pointer_declarator, build_null_declspecs,
	declspecs_add_qual): Update for changed structures.

testsuite:
	* gcc.dg/declspec-12.c: New test.

From-SVN: r87500
2004-09-14 19:59:38 +01: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
Joseph Myers d6a1dfd98b c-tree.h (enum c_storage_class): New.
* c-tree.h (enum c_storage_class): New.
	(struct c_declspecs): Add storage_class, inline_p and thread_p.
	* c-decl.c (shadow_tag_warned): Give errors for "inline" in empty
	declarations and "auto" or "register" in file scope empty
	declarations.  Give more specific warnings for other cases of
	storage class specifiers in empty declarations.
	(grokdeclarator): Update for new structures.  Don't check for
	multiple storage classes.  Diagnose file-scope "register" if
	pedantic.
	(build_null_declspecs): Update.
	(declspecs_add_scspec): Update.  Diagnose multiple storage class
	specifiers and invalid uses of "__thread".

testsuite:
	* gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c,
	gcc.dg/tls/diag-2.c: Update expected messages.
	* gcc.dg/991209-1.c: Specify compilation options.  Update expected
	messages.
	* gcc.dg/pr14289-2.c, gcc.dg/pr14289-3.c: Remove.
	* gcc.dg/declspec-7.c, gcc.dg/declspec-8.c, gcc.dg/declspec-9.c,
	gcc.dg/declspec-10.c, gcc.dg/declspec-11.c, gcc.dg/tls/diag-4.c,
	gcc.dg/tls/diag-5.c: New tests.

From-SVN: r87376
2004-09-11 23:15:14 +01:00
Joseph Myers 616aeba2bb c-tree.h (struct c_declspecs): Remove typedef_decl.
* c-tree.h (struct c_declspecs): Remove typedef_decl.  Add
	typedef_p and typedef_signed_p.
	* c-decl.c (shadow_tag_warned): Check typedef_p, not typedef_decl.
	(grokdeclarator): Don't use typedef_decl for warn_deprecated_use.
	Check typedef_p and typedef_signed_p, not typedef_decl.
	(grokfield): Check typedef_p, not typedef_decl.
	(build_null_declspecs): Initialize typedef_p and typedef_signed_p,
	not typedef_decl.
	(declspecs_add_type): Set typedef_p and typedef_signed_p, not
	typedef_decl.

testsuite:
	* gcc.dg/bitfld-9.c: New test.

From-SVN: r87326
2004-09-11 00:10:05 +01:00
Joseph Myers deb176fa3b re PR c/8420 (volatile after the type specifier for an unnamed structure is rejected)
PR c/8420
	* c-tree.h (struct c_declspecs): New.
	(struct c_declarator, struct c_type_name, struct c_parm): Update
	element types.
	(build_array_declarator, grokfield, shadow_tag, shadow_tag_warned,
	start_function, start_decl, build_c_parm,
	make_pointer_declarator): Update prototypes.
	(build_null_declspecs, declspecs_add_qual, declspecs_add_type,
	declspecs_add_scspec, declspecs_add_attrs): New.
	(split_specs_attrs): Remove.
	* c-parse.in (%union): Add dsptype.
	(declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea,
	declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea,
	declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea,
	declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea,
	declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea,
	declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea,
	declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea,
	declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea, declspecs_ts,
	declspecs_nots, declspecs_ts_nosa, declspecs_nots_nosa,
	declspecs_nosc_ts, declspecs_nosc_nots, declspecs_nosc, declspecs,
	maybe_type_quals_attrs): Change to dsptype.
	(struct c_declspec_stack): New.
	(current_declspecs, declspec_stack): Change type.
	(PUSH_DECLSPEC_STACK, POP_DECLSPEC_STACK): Update to new
	structures.
	(extdefs): Likewise.
	(setspecs): Likewise.
	(fndef): Use current_declspecs for empty declspecs list.
	(declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea,
	declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea,
	declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea,
	declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea,
	declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea,
	declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea,
	declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea,
	declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea): Update to new
	structures and helper functions.  Update comments.
	(typespec_nonattr): Correct comment.
	(maybe_type_quals_attrs, typename): Update to new structures.
	* c-decl.c (grokdeclarator, build_array_declarator, grokfield,
	shadow_tag, shadow_tag_warned, start_function, start_decl,
	build_c_parm, make_pointer_declarator,
	set_array_declarator_inner, groktypename): Update to new
	structures.
	(build_null_declspecs, declspecs_add_qual, declspecs_add_type,
	declspecs_add_scspec, declspecs_add_attrs): New.
	(split_specs_attrs): Remove.
	(shadow_tag_warned): Make warning for useless type names a
	pedwarn.  Give hard error for long, short, signed, unsigned or
	_Complex used with struct, union or enum in empty declaration.
	Make found_tag a bool.
	(grokdeclarator): Remove checks now done at parse time.

testsuite:
	* gcc.dg/anon-struct-4.c, gcc.dg/declspec-1.c,
	gcc.dg/declspec-2.c, gcc.dg/declspec-3.c, gcc.dg/declspec-4.c,
	gcc.dg/declspec-5.c, gcc.dg/declspec-6.c,
	gcc.dg/long-long-typespec-1.c: New tests.
	* gcc.dg/tls/diag-2.c: Update expected diagnostics

From-SVN: r87218
2004-09-09 02:25:48 +01:00
Joseph Myers f8893e4723 c-tree.h (enum c_declarator_kind, [...]): New.
* c-tree.h (enum c_declarator_kind, struct c_arg_info, struct
	c_declarator, struct c_type_name, struct c_parm): New.
	(build_array_declarator, set_array_declarator_inner,
	get_parm_info, grokfield, groktypename, grokparm, push_parm_decl,
	start_function, start_decl, build_c_parm, build_attrs_declarator,
	build_function_declarator, make_pointer_declarator, c_cast_expr,
	store_parm_decls_newstyle, c_expr_sizeof_type): Update prototypes.
	(build_id_declarator): New.
	* c-typeck.c (c_cast_expr, c_expr_sizeof_type): Update to new
	structures.
	* c-decl.c (ARG_INFO_PARMS, ARG_INFO_TAGS, ARG_INFO_TYPES,
	ARG_INFO_OTHERS): Remove.
	(build_id_declarator): New.
	(build_array_declarator, set_array_declarator_inner, groktypename,
	start_decl, grokparm, push_parm_decl, grokparms, get_parm_info,
	grokfield, start_function, store_parm_decls_newstyle,
	store_parm_decls_oldstyle, store_parm_decls,
	build_c_parm, build_attrs_declarator, build_function_declarator,
	make_pointer_declarator, grokdeclarator): Update to new
	structures.
	* c-parse.in (%union): Add arginfotype, dtrtype, typenametype and
	parmtype.
	(declarator, notype_declarator, after_type_declarator,
	parm_declarator, parm_declarator_starttypename,
	parm_declarator_nostarttypename, array_declarator, typename,
	absdcl, absdcl1, absdcl1_ea, absdcl1_noea, direct_absdcl1,
	absdcl_maybe_attribute, parm, firstparm, parms, parmlist,
	parmlist_1, parmlist_2, parmlist_or_identifiers,
	parmlist_or_identifiers_1): Use these types.
	(primary, after_type_declarator, parm_declarator_starttypename,
	notype_declarator, component_decl, component_declarator,
	component_notype_declarator, typename, absdcl,
	absdcl_maybe_attribute, absdcl1_ea, direct_absdcl1, parmlist_1,
	parmlist_2, parmlist_or_identifiers_1): Update to new structures.

objc:
	* objc-act.c (objc_start_function, really_start_method,
	objc_get_parm_info, start_method_def): Update to new arg_info
	structures.

From-SVN: r87217
2004-09-09 02:19:15 +01:00
Joseph Myers bc4b653be6 c-tree.h (C_DECL_USED, [...]): New.
* c-tree.h (C_DECL_USED, parser_obstack, in_alignof, in_sizeof,
	in_typeof, record_maybe_used_decl, pop_maybe_used,
	c_expr_sizeof_expr, c_expr_sizeof_type): New.
	* c-decl.c (parser_obstack): New.
	(c_init_decl_processing): Initialize parser_obstack.
	(c_write_global_declarations_1): Check for used but undefined
	static functions.
	* c-parse.in (%union): Add otype.
	(save_obstack_position): New.
	(extdefs): Use it.
	(unary_expr): Update in_sizeof and in_alignof.  Use
	c_expr_sizeof_expr and c_expr_sizeof_type.
	(sizeof): Update in_sizeof.
	(alignof): Update in_alignof.
	(typeof): Update in_typeof.
	(typespec_nonreserved_nonattr): Call pop_maybe_used.
	* c-typeck.c (in_alignof, in_sizeof, in_typeof, struct
	maybe_used_decl, maybe_used_decls, record_maybe_used_decl,
	pop_maybe_used, c_expr_sizeof_expr, c_expr_sizeof_type): New.
	(build_external_ref): Set C_DECL_USED or call
	record_maybe_used_decl if appropriate.
	* toplev.c (check_global_declarations): Check TREE_NO_WARNING.

testsuite:
	* gcc.dg/c90-static-1.c, gcc.dg/c99-static-1.c,
	gcc.dg/gnu99-static-1.c: New tests.

From-SVN: r87216
2004-09-09 02:16:16 +01:00
Ziemowit Laski 06f624bab8 c-decl.c (groktypename_in_parm_context): Remove function.
[gcc/ChangeLog]
2004-09-07  Ziemowit Laski  <zlaski@apple.com>

        * c-decl.c (groktypename_in_parm_context): Remove function.
        * c-tree.h (groktypename_in_parm_context): Remove prototype.

From-SVN: r87169
2004-09-08 01:24:26 +00:00
Ziemowit Laski d4e43dffb7 c-decl.c (store_parm_decls_newstyle): Make static.
[gcc/ChangeLog]
2004-09-02  Ziemowit Laski  <zlaski@apple.com>

        * c-decl.c (store_parm_decls_newstyle): Make static.
        (store_parm_decls_from): New function.
        * c-tree.h (store_parm_decls_newstyle): Remove prototype.
        (store_parm_decls_from): New prototype.

From-SVN: r87022
2004-09-03 02:07:18 +00:00
Ziemowit Laski 3041390da7 c-decl.c (store_parm_decls_newstyle): Make externally visible.
[gcc/ChangeLog]
2004-09-02  Ziemowit Laski  <zlaski@apple.com>

        * c-decl.c (store_parm_decls_newstyle): Make externally visible.
        * c-tree.h (store_parm_decls_newstyle): New prototype.

From-SVN: r86998
2004-09-02 23:13:43 +00:00
Joseph Myers f7b0fb680c attribs.c (strip_attrs): Remove.
* attribs.c (strip_attrs): Remove.
	(split_specs_attrs): Move ...
	* c-decl.c: ... to here.
	* tree.h (split_specs_attrs, strip_attrs): Remove.
	* c-tree.h (split_specs_attrs): Declare.

From-SVN: r86823
2004-08-31 09:29:24 +01:00
Joseph Myers 7b1124877b c-tree.h (struct language_function): Add arg_info element.
* c-tree.h (struct language_function): Add arg_info element.
	* c-decl.c (current_function_arg_info): New.
	(grokdeclarator, store_parm_decls): Use it instead of
	DECL_ARGUMENTS.
	(c_push_function_context, c_pop_function_context): Save and
	restore it.

From-SVN: r86798
2004-08-30 20:21:48 +01: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
Richard Henderson ee8a6a3ee5 c-typeck.c (build_offsetof): Remove.
* c-typeck.c (build_offsetof): Remove.
        * c-tree.h (build_offsetof): Remove.
        * c-common.c (fold_offsetof_1, fold_offsetof): New.
        * c-common.h (fold_offsetof): Declare.
        * c-parse.in (offsetof_base): New.
        (offsetof_member_designator): Use it.  Build references, not just
        a tree list.
        (primary): Use fold_offsetof, not build_offsetof.

From-SVN: r86651
2004-08-26 17:37:48 -07:00
Ziemowit Laski c34be55ec5 c-decl.c (grokparm): New function.
[gcc/ChangeLog]
2004-08-25  Ziemowit Laski  <zlaski@apple.com>

        * c-decl.c (grokparm): New function.
        * c-tree.h (grokparm): New prototype.

From-SVN: r86587
2004-08-25 23:39:11 +00:00
Joseph Myers 41db84259e * c-tree.h (c_sizeof_nowarn): Remove.
From-SVN: r86379
2004-08-22 14:02:01 +01:00
Joseph Myers 00325bce05 c-decl.c (set_array_declarator_type): Rename to set_array_declarator_inner.
* c-decl.c (set_array_declarator_type): Rename to
	set_array_declarator_inner.
	(build_c_parm, build_attrs_declarator, build_function_declarator):
	New functions.
	(make_pointer_declarator): Call build_attrs_declarator.
	* c-tree.h (set_array_declarator_type): Rename to
	set_array_declarator_inner.
	(build_c_parm, build_attrs_declarator, build_function_declarator):
	New prototypes.
	* c-parse.in (after_type_declarator,
	parm_declarator_starttypename, parm_declarator_nostarttypename,
	notype_declarator, absdcl_maybe_attribute, direct_absdcl1, parm,
	firstparm): Use these functions

From-SVN: r86367
2004-08-21 23:49:46 +01:00
Joseph Myers 60919bce32 c-decl.c (build_array_declarator, [...]): Change boolean parameters to type bool.
* c-decl.c (build_array_declarator, set_array_declarator_type,
	start_decl, grokdeclarator, grokparms): Change boolean parameters
	to type bool.
	* c-tree.h (build_array_declarator, set_array_declarator_type,
	start_decl): Update prototypes.
	* c-decl.c, c-parse.in: All callers changed.

From-SVN: r86366
2004-08-21 23:47:32 +01:00
Joseph Myers 916c59199c re PR c/11250 (-pedantic accepts `char a[] = ("x");')
PR c/11250
	* c-parse.in (init): Change to exprtype.
	(primary): Set original_code for STRING to STRING_CST.
	Call maybe_warn_string_init for compound literals.
	(initdcl, notype_initdcl): Call maybe_warn_string_init.
	(initval): Update.
	* c-tree.h (maybe_warn_string_init): New.
	(pop_init_level, process_init_element): Use struct c_expr.
	(struct c_expr): Update comment.
	* c-typeck.c (maybe_warn_string_init): New function.
	(digest_init): Call it.  Additional parameter strict_string.  All
	callers changed.
	(output_init_element): Likewise.
	(struct constructor_stack): Use struct c_expr for
	replacement_value.
	(really_start_incremental_init, push_init_level): Update.
	(pop_init_level): Update.  Return struct c_expr.
	(process_init_level): Update.  Take struct c_expr argument.

testsuite:
	* gcc.dg/init-string-1.c: New test.

From-SVN: r85022
2004-07-22 00:46:20 +01:00