Commit Graph

66 Commits

Author SHA1 Message Date
Manuel López-Ibáñez 05170031ab re PR c/9072 (-Wconversion should be split into two distinct flags)
2006-11-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c/9072 
	* c.opt (Wtraditional-conversion): New.
	(Wconversion): Update description.
	* c-typeck.c (convert_arguments): Warnings for prototypes causing
	type conversions different from what would happen in the absence
	of prototype are now handled by Wtraditional-conversion.
	* doc/invoke.texi (Wtraditional-conversion): New.
	(Wconversion): Update description.
	* doc/trouble.texi (Wconversion): Replace Wconversion by
	Wtraditional-conversion.

testsuite/

	PR c/9072 
	* gcc.dg/builtin-protos-1.c: Replace Wconversion by
	Wtraditional-conversion.
	* gcc.dg/overflow-warn-2.c: Likewise.
	* gcc.dg/Wconversion.c: Likewise. Renamed as
	Wtraditional-conversion.c .
	* gcc.dg/Wconversion-2.c: Likewise. Renamed as
	Wtraditional-conversion-2.c .
	* gcc.dg/dfp/Wconversion-2.c: Likewise. Renamed as
	Wtraditional-conversion-2.c 
	* gcc.dg/Wconversion-negative-constants.c: New.

From-SVN: r119129
2006-11-23 18:39:32 +00:00
Doug Gregor 966541e34d c-common.c (flag_cpp0x): New.
2006-11-01	Douglas Gregor <doug.gregor@gmail.com>

	* c-common.c (flag_cpp0x): New.
	* c-common.h (flag_cpp0x): New.
	* c-cppbuiltin.c (c_cpp_builtins): If C++0x extensions are
	supported, define __GXX_EXPERIMENTAL_CPP0X__.
	* c-opts.c (set_std_cxx0x): New.
	(c_common_handle_option): Handle -std=c++0x, -std=gnu++0x.
	* c.opt (std=c++0x): Document.
	(std=gnu++0x): Ditto.
	* doc/cpp.texi: Document __GXX_EXPERIMENTAL_CPP0X__.
	* doc/invoke.texi: Document -std=c++0x, -std=gnu++0x.

From-SVN: r118386
2006-11-01 16:29:06 +00:00
Joseph Myers 7ed322d7b5 re PR c/24010 (Duplicate C99 dot initializer warning missing)
PR c/24010
	* c.opt (Woverride-init): New.
	* c-opts.c (c_common_post_options): Default warn_override_init to
	extra_warnings.
	* c-typeck.c (add_pending_init, output_init_element): Warn for
	overriding initializers without side effects.
	* doc/invoke.texi (-Woverride-init): Document.
	(-Wextra): Update.

testsuite:
	* gcc.dg/Woverride-init-1.c, gcc.dg/Woverride-init-2.c,
	gcc.dg/Woverride-init-3.c: New tests.

From-SVN: r117334
2006-09-30 20:46:06 +01:00
Mike Stump c22cacf346 Whitespace fixups
From-SVN: r113893
2006-05-18 22:16:23 +00:00
Geoffrey Keating c7b5e39561 Index: gcc/ChangeLog
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-24 21:43:01 +00:00
Gabriel Dos Reis d539b114d4 invoke.texi (-Write-strings): Document that it is enabled by default.
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-02-13 01:57:29 +00:00
Gabriel Dos Reis cfb10bd3ba c-common.h (flag_const_strings): Don't declare.
2006-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * c-common.h (flag_const_strings): Don't declare.
        * c-common.c (flag_const_strings): Remove.
        * c.opt (fconst_strings): Remove.
        * c-opts.c (c_common_handle_option): Remove
        * <OPT_fconst_strings>.
        <OPT_Wwrite_strings>: Don't set flag_const_strings.
        (c_common_init_options): Don't set flag_const_strings.
        * doc/invoke.texi (-fno-const-strings): Remove documentation.

cp/
2006-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * typeck.c (string_conv_p): Don't test for flag_const_strings.

testsuite/ 
2006-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * g++.old-deja/g++.benjamin/15351-2.C: Likewise.
        * g++.old-deja/g++.benjamin/15351-1.C: Remove.

From-SVN: r110804
2006-02-09 16:28:26 +00:00
Dirk Mueller 1104b28bc8 c.opt: C++ frontend supports -Wdiv-by-zero.
2006-02-07  Dirk Mueller <dmueller@suse.com>

        * c.opt: C++ frontend supports -Wdiv-by-zero.
        * c-opts.c (c_common_handle_option): Remove dead case.

        * typeck.c (build_binary_op): Annotate div-by-zero
        warnings to make -Wno-div-by-zero have an effect.

        g++.dg/warn/Wdiv-by-zero.C: New test.
        g++.dg/warn/Wno-div-by-zero.C: New.

From-SVN: r110712
2006-02-07 19:41:14 +00:00
Zack Weinberg 89a42ac8a1 c.opt: Add -W(no-)overlength-strings.
gcc:
	* c.opt: Add -W(no-)overlength-strings.
	* doc/invoke.texi: Document it.
	* c-opts.c (c_common_handle_option): -pedantic implies
	-Woverlength-strings, if not explicitly disabled already.
	(c_common_post_options): -Woverlength-strings defaults to off, and
	is always off for C++.
	* c-common.c (fix_string_type): Issue warning about strings longer
	than is portable only if warn_overlength_strings.  Rearrange code
	a little for clarity.
	* configure.in: Check for -Wno-overlength-strings as well before
	enabling -pedantic in stage 1.
	* Makefile.in (STRICT2_WARN): Add -Wno-overlength-strings.
	(gcc.o-warn, insn-automata.o-warn, build/gencondmd.o-warn): Delete.

	* genconditions.c (write_header, write_one_condition)
	(write_conditions, write_writer): Consolidate very long strings
	that were broken up to fit in C89 portable limit.  Don't use
	printf when fputs will do.

gcc/testsuite:
	* gcc.dg/Woverlength-strings.c
	* gcc.dg/Woverlength-strings-pedantic-c89.c
	* gcc.dg/Woverlength-strings-pedantic-c89-no.c
	* gcc.dg/Woverlength-strings-pedantic-c99.c
	* gcc.dg/Woverlength-strings-pedantic-c99-no.c: New tests.

==================================================================

From-SVN: r110360
2006-01-29 03:30:47 +00:00
Alexandre Oliva f4e9414ef8 re PR c/25892 (-Wpointer-sign creates problems for Emacs)
gcc/ChangeLog:
PR c/25892
* c.opt (Wpointer-sign): Init to -1.
* c-opts.c (c_common_handle_option): Set to 1 on OPT_Wall and
OPT_pedantic, to 0 otherwise.
* doc/invoke.texi: Update.
gcc/testsuite/ChangeLog:
PR c/25892
* gcc.dg/Wpointer-sign.c: New.
* gcc.dg/Wpointer-sign-Wall.c: New.
* gcc.dg/Wpointer-sign-Wall-no.c: New.
* gcc.dg/Wpointer-sign-pedantic.c: New.
* gcc.dg/Wpointer-sign-pedantic-no.c: New.
* gcc.dg/conv-2.c: Use -Wpointer-sign.

From-SVN: r110265
2006-01-26 18:50:37 +00:00
Joseph Myers 2b6dd222bb re PR libstdc++/25524 (libstdc++ headers should go in multilib directories)
PR libstdc++/25524
	* cppdefault.h (struct default_include): Add multilib flag.
	* cppdefault.c (cpp_include_defaults): Set it.
	* c.opt (-imultilib): New option.
	* c-opts.c (imultilib): New.
	(c_common_handle_option): Handle -imultilib.
	(c_common_post_options): Likewise.
	* c-incpath.c (add_standard_paths, register_include_chains):
	Likewise.
	* c-incpath.h (register_include_chains): Add extra parameter.
	* gcc.c (do_spec_1): Generate -imultilib option.
	(The Specs Language): Update %I description.
	(process_command): Update copyright notice.
	* doc/cppopts.texi (-imultilib): Document.
	* doc/invoke.texi (-imultilib): Include in option summary.
	(%I): Update specs documentation.

libstdc++-v3:
	* include/Makefile.am: Install host-specific headers in multilib
	subdirectory.
	* include/Makefile.in: Regenerate.

From-SVN: r110037
2006-01-20 21:00:03 +00:00
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
David Edelsohn 71157977c6 * c.opt (ffixed-line-length-none): New.
From-SVN: r107038
2005-11-15 14:14:59 -05:00
Francois-Xavier Coudert a67ec6ab99 re PR fortran/18452 (Fortran options induces warning for fortran that needs preprocessing)
PR fortran/18452

	* gcc/fortran/lang-specs.h: Pass -lang-fortran to the preprocessor.

	* gcc/c.opt: Add a -lang-fortran option.
	* gcc/c-opts.c: Add a lang_fortran flag.
	(c_common_init_options): Handling the -lang-fortran option.
	(c_common_handle_option): Add a case for Fortran options in
	preprocessing. Remove cases for -ffixed-form and
	-ffixed-line-length. Add a case for -lang-fortran.

From-SVN: r106483
2005-11-04 08:29:16 +00:00
Joseph Myers af15a2fed7 c.opt (fextended-identifiers): New.
gcc:
	* c.opt (fextended-identifiers): New.
	* c-opts.c (c_common_handle_option): Handle
	-fextended-identifiers.
	* doc/cpp.texi: Update documentation of extended identifiers.
	* doc/cppopts.texi (-fextended-identifiers): Document.

gcc/testsuite:
	* g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C,
	g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c,
	gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c,
	gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c,
	gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c,
	gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c,
	gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c,
	gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers.
	* gcc.dg/cpp/ucnid-8.c: New test.

libcpp:
	* include/cpplib.h (struct cpp_options): Add extended_identifiers.
	* init.c (struct lang_flags, lang_defaults): Add
	extended_identifiers.
	(cpp_set_lang): Use it.
	* lex.c (forms_identifier_p): Check extended_identifiers.

From-SVN: r104462
2005-09-20 21:31:37 +01:00
Ian Lance Taylor d63d5d0c32 re PR c++/7874 (g++ finds friend functions defined in class-definition but not declared in the enclosing namespace)
./	PR g++/7874
	* c.opt (ffriend-injection): New C++ option.
	* doc/invoke.texi (Option Summary): Mention -ffriend-injection.
	(C++ Dialect Options): Document -ffriend-injection.
cp/
	PR g++/7874
	* cp-tree.h (struct lang_decl_flags): Add hidden_friend_p
	bitfield.  Make dummy bitfield one bit smaller.
	(DECL_HIDDEN_FRIEND_P): Define.
	(pushdecl_maybe_friend): Declare.
	(pushdecl_top_level_maybe_friend): Declare.
	* decl.c (duplicate_decls): Add newdecl_is_friend parameter.
	Change prototype and all callers.  Add assertion that a
	DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P.  Set
	DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if
	appropriate.
	* name-lookup.c (supplement_binding): Don't ignore a
	DECL_HIDDEN_FRIEND_P.
	(pushdecl_maybe_friend): Break out contents of pushdecl.  Add
	is_friend parameter.  Set DECL_ANTICIPATED and
	DECL_HIDDEN_FRIEND_P for a friend function.
	(pushdecl): Just call pushdecl_maybe_friend.
	(pushdecl_with_scope): Add is_friend parameter.  Change prototype
	and all callers.
	(pushdecl_namespace_level): Likewise.
	(push_overloaded_decl): Likewise.  Check DECL_HIDDEN_FRIEND_P as
	well as DECL_ANTICIPATED when checking for a builtin.
	(do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as
	DECL_ANTICIPATED when checking for a builtin.
	(do_nonmember_using_decl): Likewise.
	(pushdecl_top_level_1): Add is_friend parameter.  Change all
	callers.
	(pushdecl_top_level_maybe_friend): New function.
	(remove_hidden_names): New function.
	(struct arg_lookup): Add args field.
	(friend_of_associated_class_p): New static function.
	(arg_assoc_namespace): Ignore hidden functions which are not
	friends of an associated class of some argument.
	(lookup_arg_dependent): Remove hidden functions from list passed
	in.  Initialize k.args.
	* name-lookup.h (remove_hidden_names): Declare.
	* friend.c (do_friend): Call pushdecl_maybe_friend instead of
	pushdecl.
	* call.c (add_function_candidate): Change DECL_ANTICIPATED test to
	an assertion, with a check for DECL_HIDDEN_FRIEND_P.
	(build_new_function_call): Add koenig_p parameter.  Change
	prototype and callers.
	* pt.c (register_specialization): Add is_friend parameter.  Change
	all callers.
	(push_template_decl_real): Change is_friend parameter to bool.
	Change prototype and all callers.
	(tsubst_friend_class): Call pushdecl_top_level_maybe_friend
	instead of pushdecl_top_level.
testsuite/
	PR g++/7874
	* g++.dg/lookup/friend7.C: New test.
	* g++.dg/lookup/friend8.C: New test.
	* g++.dg/parse/defarg4.C: Add a parameter to the friend function,
	so that it will be found via argument dependent lookup.
	* g++.old-deja/g++.brendan/crash56.C: Don't expect errors for
	friend functions which will no longer be found.
	* g++.old-deja/g++.jason/friend.C: Add a parameter to the friend
	function g, so that it will be found via argument dependent
	lookup.
	* g++.old-deja/g++.jason/scoping15.C: Use -ffriend-injection.
	* g++.old-deja/g++.mike/net43.C: Likewise.

From-SVN: r104188
2005-09-12 19:54:23 +00:00
DJ Delorie b9b8dde302 toplev.h: Add comment about the first parameter for warning().
* toplev.h: Add comment about the first parameter for warning().
* errors.h: Likewise.

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

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

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

From-SVN: r102168
2005-07-19 16:19:16 -04:00
Joseph Myers ab532386bd bb-reorder.c, [...]: Avoid "." or "\n" at end of diagnostics and capital letters at start of diagnostics.
* bb-reorder.c, c-pch.c, c-pragma.c, c.opt, cfghooks.c, cfgloop.c,
	cfgrtl.c, cgraphunit.c, config/c4x/c4x.c, config/cris/cris.c,
	config/frv/frv.c, config/host-darwin.c, config/iq2000/iq2000.c,
	config/lynx.h, config/m68k/m68k.c, config/pa/pa.c, config/sh/sh.h,
	config/stormy16/stormy16.c, config/v850/v850.c,
	config/vax/netbsd-elf.h, coverage.c, dwarf2out.c, emit-rtl.c,
	except.c, gcc.c, tree-cfg.c, tree-eh.c, tree-ssa.c, xcoffout.c:
	Avoid "." or "\n" at end of diagnostics and capital letters at
	start of diagnostics.
	* combine.c, cse.c: Don't translate dump file output.
	* toplev.c (print_version): Only translate output if going to
	stderr.

From-SVN: r101561
2005-07-03 22:08:11 +01:00
Joseph Myers c85ce869e7 c.opt, [...]: Remove "." from end of help texts.
* c.opt, common.opt, config/bfin/bfin.opt, config/pa/pa.opt,
	config/rs6000/rs6000.opt, params.def: Remove "." from end of help
	texts.
	* config/avr/avr.c: Do not use '`' as left quote.
	* config/rs6000/rs6000.c, config/s390/s390.c, opts.c, tree.c:
	Remove "." from end of diagnostics.  Make diagnostics start with
	lowercase letter.

cp:
	* name-lookup.c, parser.c: Use %q, %< and %> to quote in
	diagnostics.

fortran:
	* lang.opt: Remove "." from end of help texts.

objc:
	* objc-act.c: Use %q to quote in diagnostics.

From-SVN: r101533
2005-07-02 14:19:59 +01:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Gabriel Dos Reis b7e20b53f6 re PR c/21759 (Implement warning for codes at the intersection of C and C++)
PR c/21759
        * c.opt (Wc++-compat): New.
        * doc/invoke.texi (-Wc++-compat): Document.
        * c-typeck.c (convert_for_assignment): Check for implicit
        conversion void* -> T*.
testsuite/
        * gcc.dg/Wcxx-compat-1.c: New.

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

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

From-SVN: r100135
2005-05-24 23:59:00 -04:00
Geoffrey Keating 3fd30b88df dummy-checksum.c: New.
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-18 20:45:26 +00:00
Ziemowit Laski 6e95543072 Yet more Objective-C++...
* 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-17 20:11:44 +00:00
Michael Matz b2f97e4a12 re PR c++/19542 (attribute(sentinel) has problems with C++ __null)
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-05-02 04:22:45 +00:00
Joseph Myers 53a2494eea c.opt (Wint-to-pointer-cast, [...]): New options.
2005-04-20  Michael Pogue  <michael.pogue@sun.com>
            Joseph S. Myers  <joseph@codesourcery.com>

	* c.opt (Wint-to-pointer-cast, Wpointer-to-int-cast): New options.
	* c-typeck.c (build_c_cast): Check these options.
	* doc/invoke.texi: Document these options.

testsuite:
	* gcc.dg/Wint-to-pointer-cast-1.c,
	gcc.dg/Wint-to-pointer-cast-2.c, gcc.dg/Wint-to-pointer-cast-3.c,
	gcc.dg/Wpointer-to-int-cast-1.c, gcc.dg/Wpointer-to-int-cast-2.c,
	gcc.dg/Wpointer-to-int-cast-3.c: New tests.

From-SVN: r98429
2005-04-20 02:10:00 +01:00
Richard Sandiford 4e9944320f c.opt (-F): Remove trailing whitespace from help string.
* c.opt (-F): Remove trailing whitespace from help string.
	(-finput-charset): Use a tab to separate the switch name and help
	string.
	* common.opt (-fsched-stalled-insns, -fsched-stalled-insns-dep)
	(-ftree-vectorizer-verbose): Likewise.

From-SVN: r97742
2005-04-06 18:37:24 +00:00
Per Bothner 8abb6b2217 Make -f[no-]show-column also control non-cpp diagnostics.
* c.opt (fshow-column): Move option from here ...
	* common.opt (fshow-column): ... to here.
	* diagnostic.c (diagnostic_build_prefix): Only print column number
	if flag_show_column.

From-SVN: r97127
2005-03-28 00:04:41 -08:00
Geoffrey Keating d0b0728350 --text follows this line--
This is the one case in c.opt where 'C++' appeared without 'ObjC++',
and it's annoying that it was this important option.

Bootstrapped & tested on powerpc-darwin8.  (It's actually been tested
much more extensively than that internally.)

--
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-3973957.patch=========================
2005-03-24  Geoffrey Keating  <geoffk@apple.com>

	* c.opt (fvisibility-inlines-hidden): Allow for ObjC++.

From-SVN: r97015
2005-03-24 23:18:44 +00:00
Joseph Myers 3a1e400e06 c.opt (ansi, [...]): Correct descriptions.
* c.opt (ansi, std=iso9899:1990, std=iso9899:1999,
	std=iso9899:199x): Correct descriptions.

From-SVN: r96745
2005-03-19 20:25:53 +00:00
Geoffrey Keating 50668cf626 Index: gcc/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* doc/cppopts.texi (-fexec-charset): Add concept index entry.
	(-fwide-exec-charset): Likewise.
	(-finput-charset): Likewise.
	* doc/invoke.texi (Warning Options): Document -Wnormalized=.
	* c-opts.c (c_common_handle_option): Handle -Wnormalized=.
	* c.opt (Wnormalized): New.

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

	* init.c (cpp_create_reader): Default warn_normalize to normalized_C.
	* charset.c: Update for new format of ucnid.h.
	(ucn_valid_in_identifier): Update for new format of ucnid.h.
	Add NST parameter, and update it; update callers.
	(cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
	with cpp_error.
	(convert_ucn): Pass normalize_state to cpp_valid_ucn.
	* internal.h (struct normalize_state): New.
	(INITIAL_NORMALIZE_STATE): New.
	(NORMALIZE_STATE_RESULT): New.
	(NORMALIZE_STATE_UPDATE_IDNUM): New.
	(_cpp_valid_ucn): New.
	* lex.c (warn_about_normalization): New.
	(forms_identifier_p): Add normalize_state parameter, update callers.
	(lex_identifier): Add normalize_state parameter, update callers.  Keep
	the state current.
	(lex_number): Likewise.
	(_cpp_lex_direct): Pass normalize_state to subroutines.  Check
	it with warn_about_normalization.
	* makeucnid.c: New.
	* ucnid.h: Replace.
	* ucnid.pl: Remove.
	* ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
	comments about obsolete version of C++.
	* include/cpplib.h (enum cpp_normalize_level): New.
	(struct cpp_options): Add warn_normalize field.

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

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

From-SVN: r96459
2005-03-15 00:36:33 +00:00
Richard Sandiford 7568579261 config.gcc (extra_options): New variable for listing option files.
* config.gcc (extra_options): New variable for listing option files.
	Add ${cpu_type}/${cpu_type}.opt to it if that file exists.
	* configure.ac (extra_opt_files): New AC_SUBST variable.
	(tm_file_list, tm_include_list): Include options.h first.
	* configure: Regenerate.
	* Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables.
	(s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files)
	(s-options-h): New rule.
	(options.h): Depend on it.
	(TEXI_GCCINT_FILES): Add options.texi.
	* hooks.h (hook_bool_size_t_constcharptr_int_true): Declare.
	* hooks.c (hook_bool_size_t_constcharptr_int_true): New function.
	* target.h (gcc_target): Add default_target_flags and handle_option.
	* target-def.h (TARGET_DEFAULT_TARGET_FLAGS)
	(TARGET_HANDLE_OPTION): New macros.
	(TARGET_INITIALIZER): Include them.
	* opt-functions.awk (opt_args, nth_arg): New functions.
	(switch_flags): Handle the "Target" flag.
	(var_args): Delete.
	(var_name): Use opt_args and nth_arg.
	(var_set, var_ref): Likewise.  Handle "Mask" and "InverseMask".
	* opth-gen.awk: Declare target_flags.  Declare MASK_* and TARGET_*
	macros for the "Mask" and "InverseMask" options.
	* opts.h (cl_var_cond): New enum.
	(cl_option): Replace the "has_set_value" and "set_value" fields with
	"var_cond" and "var_value".
	(CL_TARGET): New macro.
	(option_enabled, print_filtered_help): Declare.
	(decode_options): Move definition.
	* opts.c (handle_option): Search for the original option before
	removing any "no-" prefix.  Handle CL_TARGET.  Adjust for the new
	var_cond and var_value fields.  Use targetm.handle_option to handle
	target options.
	(decode_options): Set target_flags to targetm.default_target_flags.
	(print_filtered_help): Make global.  Handle CL_TARGET.
	(option_enabled): New function.
	* toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES.
	(display_target_options, set_target_switch, print_switch_values)
	(default_pch_valid_p): Guard uses of target_switches with
	#ifdef TARGET_SWITCHES.  Also...
	(display_target_options): Display the CL_TARGET entries in cl_options.
	(set_target_option): Don't complain about the "" option when
	TARGET_SWITCHES is undefined.
	(print_switch_values): Use option_enabled.
	(default_pch_valid_p): Check cl_options[] when looking for something
	that has changed the value of target_flags.
	* c.opt: Remove documentation from top of file.
	* doc/gccint.texi: Add an "Options" chapter.  Include options.texi.
	* doc/sourecebuild.texi: Refer to the new options documentation
	instead of c.opt.  Document machine-specific .opt files.
	* doc/tm.texi (target_flags): Say that this variable is declared
	by options.h.
	(TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document.
	(TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as
	an alternative.
	* doc/options.texi: New file.

From-SVN: r96448
2005-03-14 20:18:43 +00:00
Andreas Jaeger f2fd382112 [multiple changes]
2005-01-18  Andi Kleen <ak@muc.de>

	* c-typeck.c: (convert_for_assignment): Check warn_pointer_sign.
	* c.opt (-Wpointer-sign): Add.
	* doc/invoke.texi: (-Wpointer-sign): Add.

2005-01-18  Michael Matz  <matz@suse.de>

	* gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign.

From-SVN: r93813
2005-01-18 07:03:46 +01:00
Jason Merrill 40aac94801 re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads)
PR c++/13684
        * cp/decl.c (expand_static_init): Use thread-safety API.
        (register_dtor_fn): Return the call, don't expand it.
        * cp/tree.c (add_stmt_to_compound): New fn.
        (stabilize_call): Use it.
        * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY.
        (gimple_push_cleanup): Add eh_only parm.
        (gimplify_target_expr): Pass it.
        * c.opt (-fno-threadsafe-statics): New option.
        * c-opts.c (c_common_handle_option): Handle it.
        * c-common.h (flag_threadsafe_statics): Declare it.
        * c-common.c (flag_threadsafe_statics): Record it.
        * doc/invoke.texi: Document it.
        * tsystem.h (_GNU_SOURCE): Define.
        * gthr-posix.h (__gthread_recursive_mutex_t): New typedef.
        (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro.
        (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro.
        (__gthread_recursive_mutex_init_function): New fn.
        (__gthread_recursive_mutex_lock): New fn.
        (__gthread_recursive_mutex_trylock): New fn.
        (__gthread_recursive_mutex_unlock): New fn.
        * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise.
        * gthr-win32.h, gthr-vxworks.h: Likewise.
        * gthr.h: Document.

        * libsupc++/guard.cc (static_mutex): Internal class implementing a
        recursive mutex which controls initialization of local statics.
        (__gnu_cxx::recursive_init): New exception class.
        (__cxa_guard_acquire): Deal with locking and recursion detection.
        (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.

From-SVN: r86687
2004-08-27 22:33:54 -04:00
Richard Sandiford eaac467945 re PR c/13282 (A "-Wno..." switch to turn off "missing initializer" warnings)
PR c/13282
	* c.opt (Wmissing-field-initializers): New option.
	* c-opts.c (c_common_post_options): Make -Wextra turn it on by default.
	* c-typeck.c (pop_init_level): Guard the missing field warning with
	warn_missing_field_initializers rather than extra_warnings.
	* doc/invoke.texi (-Wmissing-field-initializers): Document, moving
	some of the explanation from...
	(-Wextra): ...here.  Say that the missing field warning can be
	seperately controlled by -Wmissing-field-initializers.

cp/
	* typeck2.c (process_init_constructor): Guard the missing field warning
	with warn_missing_field_initializers rather than extra_warnings.

testsuite/
	* gcc.dg/missing-field-init-[12].c: New tests.
	* g++.dg/warn/missing-field-init-[12].C: New tests.

From-SVN: r85638
2004-08-06 11:23:23 +00:00
Niall Douglas d7afec4b07 re PR c++/9283 (__attribute__((visibility ("hidden"))) not supported for class/struct)
PR c++/9283
	PR c++/15000
	* c-common.c (c_common_attribute_table): Allow
	handle_visibility_attribute to be called for types.
	(handle_visibility_attribute) When given a type, set the visibility
	bits on the TYPE_NAME.  When given a decl, don't set no_add_attrs
	so that we can check later whether the attribute was present. Added
	warning if attribute applied to non class type.
	* c-decl.c (diagnose_mismatched_decls): Updated rules for merging
	decls and checking that they are consistent.
	* common.opt: Added -fvisibility.
	* c.opt, c-opts.c: Added -fvisibility-inlines-hidden.
	* c-pragma.h, c-pragma.c: Added handle_pragma_visibility().
	* flags.h, tree.h: Added assorted support defines for overall patch
	* opts.c: Added parsing support for -fvisibility.
	* tree.c (build_decl): Set visibility for all decls to be whatever
	is in force at that time.
	* varasm.c (default_binds_local_p_1): Reworked logic determining
	when to make a symbol locally bound.
	* doc/invoke.texi: Added documentation for -fvisibility and
	-fvisibility-inlines-hidden.

	PR c++/15000
	PR c++/9283
	* class.c (check_field_decls): Apply hidden visibility if
	-fvisibility-inlines-hidden and inlined unless otherwise specified
	(build_vtable): Set vtable visibility to class visibility.
	(check_field_decls): Default static member visibility to class
	visibility.
	(check_methods): Default method visibility to class visibility.
	* cp-tree.h: Added CLASSTYPE_VISIBILITY and
	CLASSTYPE_VISIBILITY_SPECIFIED macro.
	* decl.c (duplicate_decls): New logic for merging definition decls
	with declaration decls. Added ignore & warning when non default
	applied to global operator new or delete.
	* method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
	wherever VISIBILITY was changed
	* rtti.c (get_tinfo_decl): Set typeinfo visibility to class
	visibility.
	(tinfo_base_init): Set typeinfo name visibility to class visibility.

	PR c++/9283
	PR c++/15000
	* gcc.dg/visibility-9.c, gcc.dg/visibility-a.c: New tests.
	* g++.dg/ext/visibility/: New directory.
	* g++.dg/ext/visibility-1.C, g++.dg/ext/visibility-2.C
	g++.dg/ext/visibility-3.C, g++.dg/ext/visibility-4.C,
	g++.dg/ext/visibility-5.C, g++.dg/ext/visibility-6.C,
	g++.dg/ext/visibility-7.C: Move to g++.dg/ext/visibility/.
	* g++.dg/ext/visibility/fvisibility.C,
	g++.dg/ext/visibility/fvisibility-inlines-hidden.C,
	g++.dg/ext/visibility/fvisibility-override1.C
	g++.dg/ext/visibility/fvisibility-override2.C
	g++.dg/ext/visibility/memfuncts.C
	g++.dg/ext/visibility/noPLT.C
	g++.dg/ext/visibility/pragma.C
	g++.dg/ext/visibility/pragma-override1.C
	g++.dg/ext/visibility/pragma-override2.C
	g++.dg/ext/visibility/staticmemfuncts.C
	g++.dg/ext/visibility/virtual.C: New tests.

Co-Authored-By: Brian Ryner <bryner@brianryner.com>

From-SVN: r85167
2004-07-25 22:52:22 +00:00
Andrew Pinski 3ff0c9ed19 re PR c++/15145 (Implementing -Wsequence-point for C++ would be very useful)
2004-06-27  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/15145
        * c.opt (Wsequence-point): Enable for C++ and ObjC++.

From-SVN: r83758
2004-06-27 18:58:24 -07:00
DJ Delorie 7619c085c5 c-common.h (warn_cast_qual, [...]): Remove explicit declarations.
* c-common.h (warn_cast_qual, warn_missing_format_attribute,
warn_pointer_arith, warn_missing_prototypes, warn_parentheses,
warn_missing_braces, warn_sign_compare, warn_long_long,
warn_redundant_decls, warn_float_equal, warn_char_subscripts,
warn_conversion, warn_format_y2k, warn_format_extra_args,
warn_format_zero_length, warn_format_nonliteral,
warn_format_security, mesg_implicit_function_declaration,
warn_bad_function_cast, warn_traditional,
warn_declaration_after_statement, warn_strict_prototypes,
warn_missing_declarations, warn_nested_externs,
warn_sequence_point, warn_init_self, warn_div_by_zero,
warn_implicit_int, warn_nonnull, warn_old_style_definition,
warn_selector, warn_undeclared_selector, warn_protocol,
warn_abi, warn_invalid_offsetof, warn_ctor_dtor_privacy,
warn_overloaded_virtual, warn_nonvdtor, warn_reorder,
warn_synth, warn_pmf2ptr, warn_ecpp, warn_sign_promo,
warn_old_style_cast, warn_nontemplate_friend,
warn_deprecated): Remove explicit declarations.
* c-common.c: Likewise, remove explicit definitions.
* c-opts.c: Likewise, remove explicit assignments.
* c.opts: Likewise, add implicit declare/define/assign.

From-SVN: r83680
2004-06-25 17:24:21 -04:00
Geoffrey Keating c0d578e68f c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
	* c-common.h (flag_pch_preprocess): Declare.
	(c_common_pch_pragma): Likewise.
	* c-common.c (flag_pch_preprocess): New.
	* c-pch.c (c_common_read_pch): Support -fpreprocess-only.
	(c_common_pch_pragma): New.
	* c-ppoutput.c (cb_read_pch): New.
	(init_pp_output): Support -fpch-preprocess.
	* c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess.
	* c.opt (fpch-preprocess): New.
	* gcc.c (cpp_options): When save-temps, pass -fpch-preprocess.
	* doc/cppopts.texi: Document -fpch-preprocess.
	* doc/invoke.texi (Precompiled Headers): Mention that
	-fpreprocessed is safe for PCH.  Mention that if an option is
	listed as safe that doesn't mean it does what you expect.

Index: gcc/testsuite/ChangeLog
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/pch/save-temps-1.c: New file.
	* gcc.dg/pch/save-temps-1.hs: New file.

Index: libcpp/ChangeLog
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* files.c (should_stack_file): Correct swapped parameters to call
	to cb.read_pch.
	* pch.c (cpp_valid_state): Handle -fpreprocessed.

From-SVN: r83478
2004-06-22 06:51:56 +00:00
Richard Henderson 093c715302 c-common.c (flag_objc_sjlj_exceptions): New.
* c-common.c (flag_objc_sjlj_exceptions): New.
	* c-common.h (flag_objc_sjlj_exceptions): Declare.
	* c-opts.c (c_common_handle_option): Set it.
	(c_common_post_options): Handle interation of different
	objective-c exception and runtime switches.
	* c-decl.c (c_eh_initialized_p): New.
	(finish_decl): Use it instead of local eh_initialized_p.
	* c-parse.in (nested_function, notype_nested_function): Record
	the result of compstmt.
	(compstmt_or_error): Likewise.
	(compstmt): Don't add_stmt the result.
	(stmt): Don't return anything.  Rewrite objc try and sync rules.
	(objc_try_stmt, objc_catch_list): Remove.
	(objc_catch_block, objc_finally_block): Remove.
	(objc_catch_prefix, objc_catch_clause, objc_opt_catch_list): New.
	(objc_try_catch_clause, objc_finally_clause): New.
	(objc_try_catch_stmt): Rewrite.
	* c-tree.h (c_eh_initialized_p): Declare.
	* c-opt (fobjc-sjlj-exceptions): New.
	* except.c (output_function_exception_table): Don't call cgraph
	on non-decls.
	* objc/objc-act.c (UTAG_EXCDATA_VAR, UTAG_CAUGHTEXC_VAR,
	UTAG_RETHROWEXC_VAR, UTAG_EVALONCE_VAR, struct val_stack,
	catch_count_stack, exc_binding_stack, if_nesting_count,
	blk_nesting_count, objc_enter_block, objc_exit_block,
	objc_declare_variable, val_stack_push, val_stack_pop,
	objc_build_try_enter_fragment, objc_build_extract_expr,
	objc_build_try_exit_fragment, objc_build_extract_fragment,
	objc_build_try_prologue, objc_build_try_epilogue,
	objc_build_catch_stmt, objc_build_catch_epilogue,
	objc_build_finally_prologue, objc_build_finally_epilogue,
	objc_build_try_catch_finally_stmt, objc_build_synchronized_prologue,
	objc_build_synchronized_epilogue): Remove.
	(objc_create_temporary_var, struct objc_try_context, cur_try_context,
	objc_eh_runtime_type, objc_init_exceptions, objc_build_exc_ptr,
	next_sjlj_build_try_exit, next_sjlj_build_enter_and_setjmp,
	next_sjlj_build_exc_extract, next_sjlj_build_catch_list,
	next_sjlj_build_try_catch_finally, objc_begin_try_stmt,
	objc_begin_catch_clause, objc_finish_catch_clause,
	objc_build_finally_clause, objc_finish_try_stmt,
	objc_build_synchronized): New.
	(objc_is_object_id, objc_is_class_id): New.
	(objc_comptypes): Use them.
	(build_next_objc_exception_stuff): Break NeXT sjlj out from
	build_objc_exception_stuff.
	(synth_module_prologue): Update to match.
	(objc_build_throw_stmt): Use cur_try_context to decide if
	we're in a @catch.
	* objc/objc-act.h: Update prototypes.
	(OCTI_EXCEPTION_BLK_STACK, objc_exception_block_stack): Remove.
testsuite/
        * objc.dg/sync-1.m: New.
        * objc.dg/try-catch-1.m: Don't force next runtime.
        * objc.dg/try-catch-3.m, objc.dg/try-catch-4.m: Likewise.
        * objc.dg/try-catch-2.m: Likewise.  Enable everywhere.  Remove
        shadowed catch clause.
        * objc.dg/try-catch-5.m: New.

From-SVN: r83332
2004-06-17 18:20:53 -07:00
Zdenek Dvorak 50431bc428 Makefile.in (FLAGS_H): New.
* Makefile.in (FLAGS_H): New.
	(flags.h): Replace by FLAGS_H.
	* c.opt: Document Var, VarExists, Init and Report attributes.
	* common.opt: Fill the values of the attributes.
	* diagnostic.c (flag_fatal_errors): Do not define.
	* except.c (flag_non_call_exceptions): Do not define.
	* flags.h: Include options.h.  Remove declarations conflicting with
	the automatically defined ones.
	* opts.c: Remove automatically defined variables.
	(handle_option): Perform default initialization.
	(common_handle_option): Do not handle options covered by the
	default initialization.
	* opts.h (struct cl_option): Add flag_var, has_set_value and set_value
	fields.
	(CL_REPORT): New.
	* opts.sh: Generate variable declarations, handle CL_REPORT.
	* toplev.c: Remove automatically defined variables.
	(f_options): Removed.
	(print_switch_values): Use cl_options instead of f_options.
	* toplev.h (version_flag): Declaration removed.

From-SVN: r83105
2004-06-14 14:18:01 +00:00
Ben Elliston b02398bd5b c.opt (Wmissing-include-dirs): New.
* c.opt (Wmissing-include-dirs): New.
	* c-opts.c (c_common_handle_option): Pass true for user_supplied_p
	to add_path () for -I, but false for OPT_idirafter, OPT_iquote and
	OPT_isystem. Handle case OPT_Wmissing_include_dirs.
	* c-incpath.h (add_path): Add fourth (bool) argument.
	* c-incpath.c (add_env_var_paths): Pass false to add_path ().
	(add_standard_paths): Likewise.
	(remove_duplicates) [REASON_NOENT]: Warn if -Wmissing-include-dirs
	is used and the directory was user-supplied via -I.
	(add_path): Set p->user_supplied_p.  Remove duplicated code by
	using add_cpp_dir_path ().
	* cpplib.h (struct cpp_options): Add warn_missing_include_dirs.
	(struct cpp_dir): Add user_supplied_p.
	* doc/invoke.texi (Warning Options): Document new option.

[testsuite]
	* gcc.dg/cpp/Wmissingdirs.c: New.

From-SVN: r82121
2004-05-22 12:39:35 +10:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Mike Stump 4bed378709 invoke.texi (Directory Options): Document -iquote.
* doc/invoke.texi (Directory Options): Document -iquote.
	* doc/cpp.texi: Likewise.
	* doc/cppopts.texi: Likewise.
	* c-opts.c (c_common_missing_argument): Add -iquote processing.
	(c_common_handle_option): Likewise.
	* c.opt (iquote): Add.
	* gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -iquote.
	* c-incpath.c (merge_include_chains): Update comment to use -iquote.

	* c-opts.c (case OPT_I): Deprecate -I- support.
	* doc/invoke.texi: Likewise.
	* doc/cpp.texi: Likewise.
	* doc/cppopts.texi: Likewise.

From-SVN: r81521
2004-05-05 12:20:33 +00:00
Kazu Hirata ca2b05bae5 c-incpath.c, [...]: Update copyright.
gcc/
	* c-incpath.c, c-incpath.h, c-pch.c, c.opt, cppexp.c,
	et-forest.h, genattr.c, ggc-none.c, hosthooks-def.h,
	hosthooks.h, params.h, ra-colorize.c, web.c,
	config/darwin-c.c, config/alpha/freebsd.h, config/arm/pe.c,
	config/avr/avr-protos.h, config/avr/avr.md,
	config/fr30/fr30-protos.h, config/fr30/fr30.md,
	config/h8300/fixunssfsi.c, config/i386/darwin.h,
	config/i386/freebsd.h, config/i386/freebsd64.h,
	config/ia64/hpux.h, config/ia64/unwind-ia64.c,
	config/ip2k/libgcc.S, config/m32r/xm-m32r.h,
	config/mmix/mmix-modes.def, config/ns32k/netbsd.h,
	config/ns32k/ns32k.md, config/pa/pa64-hpux.h,
	config/pa/pa64-regs.h, config/rs6000/aix41.h,
	config/rs6000/aix43.h, config/rs6000/host-darwin.c,
	config/sparc/aout.h, config/sparc/freebsd.h,
	config/sparc/litecoff.h, config/vax/vax-protos.h,
	doc/hostconfig.texi, doc/include/gcc-common.texi: Update
	copyright.

gcc/cp/
	* cp-lang.c, ptree.c: Update copyright.

From-SVN: r79506
2004-03-15 18:20:51 +00:00
Mike Stump 94d1613b23 Add framework support for darwin.
* c-incpath.c: Include target.h and machmode.h.
	(add_path): Use a consistent style for cpp_dir.  Initialize
	p->construct to 0.
	(add_cpp_dir_path): New.
	(register_include_chains): Add use of extra_includes callback.
	(hook_void_int): Add.
	(target_c_incpath): Add.
	* c-incpath.h (add_cpp_dir_path): New.
	(target_c_incpath_s): Add.
	(target_c_incpath): Add.
	(C_INCPATH_INIT): Add.
	* c-opts.c (c_common_missing_argument,
	c_common_handle_option): Add -F argument processing.
	* c.opt: Add -F argument processing.
	* gcc.c (trad_capable_cpp): Add -F argument processing.
	* cppfiles.c (find_file_in_dir): Update to use construct
	callback.
	(search_path_exhausted, cpp_get_path, cpp_get_buffer,
	cpp_get_prev): New.
	(_cpp_find_file): Use search_path_exhausted.
	(make_cpp_dir): Initialize construct to 0.
	* cpplib.h (missing_header_cb
	cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New.
	(cpp_callbacks): Add missing_header
	(cpp_dir): Add construct.
	* target-def.h: (TARGET_OPTF): New.
	* hooks.c (hook_void_int, hook_void_charptr): Add.
	* hooks.h (hook_void_int, hook_void_charptr): Add.
	* Makefile.in (c-incpath.o) : Add $(TARGET_H) and
	$(MACHMODE_H) dependencies.
	* doc/invoke.texi (Darwin Options): Document -F.
	* doc/tm.texi (TARGET_EXTRA_INCLUDES): Add.
	(TARGET_OPTF): Add.
	* fix-header.c (target_c_incpath): Add.

	* config/darwin-c.c: Add c-incpath.h include.
	(using_frameworks, find_subframework_file,
	find_subframework_header, add_system_framework_path,
	frameworks_in_use, num_frameworks, max_frameworks,
	add_framework, find_framework, struct framework_header,
	framework_header_dirs, framework_construct_pathname,
	find_subframework_file, add_system_framework_path,
	add_framework_path, framework_defaults,
	darwin_register_frameworks, find_subframework_header): Add.
	* config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New.
	(TARGET_OPTION_TRANSLATE_TABLE): Add -framework support.
	(CPP_SPEC): Add __APPLE_CC__ support.
	* t-darwin (darwin-c.o): Add c-incpath.h dependency.

From-SVN: r78875
2004-03-04 00:18:54 +00:00
Richard Henderson e5b7921933 c-opts.c (warn_variadic_macros): New.
* c-opts.c (warn_variadic_macros): New.
        (c_common_handle_option): Set it.
        (sanitize_cpp_opts): Copy it to cpp_opts.
        * c.opt (Wvariadic-macros): New.
        * cpplib.h (struct cpp_options): Add warn_variadic_macros.
        * cppinit.c (cpp_create_reader): Initialize it.
        * cppmacro.c (parse_params): Check it.

From-SVN: r78125
2004-02-19 14:18:50 -08:00
Mark Mitchell 57782ad852 re PR c++/11326 (C++ IA64 ABI: 3.1.4: sometimes pointer to temporary return value is implicit first parameter preceding "this")
PR c++/11326
	* c-common.c (flag_abi_version): Remove.
	* c-common.h (flag_abi_version): Likewise.
	* c-opts.c (c_common_handle_option): Remove OPT_fabi_version case.
	* c.opt (fabi-version): Remove.
	* calls.c (expand_call): Always pass a function type to
	struct_value_rtx.  Use convert_memory_address.
	* common.opt (fabi-version): Add it.
	* flags.h (flag_abi_version): Likewise.
	(abi_version_at_least): New macro.
	* opts.c (common_handle_option): Add OPT_fabi_version.
	* toplev.c (flag_abi_version): Define it.
	* config/ia64/ia64.c (ia64_struct_retval_addr_is_first_parm_p):
	New function.
	(ia64_output_mi_thunk): Use it.
	(ia64_struct_value_rtx): Likewise.

	PR c++/11326
	* cp-tree.h (abi_version_at_least): Remove.
	* mangle.c: Include flags.h.

	PR c++/11326
	* g++.dg/abi/structret1.C: New test.

From-SVN: r77968
2004-02-17 18:32:45 +00:00
Eric Christopher 16dd5cfeb8 [multiple changes]
2004-02-02  Eric Christopher  <echristo@redhat.com>
            Zack Weinberg  <zack@codesourcery.com>

        * c-opts.c (c_common_handle_option): Add -finput-charset.
        * c.opt: Ditto.
        * cppcharset.c (one_iso88591_to_utf8): Remove.
        (convert_iso88591_utf8): Ditto.
        (conversion_tab): Remove 8859-1 converter.
        (_cpp_input_to_utf8): Remove.
        (_cpp_init_iconv_buffer): Ditto.
        (_cpp_close_iconv_buffer): Ditto.
        (_cpp_convert_input): New function.
        (_cpp_default_encoding): Ditto.
        * cpphash.h: Add/remove prototypes for above.
        * cppfiles.c (read_file_guts): Use _cpp_convert_input.
        * cppinit.c (cpp_create_reader): Use _cpp_default_encoding
        for narrow execution and input character sets.
        * cpplib.c (cpp_push_buffer): Delete uses of removed functions.
        * doc/cppopts.texi: Document -finput-charset.

2004-02-02 Eric Christopher  <echristo@redhat.com>
           Zack Weinberg  <zack@codesourcery.com>

        * gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset.

2004-01-29  Eric Christopher  <echristo@redhat.com>
            Zack Weinberg  <zack@codesourcery.com>

        * testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use
        -finput-charset.
        * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto.
        * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto
        * testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto.
        * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto.
        * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto.
        * testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto.
        * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto.
        * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
        Ditto.

From-SVN: r77136
2004-02-02 20:20:58 +00:00
Ziemowit Laski 264fa2db22 MERGE OF objc-improvements-branch into MAINLINE.
2003-09-24  Ziemowit Laski  <zlaski@apple.com>

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

From-SVN: r71748
2003-09-25 01:26:01 +00:00