aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.h
AgeCommit message (Collapse)AuthorFilesLines
2006-06-15re PR c++/26559 (ICE with __builtin_constant_p in template argument)Mark Mitchell1-1/+1
2006-06-14 Mark Mitchell <mark@codesourcery.com> PR c++/26559 * c-common.h (c_finish_omp_atomic): Adjust declaration. * c-omp.c (c_finish_omp_atomic): Return the expression to perform, rather than calling add_stmt on it. * c-parser.c (c_parser_omp_atomic): Adjust accordingly. 2006-06-14 Mark Mitchell <mark@codesourcery.com> PR c++/26559 * pt.c (tsubst_expr): Use finish_omp_atomic. (value_dependent_expression_p): All CALL_EXPRs are dependent. * semantics.c (finish_omp_atomic): Rework to use standard paradigms for handling non-dependent expressions. 2006-06-14 Mark Mitchell <mark@codesourcery.com> PR c++/26559 * g++.dg/template/builtin1.C: New test. * g++.dg/gomp/tpl-atomic-2.C: Remove XFAIL. From-SVN: r114665
2006-05-30c-common.h: Remove the prototype for yyparse.Kazu Hirata1-1/+0
* c-common.h: Remove the prototype for yyparse. * rtl.h: Remove the prototype for init_loop. From-SVN: r114242
2006-05-19c-tree.h (default_conversion): Remove.Mike Stump1-0/+5
* c-tree.h (default_conversion): Remove. * c-common.h (default_conversion): Add. cp: * typeck.c (default_conversion): Remove static. From-SVN: r113914
2006-05-18Whitespace fixupsMike Stump1-9/+9
From-SVN: r113893
2006-05-01c-typeck.c (parser_build_binary_op): Don't call the function ↵Roger Sayle1-1/+0
unsigned_conversion_warning to spot operand/result type... * c-typeck.c (parser_build_binary_op): Don't call the function unsigned_conversion_warning to spot operand/result type overflow. (build_binary_op): Instead, call convert_and_check instead of convert to report the problem when the operands are promoted. * c-common.c (unsigned_conversion_warning): Make static. * c-common.h (unsigned_conversion_warning): Delete prototype. * gcc.dg/Wconversion-3.c: New test case. * gcc.dg/Wconversion-4.c: Likewise. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r113418
2006-04-23re PR c++/26534 ([4.1] bitfield wrong optimize)Mark Mitchell1-0/+1
2006-04-23 Mark Mitchell <mark@codesourcery.com> PR c++/26534 * c-common.h (c_build_bitfield_integer_type): Declare. * c-decl.c (c_build_bitfield_integer_type): Move to ... * c-common.c (c_build_bitfield_integer_type): ... here. 2006-04-23 Mark Mitchell <mark@codesourcery.com> PR c++/26534 * cp-tree.h (is_bitfield_expr_with_lowered_type): New function. * typeck.c (is_bitfield_expr_with_lowered_type): New function. (decay_conversion): Convert bitfield expressions to the correct type. (build_modify_expr): Remove spurious conversions. * class.c (layout_class_type): Modify the type of bitfields to indicate a limited range. * call.c (standard_conversion): Adjust the type of bitfield expressions used in an rvalue context. (build_conditional_expr): Likewise. 2006-04-23 Mark Mitchell <mark@codesourcery.com> PR c++/26534 * g++.dg/opt/bitfield1.C: New test. * g++.dg/compat/abi/bitfield1_main.C: Add -w. * g++.dg/compat/abi/bitfield1_x.C: Likewise. * g++.dg/compat/abi/bitfield1_y.C: Likewise. * g++.dg/compat/abi/bitfield2_main.C: Likewise. * g++.dg/compat/abi/bitfield2_x.C: Likewise. * g++.dg/compat/abi/bitfield2_y.C: Likewise. * g++.dg/abi/bitfield1.C: Add dg-warning markers. * g++.dg/abi/bitfield2.C: Likewise. * g++.dg/init/bitfield1.C: Likewise. From-SVN: r113199
2006-02-24Index: gcc/ChangeLogGeoffrey Keating1-0/+5
2006-02-24 Geoffrey Keating <geoffk@apple.com> * doc/tm.texi (Run-time Target): Document C_COMMON_OVERRIDE_OPTIONS. * doc/invoke.texi (C++ Dialect Options): Document -fno-use-cxa-get-exception-ptr. * configure.ac: Define DEFAULT_USE_CXA_ATEXIT to 2 not 1. * configure: Regenerate. * c.opt (fuse-cxa-get-exception-ptr): New. * c-opts.c (c_common_handle_option): Handle OPT_fuse_cxa_get_exception_ptr. * c-common.c (flag_use_cxa_atexit): Update documentation. (flag_use_cxa_get_exception_ptr): New. * c-common.h (flag_use_cxa_get_exception_ptr): New. * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Improve documentation. (C_COMMON_OVERRIDE_OPTIONS): New. Index: gcc/testsuite/ChangeLog 2006-02-24 Geoffrey Keating <geoffk@apple.com> * g++.dg/eh/uncaught1.C: Add dg-options for ppc-darwin. * g++.dg/eh/uncaught2.C: New. * g++.dg/eh/uncaught3.C: New. Index: gcc/cp/ChangeLog 2006-02-24 Geoffrey Keating <geoffk@apple.com> * except.c (expand_start_catch_block): Handle flag_use_cxa_get_exception_ptr. From-SVN: r111427
2006-02-13invoke.texi (-Write-strings): Document that it is enabled by default.Gabriel Dos Reis1-5/+0
2006-02-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * doc/invoke.texi (-Write-strings): Document that it is enabled by default. * c.opt (-Wwrite-strings): Declare variable warn_write_strings. Clarify documentation. * c-common.h (warn_write_strings): Remove. * c-common.c (warn_write_strings): Likewise. * c-opts.c (c_common_init_options): Enable -Wwrite-strings by default for C++. testsuite/ 2006-02-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * g++.dg/warn/no-write-strings.C: New test. * g++.dg/warn/write-strings.C: Likewise. * g++.dg/warn/write-strings-default.C: Likewise. From-SVN: r110907
2006-01-20re PR c++/5520 (Add a warning to detect empty body of if statements (like in ↵Dirk Mueller1-0/+1
the C frontend)) 2006-01-20 Dirk Mueller <dmueller@suse.com> PR c++/5520 * c-parser.c (c_parser_if_body): Use build_empty_stmt() instead of a special NOP marker. * c-typeck.c (c_finish_if_stmt): Remove obsoleted special NOP marker handling. * c-common.h (empty_body_warning): Add forward declaration. * c-common.c (empty_body_warning): Add (from c_finish_if_stmt). Now uses IS_EMPTY_STMT() instead of special NOP markers. * semantics.c (finish_if_stmt): Call empty_body_warning. * parser.c (cp_parser_implicitly_scoped_statement): Mark empty statement with an empty stmt. * g++.dg/warn/empty-body.C: New. From-SVN: r110019
2006-01-18[multiple changes]Diego Novillo1-0/+19
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-04directives.c (struct pragma_entry): Add is_deferred.Richard Henderson1-1/+1
libcpp/ * directives.c (struct pragma_entry): Add is_deferred. Add ident entry to value union. (end_directive): Don't eat the line if in_deferred_pragma. (run_directive): Remove pragma hacks. (insert_pragma_entry): Remove. (new_pragma_entry): New. (register_pragma_1): Split out of register_pragma. Only handle the lookup tree and return the new entry. (cpp_register_pragma): Fill in the pragma entry here. (cpp_register_deferred_pragma): New. (register_pragma_internal): New. (_cpp_init_internal_pragmas): Use register_pragma_internal. (do_pragma): Allow pragma expansion after namespace. For deferred pragmas, don't slurp the line into a string. (destringize_and_run): Save tokens for deferred pragmas. (cpp_handle_deferred_pragma): Remove. * macro.c (builtin_macro): Remove pragma token hack. (_cpp_push_token_context): Rename from push_token_context and export. * internal.h (struct lexer_state): Add pragma_allow_expansion. (_cpp_push_token_context): Declare. * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return a token. Update the line number correctly if so. (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens. (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas. * include/cpplib.h (PRAGMA_EOL): New. (CPP_TOKEN_FLD_PRAGMA): New. (struct cpp_token): Add val.pragma. (struct cpp_options): Remove defer_pragmas. (cpp_handle_deferred_pragma): Remove. (cpp_register_deferred_pragma): Declare. gcc/ * c-lex.c (c_lex_with_flags) <CPP_PRAGMA>: Smuggle pragma id via integer constant. (pragma_lex): Remove. * c-pch.c (c_common_pch_pragma): Accept the name as an argument, rather than parsing it. * c-pragma.c (handle_pragma_weak, handle_pragma_redefine_extname, handle_pragma_extern_prefix): Add %< %> quotes. (registered_pragmas): New. (c_register_pragma_1): New. (c_register_pragma): Use it. (c_register_pragma_with_expansion): Likewise. (c_invoke_pragma_handler): New. (init_pragma): Use cpp_register_deferred_pragma directly for pch_preprocess. * c-pragma.h (enum pragma_kind): New. (pragma_handler): New. (c_invoke_pragma_handler): Declare. * c-common.c (c_parse_error): Pretty print CPP_PRAGMA and CPP_PRAGMA_EOL. * c-common.h (c_common_pch_pragma): Update decl. * Makefile.in (c-parser.o): Update dependencies. (GTFILES): Add c-pragma.h. * c-parser.c (struct c_token): Add pragma_kind. (struct c_parser): Add in_pragma. (c_lex_one_token): Always initialize keyword and pragma_kind. Extract data for CPP_PRAGMA. (c_parser_peek_2nd_token): Deny CPP_PRAGMA_EOL. (c_parser_consume_token): Don't allow CPP_PRAGMA unless errors. Don't allow CPP_PRAGMA_EOL if in_pragma. (c_parser_consume_pragma): New. (c_parser_skip_until_found): Stop on CPP_PRAGMA_EOL. (c_parser_skip_to_end_of_parameter): Likewise. (c_parser_skip_to_end_of_block_or_statement): Likewise. (c_parser_skip_to_pragma_eol): New. (c_parser_external_declaration): Handle CPP_PRAGMA. (c_parser_compound_statement_nostart): Likewise. (c_parser_statement_after_labels): Likewise. (c_parser_pragma): New. (pragma_lex): Likewise. (c_parser_pragma_pch_preprocess): New. (c_parser_new): Merge into ... (c_parse_file): ... here. Call c_parser_pragma_pch_preprocess. gcc/cp/ * lex.c (handle_pragma_java_exceptions): Fix whitespace. * parser.c (struct cp_token): Add pragma_kind. (eof_token): Update to match. (struct cp_lexer): Add in_pragma; rearrange next for better packing. (cp_parser_initial_pragma): New. (cp_lexer_new_main): Use it. Don't bother clearing c_lex_return_raw_strings. (cp_lexer_get_preprocessor_token): Always initialize keyword and pragma_kind fields. Handle CPP_PRAGMA. (cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when in_pragma is set. (cp_lexer_handle_pragma): Remove. Update callers to cp_parser_pragma. (cp_lexer_print_token) <CPP_PRAGMA>: Don't print as a string. (cp_parser_skip_to_pragma_eol): New. (cp_parser_error): Use it. (cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL; rearrange with switch statement. (cp_parser_skip_to_end_of_statement): Likewise. (cp_parser_skip_to_end_of_block_or_statement): Likewise. (cp_parser_skip_to_closing_brace): Likewise. (cp_parser_skip_until_found): Likewise. (cp_parser_statement): Add in_compound argument; update callers. Use it to decide how to handle pragma parsing. (cp_parser_labeled_statement): Add in_compound argument; pass it on to cp_parser_statement. (cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL. (cp_parser_declaration_seq_opt): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_member_specification_opt): Likewise. (cp_parser_function_definition_after_decl): Likewise. (cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs. (cp_parser_pragma): New. (pragma_lex): New. gcc/testsuite/ * g++.dg/parse/pragma2.C: Update expected error lines. From-SVN: r109336
2005-12-27PR c++/23171, c++/23172, c++/25417.Mark Mitchell1-0/+2
* c-decl.c (compound_literal_number): Remove. (build_compound_literal): Use set_compound_literal_name. * c-common.c (compound_literal_number): New variable. (set_compound_literal_name): New function. * c-common.h (set_compound_literal_name): Declare. PR c++/23171, c++/23172, c++/25417. * typeck.c (build_unary_op): Create temporary variables for compound literals whose addresses are taken. * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P. * decl.c (reshape_init_vector): Likewise. (reshape_init): Give it external linkage. (check_initializer): Use COMPOUND_LITERAL_P. (initialize_artificial_var): Allow the initializer to be a CONSTRUCTOR. * call.c (make_temporary_var_for_ref_to_temp): Use create_temporary_var. * cp-tree.h (COMPOUND_LITERAL_P): New macro. (rehape_init): Declare. * typeck2.c (digest_init): Use COMPOUND_LITERAL_P. * semantics.c (finish_compound_literal): Use reshape_init. PR c++/23172 * g++.dg/ext/complit4.C: New test. PR c++/25417 * g++.dg/ext/complit5.C: Likewise. From-SVN: r109075
2005-12-16target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New.Jon Grimm1-0/+1
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-11-24re PR c++/14024 (g++ isn't reporting aliasing warnings)Richard Guenther1-0/+1
2005-11-24 Richard Guenther <rguenther@suse.de> Dirk Mueller <dmueller@suse.de> PR c++/14024 * c-common.h (strict_aliasing_warning): Declare. * c-common.c (strict_aliasing_warning): New function, split out from ... * c-typeck.c (build_c_cast): ... here. * typeck.c (build_reinterpret_cast_1): Use it. * g++.dg/warn/Wstrict-aliasing-1.C: New testcase. * g++.dg/warn/Wstrict-aliasing-2.C: Likewise. * g++.dg/warn/Wstrict-aliasing-3.C: Likewise. * g++.dg/warn/Wstrict-aliasing-4.C: Likewise. * g++.dg/warn/Wstrict-aliasing-5.C: Likewise. * g++.dg/warn/Wstrict-aliasing-6.C: Likewise. Co-Authored-By: Dirk Mueller <dmueller@suse.de> From-SVN: r107459
2005-11-24re PR c++/21667 (misleading warning about array subscription)Gabriel Dos Reis1-0/+2
2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/21667 * c-typeck.c (build_array_ref): Avoid code duplicate. Use common C/C++ diagnostic function warn_array_subscript_with_type_char. * c-common.h (warn_array_subscript_with_type_char): Declare. * c-common.c (warn_array_subscript_with_type_char): Define. cp/ 2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/21667 * typeck.c (build_array_ref): Avoid code duplicate. Use common C/C++ diagnostic function warn_array_subscript_with_type_char. testsuite/ 2005-11-23 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/21667 * gcc.dg/Wchar-subscripts.c: New. * g++.dg/warn/Wchar-subscripts.C: Likewise. From-SVN: r107448
2005-11-21c-common.c, [...]: Revert 2005-11-18 lookup_name patch.Richard Henderson1-0/+1
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-07-24c-common.c (check_missing_format_attribute): New.Kaveh R. Ghazi1-0/+1
* c-common.c (check_missing_format_attribute): New. * c-common.h (check_missing_format_attribute): Likewise. * c-typeck.c (convert_for_assignment): Use it. cp: * call.c (convert_for_arg_passing): Check function pointers when -Wmissing-format-attribute is activated. * typeck.c (convert_for_assignment): Likewise. testsuite: * g++.dg/warn/miss-format-1.C, g++.dg/warn/miss-format-2.C, g++.dg/warn/miss-format-3.C, g++.dg/warn/miss-format-4.C, g++.dg/warn/miss-format-5.C, g++.dg/warn/miss-format-6.C: New. From-SVN: r102338
2005-07-03c-common.h (GCC_DIAG_STYLE): Define.Joseph Myers1-0/+9
* 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-06-29c-common.c (flag_next_runtime): Move...Ziemowit Laski1-4/+0
[gcc/ChangeLog] 2006-06-28 Ziemowit Laski <zlaski@apple.com> * c-common.c (flag_next_runtime): Move... * toplev.c (flag_next_runtime): ... here. * c-common.h (flag_next_runtime): Move... * flags.h (flag_next_runtime): ... here. * config/darwin-c.c: Include flags.h. * config/t-darwin (darwin-c.o): Depend on flags.h. From-SVN: r101415
2005-06-26re PR c/21911 (named parameter mistakenly identified as sentinel)Kaveh R. Ghazi1-1/+1
PR c/21911 * c-common.c (check_function_sentinel): Pass in named argument list, skip over named arguments before looking for a sentinel. (check_function_arguments): Pass in named argument list. * c-common.h (check_function_arguments): Likewise. * c-typeck.c (build_function_call): Likewise. cp: * call.c (build_over_call): Pass in named argument list to `check_function_arguments'. * typeck.c (build_function_call): Likewise. testsuite: PR c/21911 * gcc.dg/format/sentinel-1.c: Update. Fix execl* calls. From-SVN: r101341
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-06-15c-common.h (same_scalar_type_ignoring_signedness): Protoize.Aldy Hernandez1-0/+1
* c-common.h (same_scalar_type_ignoring_signedness): Protoize. * c-common.c (same_scalar_type_ignoring_signedness): New. * c-typeck.c (build_binary_op): Check compatability of vector types. Move error report after switch. Do not clobber code[01] on *_DIV_EXPR case. * testsuite/gcc.dg/simd-1.c: Update error messages. * testsuite/gcc.dg/simd-1b.c: Re-enable tests. Update error messages. * testsuite/gcc.dg/simd-2.c: Update error messages. * testsuite/gcc.dg/simd-4.c: New. From-SVN: r100976
2005-05-28c-decl.c (add_stmt): Add C frontend specific version.Ian Lance Taylor1-8/+0
./: * c-decl.c (add_stmt): Add C frontend specific version. (stmts_are_full_exprs_p): Remove. * c-common.h (STMT_IS_FULL_EXPR_P): Remove. (stmts_are_full_exprs_p): Don't declare. * c-semantics.c (add_stmt): Remove. cp/: * semantics.c (add_stmt): Add C++ frontend specific version. * cp-tree.h (STMT_IS_FULL_EXPR_P): Define. (stmts_are_full_exprs_p): Declare. From-SVN: r100289
2005-05-24c-common.h (objc_comptypes): Remove prototype.Ziemowit Laski1-1/+3
* c-common.h (objc_comptypes): Remove prototype. (objc_compare_types): New prototype. (objc_volatilized_decl): Likewise. (objc_type_quals_match): Likewise. * c-decl.c (objc_mark_locals_volatile): Streamline by calling objc_volatilize_decl(). * c-typeck.c (comp_target_types): Remove third parameter; do not call objc_comptypes(). (comptypes): Remove calls to objc_comptypes(). (build_function_call): Extend compatible prototype check to ObjC. (build_conditional_expr): Adjust call to comp_target_types(). (convert_for_assignment): Call objc_compare_types() instead of objc_comptypes(); adjust calls to comp_target_types(); call objc_type_quals_match() before issuing qualifier mismatch warnings. (build_binary_op): Call objc_compare_types() before issuing pointer mismatch warnings; adjust calls to comp_target_types(). * stub-objc.c (objc_comptypes): Remove stub. (objc_compare_types): New stub. (objc_volatilized_decl): Likewise. (objc_type_quals_match): Likewise. From-SVN: r100126
2005-05-18dummy-checksum.c: New.Geoffrey Keating1-0/+4
2005-05-18 Geoffrey Keating <geoffk@apple.com> * dummy-checksum.c: New. * genchecksum.c: New. * c.opt (print_pch_checksum): New flag. * c-pch.c (struct c_pch_validity): Make much shorter. (no_checksum): New. (host_machine): Remove. (target_machine): Remove. (get_ident): Change PCH version number. (pch_init): When -fverbose-asm, print out the compiler fingerprint. Don't put triplets or version string in PCH validity data. Do put the compiler checksum in the validity data. (c_common_valid_pch): Don't check triplets or version string. Do check checksum. (c_common_print_pch_checksum): New. * c-opts.c (c_common_handle_option): Add OPT_print_pch_checksum. Print fingerprint with -v. * c-common.h (c_common_print_pch_checksum): New. (executable_checksum): New. * Makefile.in (STAGEMOVESTUFF): Add cc1*-dummy, *-checksum.c. (cc1-dummy): New rule. (cc1-checksum.c): New rule. (cc1-checksum.o): New rule. (cc1): Add checksum support. (build/genchecksum): New. (build/genchecksum.o): New. (dummy-checksum.o): New. (genobjnames): Add genchecksum.o. (mostlyclean): Remove *-checksum.c. (gnucompare): Add libgcc to list of directories checked. Make comparison problems in libgcc/ and with checksum files only be warnings. * doc/invoke.texi (Precompiled Headers): Remove caution. Document that it must be the exact same binary. Add a few known-safe flags to the list. In cp/: 2005-05-18 Geoffrey Keating <geoffk@apple.com> * Make-lang.in (cc1plus-dummy): New. (cc1plus-checksum.c): New. (cc1plus-checksum.o): New. (cc1plus): Add cc1plus-checksum.o. In objc/: 2005-05-18 Geoffrey Keating <geoffk@apple.com> * Make-lang.in (cc1obj-dummy): New. (cc1obj-checksum.c): New. (cc1obj-checksum.o): New. (cc1obj): Add cc1obj-checksum.o. In objcp/: 2005-05-18 Geoffrey Keating <geoffk@apple.com> * Make-lang.in (cc1objplus-dummy): New. (cc1objplus-checksum.c): New. (cc1objplus-checksum.o): New. (cc1objplus): Add cc1objplus-checksum.o. From-SVN: r99928
2005-05-17Yet more Objective-C++...Ziemowit Laski1-2/+4
* c-common.h (objc_finish_try_stmt): Add. (objc_build_synchronized): Add. (objc_generate_write_barrier): Add. * stub-objc.c (objc_build_synchronized): Add return value. (objc_finish_try_stmt): Likewise. (objc_generate_write_barrier): Add. * c-common.h (objc_rewrite_function_call): Add. * c-typeck.c (build_function_call): Allow objc to rewrite FUNCTION_DECLs. (build_modify_expr): Allow objc to generate write barriers. * c.opt (Wassign-intercept): Add. (Wstrict-selector-match): Add. (fobjc-call-cxx-cdtors): Add. (fobjc-direct-dispatch): Add. (fobjc-gc): Add. * dbxout.c (get_lang_number): Add Objective-C++ support. * doc/invoke.texi (-fobjc-call-cxx-cdtors): Likewise. (-Wstrict-selector-match): Likewise. (-fobjc-direct-dispatch): Likewise. (-Wassign-intercept): Likewise. (Overall Options): Likewise. * gengtype.c (get_output_file_with_visibility): Likewise. * stub-objc.c (objc_rewrite_function_call): Add. * config/darwin.h (ASM_OUTPUT_LABELREF): Improved quoting support. * c-common.c (flag_objc_exceptions): Remove. (flag_objc_sjlj_exceptions): Remove. * c-decl.c (objc_mark_locals_volatile): Don't change decls that are already ok. * c-opts.c (c_common_handle_option, case OPT_fobjc_exceptions): Remove. (case OPT_fobjc_sjlj_exceptions): Remove * c.opt (fobjc-call-cxx-cdtors): Have opt create the flag. (fobjc-exceptions): Likewise. (fobjc-sjlj-exceptions): Likewise. * config/rs6000/darwin.h (OFFS_MSGSEND_FAST): Add. (OFFS_ASSIGNIVAR_FAST): Add. From-SVN: r99858
2005-05-12c-common.h (statement_code_p): Don't declare.Ian Lance Taylor1-14/+0
./: * c-common.h (statement_code_p): Don't declare. (STATEMENT_CODE_P): Don't define. (INIT_STATEMENT_CODES): Don't define. * c-common.c (statement_code_p): Don't define. cp/: * cp-tree.h (cp_stmt_codes): Don't define. (statement_code_p): Declare. (STATEMENT_CODE_P): Define. * lex.c (statement_code_p): Define. (cxx_init): Use actual codes in stmt_codes initializer, not cp_stmt_codes macro. Initialize statement_code_p directly, rather than using INIT_STATEMENT_CODES. From-SVN: r99615
2005-05-02re PR c++/19542 (attribute(sentinel) has problems with C++ __null)Michael Matz1-0/+11
PR c++/19542 * c-common.c (c_common_nodes_and_builtins): Create global null_node. (warn_strict_null_sentinel): Define. (check_function_sentinel): Check for null_node as valid sentinel too. * c-common.h (c_tree_index): Added CTI_NULL. (null_node) Define global_tree[CTI_NULL]. (warn_strict_null_sentinel): Declare. * c-opts.c: (c_common_handle_option): Handle -Wstrict-null-sentinel. * c.opt: (Wstrict-null-sentinel): New C++ option. * doc/invoke.texi (C++ Options): Document -Wstrict-null-sentinel. * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C common frontend. (null_node): Remove. * lex.c (cxx_init): Move null_node initialisation to C common frontend. * g++.dg/warn/sentinel.C: New testcase for __null sentinels added. From-SVN: r99091
2005-04-25c-common.def (EXPR_STMT): Remove, moved to C++ frontend.Ian Lance Taylor1-7/+0
./ * c-common.def (EXPR_STMT): Remove, moved to C++ frontend. * c-common.h (EXPR_STMT_EXPR): Don't define. (c_common_stmt_codes): Don't define. * c-dump.c (c_dump_tree): Remove EXPR_STMT case. * c-gimplify.c (gimplify_expr_stmt): Remove. (c_gimplify_expr): Remove EXPR_STMT case. * c-objc-common.c (c_objc_common_init): Remove stmt_codes and call to INIT_STATEMENT_CODES. * c-pretty-print.c (pp_c_statement): Just call dump_generic_node. cp/ * cp-tree.def: Add EXPR_STMT. * cp-tree.h (cp_stmt_codes): Add EXPR_STMT. (EXPR_STMT_EXPR): Define. * cp-gimplify.c: Include "flags.h". (gimplify_expr_stmt): New static function. (cp_gimplify_expr): Handle EXPR_STMT. * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression rather than pp_expression. (pp_cxx_statement): Handle EXPR_STMT. * dump.c (cp_dump_tree): Handle EXPR_STMT. * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes initializer. From-SVN: r98731
2005-04-21c-common.h (objc_build_method_signature): Update prototype.Roger Sayle1-1/+1
* c-common.h (objc_build_method_signature): Update prototype. * stub-objc.c (objc_build_method_signature): Update the stub implementation to accept and ignore additional parameter. * c-parser.c (c_parser_objc_method_decl): Reorgnize to pass the value of ellipsis to objc_build_method_signature instead of setting TREE_OVERFLOW on the parms TREE_LIST node. * objc-act.h (METHOD_ADD_ARGS_ELLIPSIS_P): New macro for accessing this field of an objc method decl. * objc-act.c (build_method_decl): Take an additional "ellipsis" argument, and set METHOD_ADD_ARGS_ELLIPSIS_P as appropriate. (objc_build_method_signature): Accept additional "ellipsis" argument and pass it to build_method_decl. (get_arg_type_list, start_method_def, gen_method_decl): Use the new METHOD_ADD_ARGS_ELLIPSIS_P instead of examining the TREE_OVERFLOW field of a TREE_LIST node. From-SVN: r98528
2005-04-20c-common.def: Remove STMT_EXPR (moved to cp/cp-tree.def).Ian Lance Taylor1-8/+0
./ * c-common.def: Remove STMT_EXPR (moved to cp/cp-tree.def). * c-common.h (STMT_EXPR_STMT): Don't define. (STMT_EXPR_NO_SCOPE): Don't define. * c-dump.c (c_dump_tree): Don't handle STMT_EXPR. * c-pretty-print.c (pp_c_primary_expression): Likewise. (pp_c_expression): Likewise. cp/ * cp-tree.def: Add STMT_EXPR. * cp-tree.h (STMT_EXPR_NO_SCOPE): Define. (STMT_EXPR_STMT): Define. * cxx-pretty-print.c (pp_cxx_primary_expression): Handle STMT_EXPR. (pp_cxx_expression): Likewise. (pp_cxx_statement): Call pp_cxx_statement, not pp_statement. * dump.c (cp_dump_tree): Handle STMT_EXPR. From-SVN: r98469
2005-04-17c-common.def (SIZEOF_EXPR, [...]): Remove.Ian Lance Taylor1-3/+3
./ * c-common.def (SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR): Remove. * c-common.c (c_sizeof_or_alignof_type): Change second parameter from enum tree_code op to bool is_sizeof. * c-common.h (c_sizeof_or_alignof_type): Update declaration. (c_sizeof, c_alignof): Update calls to c_sizeof_or_alignof_type. * c-pretty-print.c (pp_c_postfix_expression): Remove ARROW_EXPR case. (pp_c_unary_expression): Remove SIZEOF_EXPR and ALIGNOF_EXPR cases. (pp_c_expression): Remove ARROW_EXPR, SIZEOF_EXPR, and ALIGNOF_EXPR cases. cp/ * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR. * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle ARROW_EXPR. (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR. (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and ALIGNOF_EXPR. * typeck.c (cxx_sizeof_or_alignof_type): Update call to c_sizeof_or_alignof_type for change in parameter type. From-SVN: r98297
2005-04-14re PR middle-end/14311 (builtins for atomic operations needed)Richard Henderson1-0/+4
PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-09c-common.def: Move FOR_STMT...Ian Lance Taylor1-29/+2
./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-08* c-common.h (C_ARTIFICIAL_STRING_P): Remove.Kazu Hirata1-4/+0
From-SVN: r97849
2005-04-05c-typeck.c (struct c_switch): Rename switch_stmt field to switch_expr.Ian Lance Taylor1-0/+1
* c-typeck.c (struct c_switch): Rename switch_stmt field to switch_expr. (c_start_case): Build SWITCH_EXPR, not SWITCH_STMT. (do_case): Use SWITCH_COND rather than SWITCH_STMT_COND. (c_finish_case): Use SWITCH_BODY rather than SWITCH_STMT_BODY. Call c_do_switch_expr_warnings rather than c_do_switch_warnings. * c-common.c (c_do_switch_warnings_1): New static function broken out of c_do_switch_warnings. (c_do_switch_warnings): Call c_do_switch_warnings_1. (c_do_switch_expr_warnings): New function. * c-common.h (c_do_switch_expr_warnings): Declare. From-SVN: r97593
2005-03-29re PR c/20519 (completed type not selected properly with typeof)Richard Henderson1-0/+2
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-23c-common.h (default_conversion): Remove.Joseph Myers1-1/+1
* 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-21c-common.c (lvalue_or_else): Replace by lvalue_error; only give diagnostic ↵Joseph Myers1-3/+2
without checking whether an lvalue. * c-common.c (lvalue_or_else): Replace by lvalue_error; only give diagnostic without checking whether an lvalue. * c-common.h (lvalue_p): Remove. (enum lvalue_use): Update comment. (lvalue_or_else): Replace by lvalue_error. * c-typeck.c (lvalue_p): Make static. (lvalue_or_else): New. Call lvalue_error. cp: * cp-tree.h (lvalue_or_else, lvalue_p): New. * typeck.c (lvalue_or_else): New. Call lvalue_error. From-SVN: r96776
2005-02-20re PR middle-end/18785 (isdigit builtin function fails with EBCDIC character ↵Zack Weinberg1-0/+2
sets) PR 18785 libcpp: * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro. (cpp_host_to_exec_charset): New function. * include/cpplib.h: Declare cpp_host_to_exec_charset. gcc: * langhooks.h (struct lang_hooks): Add to_target_charset. * langhooks.c (lhd_to_target_charset): New function. * langhooks-def.h: Declare lhd_to_target_charset. (LANG_HOOKS_TO_TARGET_CHARSET): New macro. (LANG_HOOKS_INITIALIZER): Update. * c-common.c (c_common_to_target_charset): New function. * c-common.h: Declare it. * c-objc-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to c_common_to_target_charset. * defaults.c (TARGET_BELL, TARGET_BS, TARGET_CR, TARGET_DIGIT0) (TARGET_ESC, TARGET_FF, TARGET_NEWLINE, TARGET_TAB, TARGET_VT): Delete definitions. * system.h: Poison them. * doc/tm.texi: Don't discuss them. * builtins.c (fold_builtin_isdigit): Use lang_hooks.to_target_charset. * c-pretty-print.c (pp_c_integer_constant): Don't use pp_c_char. (pp_c_char): Do not attempt to generate letter escapes for newline, tab, etc. * config/arm/arm.c (output_ascii_pseudo_op): Likewise. * config/mips/mips.c (mips_output_ascii): Likewise. gcc/cp: * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to c_common_to_target_charset. Delete bogus comment. gcc/testsuite: * gcc.dg/charset/builtin1.c: New test. From-SVN: r95304
2005-01-27tree.h (SWITCH_COND, [...]): Add tree checks.Steven Bosscher1-1/+3
* tree.h (SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, CASE_LOW, CASE_HIGH, CASE_LABEL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS, ASM_CLOBBERS): Add tree checks. * c-common.h (SWITCH_TYPE): Rename to SWITCH_STMT_TYPE. (SWITCH_STMT_COND, SWITCH_STMT_BODY): New. * c-common.def (SWITCH_STMT): Update to match. * c-common.c (c_do_switch_warnings): Use SWITCH_STMT accessor macros instead of SWITCH_EXPR ones. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (gimplify_switch_stmt): Likewise. * c-typeck.c (c_start_case, do_case, c_finish_case): Likewise. cp/ * decl.c (finish_case_label): Use SWITCH_STMT accessor macros instead of SWITCH_EXPR ones. * pt.c (tsubst_expr): Likewise. * semantics.c (begin_switch_stmt, finish_switch_cond, finish_switch_stmt): Likewise. doc/ * c-tree.texi (SWITCH_STMT): Update accessor macro names. From-SVN: r94315
2005-01-23c-common.c (explicit_flag_signed_bitfields, [...]): Remove.Kazu Hirata1-3/+0
* c-common.c (explicit_flag_signed_bitfields, lang_statement_code_p, lang_expand_function_end): Remove. * c-common.h: Remove the corresponding declarations. * c-opts.c (c_common_handle_option): Remove all write access to explicit_flag_signed_bitfields. From-SVN: r94120
2005-01-23alias.c, [...]: Fix comment typos.Kazu Hirata1-4/+4
* alias.c, c-common.h, c-incpath.c, c-incpath.h, expr.c, fold-const.c, gimplify.c, params.h, tree-data-ref.c, tree-if-conv.c, tree-nested.c, tree-outof-ssa.c, tree-ssa-dom.c, tree-vectorizer.c, tree.def, config/darwin.c, config/freebsd-spec.h, config/arm/arm.h, config/h8300/h8300.md, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/ia64/ia64.c, config/ip2k/ip2k.c, config/s390/s390.c, config/vax/vax.md: Fix comment typos. Follow spelling conventions. From-SVN: r94112
2004-12-20re PR c++/19044 (Alternate asm name for atan ignored when calling ↵Matt Austern1-0/+2
__builtin_atan) PR c++/19044 * c-common.c (set_builtin_user_assembler_name): New. * c-common.h (set_builtin_user_assembler_name): Declare. * c-decl.c (finish_decl): Use set_builtin_user_assembler_name * decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name * g++.dg/ext/builtin6.C: New From-SVN: r92428
2004-11-25re PR c++/18001 (Badly formatted error message (quotation problem))Mark Mitchell1-0/+13
PR c++/18001 * c-common.h (lvalue_use): Move here from c-ctypeck.c. (lvalue_or_else): Declare. * c-common.c (lvalue_or_else): Move here from c-typeck.c. * c-typeck.c (lvalue_use): Remove. (lvalue_or_else): Remove. PR c++/18556 * toplev.c (check_global_declarations): Set DECL_IGNORED_P on unemitted variables with static storage duration. PR c++/18445 * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with unknown_type as non matching. Tidy up. * pt.c (build_non_dependent_expr): Do not build a NON_DEPENDENT_EXPR for a VAR_DECL. PR c++/18001 * cp-tree.h (lvalue_or_else): Remove declaration. * tree.c (lvalue_or_else): Remove. * typeck.c (build_unary_op): Adjust call to lvalue_or_else. (build_modify_expr): Likewise. PR c++/18625 * decl.c (duplicate_decls): Return error_mark_node on error, as specified. PR c++/18466 * decl.c (grokvardecl): Keep track of whether or not a there was explicit qualification. * name-lookup.c (set_decl_namespace): Complain about explicit qualification of a name within its own namespace. PR c++/18545 * typeck.c (check_return_expr): Robustify. PR c++/18445 * g++.dg/template/crash28.C: Likewise. PR c++/18001 * g++.dg/expr/unary2.C: Adjust lvalue messages. * g++.dg/ext/lvaddr.C: Likewise. * g++.dg/opt/pr7503-3.C: Likewise. PR c++/18466 * g++.dg/parse/qualified3.C: New test. * g++.old-deja/g++.other/friend7.C: Remove bogus qualification. PR c++/18545 * g++.dg/expr/return1.C: New test. From-SVN: r91301
2004-11-17basic-block.h, [...]: Remove unused prototypes.Kazu Hirata1-2/+0
* basic-block.h, c-common.h, df.h, expr.h, output.h, rtl.h, tree-chrec.h, tree-flow.h, tree-scalar-evolution.h, tree-ssa-live.h, tree.h: Remove unused prototypes. From-SVN: r90821
2004-11-14c-common.c (walk_stmt_tree): Remove.Kazu Hirata1-1/+0
* c-common.c (walk_stmt_tree): Remove. * c-common.h: Remove the corresponding prototype. From-SVN: r90618
2004-10-31c-common.h (objc_lookup_ivar): Add second parameter to prototype.Ziemowit Laski1-1/+1
[gcc/ChangeLog] 2004-10-30 Ziemowit Laski <zlaski@apple.com> * c-common.h (objc_lookup_ivar): Add second parameter to prototype. * c-typeck.c (build_external_ref): After looking up symbol, pass it to objc_lookup_ivar() to decide whether it or the ivar should be used, rather than deciding the issue locally. * stub-objc.c (objc_lookup_ivar): Add an OTHER parameter, which is simply returned in the non-ObjC case. [gcc/objc/ChangeLog] 2004-10-30 Ziemowit Laski <zlaski@apple.com> * objc-act.c (objc_lookup_ivar): The new OTHER parameter contains the result of the ID lookup by the C or C++ front-end; in class methods, use OTHER if it exists; in instance methods, use OTHER only if it is locally declared. [gcc/testsuite/ChangeLog] 2004-10-30 Ziemowit Laski <zlaski@apple.com> * objc.dg/local-decl-1.m: New test. From-SVN: r89912
2004-10-25c-common.h: Remove RID_ID.Ziemowit Laski1-1/+1
[gcc/ChangeLog] 2004-10-25 David Ayers <d.ayers@inode.at> * c-common.h: Remove RID_ID. * c-parse.in: Remove OBJECTNAME and references to RID_ID. (typespec_reserved_attr): Add rule for TYPENAME non_empty_protocolrefs. (yylexname): Remove special handling of RID_ID. [gcc/objc/ChangeLog] 2004-10-25 Ziemowit Laski <zlaski@apple.com> David Ayers <d.ayers@inode.at> * objc-act.c (objc_comptypes): Use IS_PROTOCOL_QUALIFIED_UNTYPED instead of IS_PROTOCOL_QUALIFIED_ID; add comparisons for: 'Class <Protocol> != id <Protocol>'; 'Class <Protocol> != <class> *'; 'Class <Protocol> == id' and 'Class <Protocol> == Class'. (objc_is_id): Add test for 'super'. (objc_finish_message_expr): Allow for messaging of 'Class <Proto>' receivers; if class methods are not found in protocol lists, search for instance methods therein and warn if one is found. Look in global hash tables for suitable method as a last resort when messaging 'id <Proto>', 'Class <Proto>' and invalid receiver types. (objc_add_method): Insert instance methods listed in protocols into the global class method hash table. * objc-act.h (IS_PROTOCOL_QUALIFIED_ID): Rename to IS_PROTOCOL_QUALIFIED_UNTYPED and allow for 'Class <Proto>' in addition to 'id <Proto>'. [gcc/testsuite/ChangeLog] 2004-10-25 David Ayers <d.ayers@inode.at> Ziemowit Laski <zlaski@apple.com> * objc.dg/call-super-2.m: Add messages to 'Class <Proto>'; update diagnostics when messaging 'id <Proto>'. * objc.dg/class-protocol-1.m: New test. * objc.dg/desig-init-1.m: Add message to an invalid receiver using a non-existent method signature. * objc.dg/method-5.m, objc.dg/method-6.m, objc.dg/proto-hier-1.m: Update diagnostics when messaging with non-existent method signature. * objc.dg/proto-hier-2.m: Adjust wording of diagnostic. * objc.dg/proto-lossage-1.m, objc.dg/proto-lossage-4.m: Messages to invalid receivers are now resolved as if messaging 'id'; remove extraneous diagnostics. From-SVN: r89562
2004-10-22c-semantics.c (re_push_stmt_list): Remove.Kazu Hirata1-1/+0
* c-semantics.c (re_push_stmt_list): Remove. * c-common.h: Remove the corresponding prototype. From-SVN: r89468