aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
AgeCommit message (Collapse)Author
2012-06-29toplevel/Steven Bosscher
* configure.ac: Skip C if explicitly selected. * configure: Regenerate. gcc/ * configure.ac: Remove special gtfiles case for C. * configure: Regenerate. * Makefile.in: Remove C front-end hooks and build hooks that will be picked up from c/Make-lang.in now. Add tree-mudflap to C_COMMON_OBJS. * gengtype.c (files_rules): Adjust gt-files for c/c-decl.c. * config/vms/vms.c: Look for c-tree.h in c/. * doc/gty.texi: Remove reference to c-config-lang.in. * doc/sourcebuild.texi: Document the c/ subdirectory. c/ * Make-lang.in: New file, rules migrated from gcc/Makefile.in and add language Makefile hooks. * config-lang.in: New file. * c-config-lang.in: Moved from gcc/config-lang.in to here, and add the required "normal" config-lang.in rules. * c-lang.h: Moved from gcc/ to here. * c-tree.h: Likewise. * c-objc-common.c: Likewise. * c-objc-common.h: Likewise. * c-typeck.c: Likewise. * c-convert.c: Likewise. * c-lang.c: Likewise. * c-aux-info.c: Likewise. * c-errors.c: Likewise. * gccspec.c: Likewise. * c-decl.c: Likewise. Include gt-c-c-decl.h, not gt-c-decl.h. * c-parser.c: Likewise. Include gt-c-c-parser.h, not gt-c-parser.h. c-family/ * cppspec.c: Moved from gcc/ to here. objc/ * Make-ang.in: Adjust for move of C front-end files. * config-lang.in: Likewise. * objc-encoding.c: Look for cp-tree.h in cp/, and for c-tree.h and c-lang.h in c/. * objc-runtime-shared-support.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-act.c: Likewise. * objc-lang.c: Likewise. cp/ * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@189080 138bc75d-0d04-0410-961f-82ee72b054a4
2012-06-152012-06-15 Marc Glisse <marc.glisse@inria.fr>Ramana Radhakrishnan
PR c++/51033 * c-typeck.c (c_build_vec_perm_expr): Move to c-family/c-common.c. * c-tree.h (c_build_vec_perm_expr): Move to c-family/c-common.h. cp/ 2012-06-15 Marc Glisse <marc.glisse@inria.fr> PR c++/51033 * semantics.c (literal_type_p): Handle VECTOR_TYPE. (potential_constant_expression_1): Handle VEC_PERM_EXPR. * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE. c-family 2012-06-15 Marc Glisse <marc.glisse@inria.fr> PR c++/51033 * c-common.h (c_build_vec_perm_expr): Move decl here. * c-common.c (c_build_vec_perm_expr): Move definition here. 2012-06-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> PR c++/51033 * c-c++-common/torture/vshuf-16.inc: Move from gcc.c-torture/execute/. * c-c++-common/torture/vshuf-2.inc: Likewise. * c-c++-common/torture/vshuf-4.inc: Likewise. * c-c++-common/torture/vshuf-8.inc: Likewise. * c-c++-common/torture/vshuf-main.inc: Likewise. * c-c++-common/torture/vshuf-v16hi.c: Likewise. * c-c++-common/torture/vshuf-v16qi.c: Likewise. * c-c++-common/torture/vshuf-v2df.c: Likewise. * c-c++-common/torture/vshuf-v2di.c: Likewise. * c-c++-common/torture/vshuf-v2sf.c: Likewise. * c-c++-common/torture/vshuf-v2si.c: Likewise. * c-c++-common/torture/vshuf-v4df.c: Likewise. * c-c++-common/torture/vshuf-v4di.c: Likewise. * c-c++-common/torture/vshuf-v4hi.c: Likewise. * c-c++-common/torture/vshuf-v4sf.c: Likewise. * c-c++-common/torture/vshuf-v4si.c: Likewise. * c-c++-common/torture/vshuf-v8hi.c: Likewise. * c-c++-common/torture/vshuf-v8qi.c: Likewise. * c-c++-common/torture/vshuf-v8si.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@188671 138bc75d-0d04-0410-961f-82ee72b054a4
2012-05-29 * expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocateMichael Matz
a kept temp. (expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Make unreachable. * gimple-fold.c (canonicalize_constructor_val): Canonicalize COMPOUND_LITERAL_EXPR. * function.c (expand_function_start): Don't call expand_decl, instead assert that we have RTL assigned. * tree-ssa-live.c (remove_unused_locals): Clear nonlocal_goto_save_area if its backing variable is removed. * stmt.c (expand_asm_operands): Remove handling of non-lvalues as mem inputs. (expand_decl): Assert that this does nothing. * calls.c (expand_call): Don't call mark_temp_addr_taken. * c-tree.h (c_expand_decl): Remove prototype. c-family/ * c-common.h (c_expand_decl): Remove prototype. ada/ * gcc-interface/utils.c (create_var_decl_1): Don't call expand_decl. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187962 138bc75d-0d04-0410-961f-82ee72b054a4
2012-05-16PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokensDodji Seketeli
Now that we track token locations accross macro expansions, it would be cool to be able to fix PR preprocessor/7263 for real. That is, consider this example where we have a system header named header.h like this: #define _Complex __complex__ #define _Complex_I 1.0iF and then a normal C file like this: #include "header.h" static _Complex float c = _Complex_I; If we compile the file with -pedantic, the usages of _Complex or _Complex_I should not trigger any warning, even though __complex__ and the complex literal are extensions to the standard C. They shouldn't trigger any warning because _Complex and _Complex_I are defined in a system header (and expanded in normal user code). To be able to handle this, we must address two separate concerns. First, warnings about non-standard usage of numerical literals are emitted directly from within libcpp. So we must teach libcpp's parser for numerical literals to use virtual locations, instead of the spelling location it uses today. Once we have that, as the diagnostics machinery already knows how to avoid emitting errors happening on tokens that come from system headers, we win. Second, there is the issue of tracking locations for declaration specifiers, like the "_Complex" in the declaration: static _Complex float c; For that, we need to arrange for each possible declaration specifier to have its own location, because otherwise, we'd warn on e.g, on: _Complex float c; but not on: static _Complex float c; So this patch addresses the two concerns above. It's actually a follow-up on an earlier patch[1] I wrote as part of my initial work on virtual locations. We then agreed[2] that the second concern was important to address before the patch could get a chance to go in. [1]: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00957.html [2]: http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00264.html Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/7263 * include/cpplib.h (cpp_classify_number): Take a location parameter. * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic macros that take a location parameter. (cpp_classify_number): Take a (virtual) location parameter. Use it for diagnostics. Adjust comments. (eval_token): Take a location parameter. Pass it to cpp_classify_number and to diagnostic routines. (_cpp_parse_expr): Use virtual locations of tokens when parsing expressions. Pass a virtual location to eval_token and to diagnostic routines. gcc/c-family/ PR preprocessor/7263 * c-lex.c (c_lex_with_flags): Pass a virtual location to the call to cpp_classify_number. For diagnostics, use the precise location instead of the global input_location. gcc/ PR preprocessor/7263 * c-tree.h (enum c_declspec_word): Declare new enum. (struct c_declspecs::locations): New member. (declspecs_add_qual, declspecs_add_scspec) (declspecs_add_addrspace, declspecs_add_alignas): Take a new location parameter. * c-decl.c (build_null_declspecs): Initialize the new struct c_declspecs::locations member. (declspecs_add_addrspace): Take a location parameter for the address space. Store it onto declaration specifiers. (declspecs_add_qual): Likewise, take a location parameter for the qualifier. (declspecs_add_type): Likewise, take a location parameter for the type specifier. (declspecs_add_scspec): Likewise, take a location parameter for the storage class specifier. (declspecs_add_attrs): Likewise, take a location parameter for the first attribute. (declspecs_add_alignas): Likewise, take a location parameter for the alignas token. (finish_declspecs): For diagnostics, use the location of the relevant declspec, instead of the global input_location. * c-parser.c (c_parser_parameter_declaration): Pass the precise virtual location of the declspec to the declspecs-setters. (c_parser_declspecs): Likewise. Avoid calling c_parser_peek_token repeatedly. gcc/cp/ PR preprocessor/7263 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all the possible declarator specifiers so far. (struct cp_decl_specifier_seq::locations): Declare new member. (cp_decl_specifier_seq::{specs, type_location}): Remove. (decl_spec_seq_has_spec_p): Declare new function. * parser.c (cp_parser_check_decl_spec): Remove. (set_and_check_decl_spec_loc): Define new static function. (decl_spec_seq_has_spec_p): Define new public function. (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt) (cp_parser_type_specifier, cp_parser_simple_type_specifier) (cp_parser_set_storage_class, cp_parser_set_decl_spec_type) (cp_parser_alias_declaration): Set the locations for each declspec, using set_and_check_decl_spec_loc. (cp_parser_explicit_instantiation, cp_parser_init_declarator) (cp_parser_member_declaration, cp_parser_init_declarator): Use the new declspec location for specifiers. Use the new decl_spec_seq_has_spec_p. (cp_parser_type_specifier_seq): Use the new set_and_check_decl_spec_loc. Stop using cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p. (, cp_parser_init_declarator): Use the new set_and_check_decl_spec_loc. (cp_parser_single_declaration, cp_parser_friend_p) (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration): Use the new decl_spec_seq_has_spec_p. * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use the more precise ds_redefined_builtin_type_spec location for diagnostics about re-declaring C++ built-in types. (start_decl, grokvardecl, grokdeclarator): Use the new decl_spec_seq_has_spec_p. gcc/testsuite/ PR preprocessor/7263 * gcc.dg/binary-constants-2.c: Run without tracking locations accross macro expansion. * gcc.dg/binary-constants-3.c: Likewise. * gcc.dg/cpp/sysmac2.c: Likewise. * testsuite/gcc.dg/nofixed-point-2.c: Adjust for more precise location. * gcc.dg/cpp/syshdr3.c: New test. * gcc.dg/cpp/syshdr3.h: New header for the new test above. * gcc.dg/system-binary-constants-1.c: New test. * gcc.dg/system-binary-constants-1.h: New header for the new test above. * g++.dg/cpp/syshdr3.C: New test. * g++.dg/cpp/syshdr3.h: New header the new test above. * g++.dg/system-binary-constants-1.C: New test. * g++.dg/system-binary-constants-1.h: New header the new test above. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187587 138bc75d-0d04-0410-961f-82ee72b054a4
2012-05-032012-05-03 Manuel López-Ibáñez <manu@gcc.gnu.org>Manuel López-Ibáñez
gcc/ * flags.h (flag_permissive): Do not declare. * diagnostic.c (diagnostic_report_diagnostic): Handle fpermissive option specially. * toplev.c (flag_permissive): Do not define. * c-tree.h (system_header_p): Delete unused. c-family/ * c.opt (fpermissive): Add Var(flag_permissive). git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187123 138bc75d-0d04-0410-961f-82ee72b054a4
2012-03-092012-03-09 Tristan Gingold <gingold@adacore.com>Tristan Gingold
* c-tree.h (c_default_pointer_mode): New variable. * c-decl.c (c_default_pointer_mode): New variable. (c_build_pointer_type): New function. (grokdeclarator): Call c_build_pointer_type instead of build_pointer_type. * config/vms/vms-c.c: Include c-tree.h (saved_pointer_mode): New variable. (handle_pragma_pointer_size): New function. (vms_pragma_pointer_size, vms_pragma_required_pointer_size): Likewise. (vms_c_register_pragma): Register __pointer_size and __required_pointer_size pragmas. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@185136 138bc75d-0d04-0410-961f-82ee72b054a4
2011-11-08Merge from transactional-memory branch.Aldy Hernandez
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@181154 138bc75d-0d04-0410-961f-82ee72b054a4
2011-11-06 * c-decl.c (shadow_tag_warned, grokdeclarator): Handle _AlignasJoseph Myers
specifiers. (build_null_declspecs): Initialize align_log and alignas_p fields. (declspecs_add_alignas): New. * c-parser.c (c_token_starts_declspecs): Handle RID_ALIGNAS. (c_parser_declspecs): Handle _Alignas specifiers. (c_parser_alignas_specifier): New. (c_parser_alignof_expression): Diagnose alignof use for non-C1X. Diagnose _Alignof (expression). * c-tree.h (struct c_declspecs): Add align_log and alignas_p fields. (declspecs_add_alignas): Declare. * ginclude/stddef.h (max_align_t): Define for C1X and C++11. * ginclude/stdalign.h: New. * Makefile.in (USER_H): Add stdalign.h. c-family: * c-common.c (c_common_reswords): Add _Alignas and _Alignof. (c_sizeof_or_alignof_type): Diagnose alignof applied to a function type. (check_user_alignment): New. Split out of handle_aligned_attribute. Disallow integer constants with noninteger types. Conditionally allow zero. (handle_aligned_attribute): Use check_user_alignment. * c-common.h (RID_ALIGNAS, check_user_alignment): New. testsuite: * g++.dg/cpp0x/alignof3.C, gcc.dg/c1x-align-1.c, gcc.dg/c1x-align-2.c, gcc.dg/c1x-align-3.c, gcc.dg/c1x-align-4.c, gcc.dg/c90-align-1.c, gcc.dg/c99-align-1.c: New tests. * gcc.dg/gnu89-const-expr-1.c, gcc.dg/gnu90-const-expr-1.c, gcc.dg/gnu99-const-expr-1.c, gcc.dg/gnu99-static-1.c: Update expected diagnostics. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@181048 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-07Rename vshuffle/vec_shuffle to vec_perm.Richard Henderson
* doc/extend.texi (__builtin_shuffle): Improve the description to include the modulus of the selector. Mention OpenCL. * doc/md.texi (vec_perm, vec_perm_const): Document named patterns. * tree.def (VEC_PERM_EXPR): Rename from VEC_SHUFFLE_EXPR. * genopinit.c (optabs): Rename vshuffle to vec_perm. * c-typeck.c (c_build_vec_perm_expr): Rename from c_build_vec_shuffle_expr. Update for name changes. * optabs.c (expand_vec_perm_expr_p): Rename from expand_vec_shuffle_expr_p. (expand_vec_perm_expr): Rename from expand_vec_shuffle_expr. * optabs.h (OTI_vec_perm): Rename from DOI_vshuffle. (vec_perm_optab): Rename from vshuffle_optab. * expr.c, gimple-pretty-print.c, gimple.c, gimplify.c, c-tree.h, c-parser.c, tree-cfg.c, tree-inline.c, tree-pretty-print.c, tree-ssa-operands.c, tree-vect-generic.c: Update for name changes. * config/i386/i386.c (ix86_expand_vec_perm): Rename from ix86_expand_vshuffle. * config/i386/i386-protos.h: Update. * config/i386/sse.md (VEC_PERM_AVX2): Rename from VSHUFFLE_AVX2. (vec_perm<VEC_PERM_AVX2>): Rename from vshuffle<VSHUFFLE_AVX2>. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179701 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-06Fix bconstp-3.c failure in PR50607.Artjoms Sinkarovs
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179588 138bc75d-0d04-0410-961f-82ee72b054a4
2011-10-03Vector shuffling patch from Artem Shinkarov.Artem Shinkarov
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179462 138bc75d-0d04-0410-961f-82ee72b054a4
2011-08-18 * c-decl.c (shadow_tag_warned): Check for _Noreturn.Joseph Myers
(quals_from_declspecs): Assert _Noreturn not present. (grokdeclarator): Handle _Noreturn. (build_null_declspecs): Initialize noreturn_p. (declspecs_add_scspec): Handle RID_NORETURN. * c-parser.c (c_token_starts_declspecs, c_parser_declspecs) (c_parser_attributes): Handle RID_NORETURN. * c-tree.h (struct c_declspecs): Add noreturn_p. * ginclude/stdnoreturn.h: New. * Makefile.in (USER_H): Add stdnoreturn.h. c-family: * c-common.c (c_common_reswords): Add _Noreturn. (keyword_is_function_specifier): Handle RID_NORETURN. * c-common.h (RID_NORETURN): New. testsuite: * gcc.dg/c1x-noreturn-1.c, gcc.dg/c1x-noreturn-2.c, gcc.dg/c1x-noreturn-3.c, gcc.dg/c1x-noreturn-4.c, gcc.dg/c1x-noreturn-5.c: New tests. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@177881 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-10 * c-decl.c (c_override_global_bindings_to_false): Remove.Joseph Myers
(global_bindings_p): Don't check c_override_global_bindings_to_false. * c-tree.h (c_override_global_bindings_to_false): Remove. * c-typeck.c (composite_type): Don't set c_override_global_bindings_to_false. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@173632 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-072011-05-07  Eric Botcazou  <ebotcazou@adacore.com>Eric Botcazou
* langhooks.h (lang_hooks_for_types): Change global_bindings_p's return type to bool and adjust comment. * fold-const.c (fold_range_test): Adjust call to global_bindings_p. (fold_mathfn_compare): Remove calls to global_bindings_p. (fold_inf_compare): Likewise. * stor-layout.c (variable_size): Adjust call to global_bindings_p. * c-tree.h (global_bindings_p): Adjust prototype. * c-decl.c (global_bindings_p): Return bool and simplify. ada/ * gcc-interface/gigi.h (global_bindings_p): Adjust prototype. * gcc-interface/utils.c (global_bindings_p): Return bool and simplify. cp/ * name-lookup.h (global_bindings_p): Adjust prototype. * name-lookup.c (global_bindings_p): Return bool. fortran/ * f95-lang.c (global_bindings_p): Return bool and simplify. go/ * go-lang.c (global_bindings_p): Return bool and simplify. java/ * java-tree.h (global_bindings_p): Adjust prototype. * decl.c (global_bindings_p): Return bool. lto/ * lto-lang.c (global_bindings_p): Return bool. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@173535 138bc75d-0d04-0410-961f-82ee72b054a4
2011-05-05 * c-decl.c (finish_decl): Don't call get_pending_sizes.Joseph Myers
(grokparm): Add parameter expr. Pass it to grokdeclarator. (push_parm_decl): Add parameter expr. Pass it to grokdeclarator. (c_variable_size): Remove. (grokdeclarator): Use save_expr instead of c_variable_size. Don't call put_pending_sizes. (get_parm_info): Add parameter expr. Use it to set arg_info->pending_sizes. (store_parm_decls): Use arg_info->pending_sizes instead or calling get_pending_sizes. * c-parser.c (c_parser_parms_declarator): Update call to c_parser_parms_list_declarator. (c_parser_parms_list_declarator): Take parameter expr. Update call to push_parm_decl. Update recursive call. Don't call get_pending_sizes. Update calls to get_parm_info. (c_parser_objc_method_definition): Update calls to c_parser_objc_method_decl and objc_start_method_definition. (c_parser_objc_methodproto): Update call to c_parser_objc_method_decl. (c_parser_objc_method_decl): Add parameter expr. Update call to grokparm. (c_parser_objc_try_catch_finally_statement): Update call to grokparm. * c-tree.h (struct c_arg_info.pending_sizes): Change to a tree. (get_parm_info, grokparm, push_parm_decl): Update prototypes. c-family: * c-objc.h (objc_start_method_definition): Update prototype. * stub-objc.c (objc_start_method_definition): Add extra parameter. cp: * parser.c (cp_parser_objc_method_definition_list): Update call to objc_start_method_definition. objc: * objc-act.c (objc_start_method_definition): Add parameter expr. Update call to start_method_def. (objc_generate_cxx_ctor_or_dtor, objc_synthesize_getter, objc_synthesize_setter) Update calls to objc_start_method_definition. (objc_get_parm_info): Add parameter expr. Update call to get_parm_info. (start_method_def): Add parameter expr. Update call to objc_get_parm_info. * objc-gnu-runtime-abi-01.c (build_module_initializer_routine): Update call to objc_get_parm_info. * objc-runtime-shared-support.h (objc_get_parm_info): Add extra parameter. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@173422 138bc75d-0d04-0410-961f-82ee72b054a4
2010-12-22gcc/Nathan Froyd
* c-aux-info.c (gen_formal_list_for_type): Use prototype_p. * c-decl.c (diagnose_arglist_conflict): Likewise. (diagnose_mismatched_decls, merge_decls): Likewise. (c_builtin_function, c_builtin_function_ext_scope): Likewise. (start_decl, start_function): Likewise. * c-tree.h (C_DECL_ISNT_PROTOTYPED): Likewise. * config/ia64/ia64.h (INIT_CUMULATIVE_ARGS): Likewise. * config/mep/mep.c (mep_validate_interrupt): Likewise. * config/pa/pa.h (INIT_CUMULATIVE_ARGS): Likewise. * config/rs6000/rs6000.c (init_cumulative_args): Likewise. * config/sh/sh.c (sh_init_cumulative_args): Likewise. * config/sparc/sparc.c (init_cumulative_args): Likewise. * dwarf2out.c (add_prototyped_attribute): Likewise. (gen_subprogram_die): Likewise. * ipa-type-escape.c (check_function_parameter_and_return_types): Likewise. (check_call): Likewise. * tree-ssa.c (useless_type_conversion_p): Likewise. gcc/ada/ * gcc-interface/utils.c (handle_nonnull_attribute): Use prototype_p. (handle_sentinel_attribute): Likewise. gcc/c-family/ * c-common.c (handle_nonnull_attribute, handle_sentinel_attribute): Use prototype_p. gcc/cp/ * decl.c (decls_match, duplicate_decls): Use prototype_p. * pt.c (push_template_decl_real): Likewise. gcc/lto/ * lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute): Use prototype_p. gcc/objc/ * objc-act.c (next_sjlj_build_enter_and_setjmp): Use prototype_p. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@168181 138bc75d-0d04-0410-961f-82ee72b054a4
2010-12-032010-11-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>Laurynas Biveinis
* tree.h (struct call_expr_arg_iterator_d): Remove GTY tag. (const_call_expr_arg_iterator_d): Likewise. (expanded_location): Likewise. * c-tree.h (struct c_arg_tag_d): Likewise. * dwarf2out.c (struct cfa_loc): Likewise. (struct skeleton_chain_struct): Likewise. * except.c (struct ttypes_filter): Likewise. * cselib.h (struct cselib_val_struct): Likewise. (elt_loc_list): Likewise. (elt_list): Likewise. * varasm.c (struct addr_const): Likewise. * tree-flow.h (struct edge_prediction): Likewise. (struct int_tree_map): Likewise. (struct _edge_var_map): Likewise. ada: 2010-11-30 Laurynas Biveinis <laurynas.biveinis@gmail.com> * gcc-interface/decl.c (struct subst_pair_d): Remove GTY tag. (variant_desc_d): Likewise. cp: 2010-11-30 Laurynas Biveinis <laurynas.biveinis@gmail.com> * cp-tree.h (struct aggr_init_expr_arg_iterator_d): Remove GTY tag. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@167406 138bc75d-0d04-0410-961f-82ee72b054a4
2010-11-19 PR c/46547Joseph Myers
* c-tree.h (in_late_binary_op): Move to c-family/c-common.h. * c-typeck.c (in_late_binary_op): Move to c-family/c-common.c. c-family: * c-common.c (in_late_binary_op): Define. (c_common_truthvalue_conversion): Check in_late_binary_op before calling c_save_expr. * c-common.h (in_late_binary_op): Declare. testsuite: * gcc.c-torture/compile/pr46547-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@166951 138bc75d-0d04-0410-961f-82ee72b054a4
2010-11-132010-11-13 Paolo Bonzini <bonzini@gnu.org>Paolo Bonzini
* c-tree.h (enum c_typespec_kind): Add ctsk_none. (struct c_declspecs): Replace tagdef_seen_p and type_seen_p with typespec_kind. * c-decl.c (build_null_declspecs): Initialize typespec_kind. (shadow_tag_warned, check_compound_literal_type): Adjust uses of tag_defined_p. (declspecs_add_type): Set typespec_kind. * c-parser.c (c_parser_declaration_or_fndef, c_parser_declspecs, c_parser_struct_declaration, c_parser_parameter_declaration, c_parser_type_name, c_parser_objc_diagnose_bad_element_prefix): Adjust uses of type_seen_p. * c-typeck.c (c_cast_expr): Use typespec_kind instead of tag_defined_p, pass ctsk_firstref through. testsuite: 2010-11-13 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/Wcxx-compat-8.c: Add testcases involving incomplete types. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@166699 138bc75d-0d04-0410-961f-82ee72b054a4
2010-10-06In gcc/:Nicola Pero
2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com> Implemented fast enumeration for Objective-C. * c-parser.c (objc_could_be_foreach_context): New. (c_lex_one_token): Recognize RID_IN keyword in a potential Objective-C foreach context. (c_parser_declaration_or_fndef): Added parameter. Accept Objective-C RID_IN keyword as terminating a declaration; in that case, return the declaration in the new parameter. (c_parser_extenral_declaration): Updated calls to c_parser_declaration_or_fndef. (c_parser_declaration_or_fndef): Same change. (c_parser_compound_statement_nostart): Same change. (c_parser_label): Same change. (c_parser_objc_methodprotolist): Same change. (c_parser_omp_for_loop): Same change. (c_parser_for_statement): Detect and parse Objective-C foreach statements. (c_parser_omp_for_loop): Updated call to check_for_loop_decls(). * c-decl.c (check_for_loop_decls): Added parameter to allow ObjC fast enumeration parsing code to turn off the c99 error but still perform checks on the loop declarations. * c-tree.h (check_for_loop_decls): Updated declaration. * doc/objc.texi: Document fast enumeration. In gcc/c-family/: 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com> Implemented fast enumeration for Objective-C. * c-common.h (objc_finish_foreach_loop): New. * stub-objc.c (objc_finish_foreach_loop): New. In gcc/objc/: 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com> Implemented fast enumeration for Objective-C. * objc-act.c (build_fast_enumeration_state_template): New. (TAG_ENUMERATION_MUTATION): New. (TAG_FAST_ENUMERATION_STATE): New. (synth_module_prologue): Call build_fast_enumeration_state_template() and set up objc_enumeration_mutation_decl. (objc_create_temporary_var): Allow providing a name to temporary variables. (objc_build_exc_ptr): Updated calls to objc_create_temporary_var(). (next_sjlj_build_try_catch_finally): Same change. (objc_finish_foreach_loop): New. * objc-act.h: Added OCTI_FAST_ENUM_STATE_TEMP, OCTI_ENUM_MUTATION_DECL, objc_fast_enumeration_state_template, objc_enumeration_mutation_decl. Merge from 'apple/trunk' branch on FSF servers. 2006-04-12 Fariborz Jahanian <fjahanian@apple.com> Radar 4507230 * objc-act.c (objc_type_valid_for_messaging): New routine to check for valid objc object types. (objc_finish_foreach_loop): Check for invalid objc objects in foreach header. In gcc/testsuite/: 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com> Implemented fast enumeration for Objective-C. * objc.dg/foreach-1.m: New. * objc.dg/foreach-2.m: New. * objc.dg/foreach-3.m: New. * objc.dg/foreach-4.m: New. * objc.dg/foreach-5.m: New. * objc.dg/foreach-6.m: New. * objc.dg/foreach-7.m: New. Merge from 'apple/trunk' branch on FSF servers: 2006-04-13 Fariborz Jahanian <fjahanian@apple.com> Radar 4502236 * objc.dg/objc-foreach-5.m: New. 2006-04-12 Fariborz Jahanian <fjahanian@apple.com> Radar 4507230 * objc.dg/objc-foreach-4.m: New. 2006-03-13 Fariborz Jahanian <fjahanian@apple.com> Radar 4472881 * objc.dg/objc-foreach-3.m: New. 2005-03-07 Fariborz Jahanian <fjahanian@apple.com> Radar 4468498 * objc.dg/objc-foreach-2.m: New. 2006-02-15 Fariborz Jahanian <fjahanian@apple.com> Radar 4294910 * objc.dg/objc-foreach-1.m: New In libobjc/: 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com> Implemented fast enumeration for Objective-C. * Makefile.in (C_SOURCE_FILES): Added objc-foreach.c. (OBJC_H): Added runtime.h * objc-foreach.c: New file. * objc/runtime.h: New file. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@165019 138bc75d-0d04-0410-961f-82ee72b054a4
2010-09-08 * c-tree.h, c-decl.c (build_enumerator): Add location parameter.Arnaud Charlet
* c-parser.c (c_parser_enum_specifier): Adjust call to build_enumerator. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@163988 138bc75d-0d04-0410-961f-82ee72b054a4
2010-08-08 * c-tree.h (build_arg_info): Declare.Nathan Froyd
* c-decl.c (build_arg_info): Define. (get_parm_info): Call it. Delete initialization code. * c-parser.c (c_parser_parms_declarator): Likewise. (c_parser_parms_list_declaractor): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@163014 138bc75d-0d04-0410-961f-82ee72b054a4
2010-08-08 * c-tree.h (c_arg_tag): Define. Define a VEC containing it.Nathan Froyd
(struct c_arg_info): Change type of tags field. * c-decl.c (grokdeclarator): Update for changed type of tags field. (get_parm_info): Likewise. (store_parm_decls_newstyle): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@163013 138bc75d-0d04-0410-961f-82ee72b054a4
2010-07-082010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>Manuel López-Ibáñez
* toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4
2010-06-05gcc/ChangeLog:Steven Bosscher
* c-common.c: Move to c-family/. * c-common.def: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-format.h : Likewise. * c-gimplify.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c.opt: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pragma.h: Likewise. * c-pretty-print.c: Likewise. * c-pretty-print.h: Likewise. * c-semantics.c: Likewise. * stub-objc.c: Likewise. * gengtype.c (get_file_langdir): Special-case files in c-family/. (get_output_file_with_visibility): Fix name for c-common.h. * c-config-lang.in: Update paths in gtfiles for files in c-family/. * c-tree.h: Update include path for moved files. * c-lang.c: Likewise. * c-lang.h: Likewise. * c-parser.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-objc-common.c: Likewise. * configure.ac: Make sure c-family/ exists in the build directory. * configure: Regenerate. * Makefile.in: Update paths for moved files. Regroup files per location and update dependencies. Move generated_files down after ALL_GTFILES_H. * config/spu/spu-c.c: Update paths for moved files. * config/mep/mep-pragma.c: Likewise. * config/darwin-c.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/i386-c.c: Likewise. * config/avr/avr-c.c: Likewise. * config/sol2-c.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm-c.c: Likewise. * config/h8300/h8300.c: Likewise. * config/v850/v850-c.c: Likewise. * config/t-darwin: Fix dependencies for moved files. * config/t-sol2: Fix dependencies for moved files. * config/mep/t-mep: Fix dependencies for moved files. * config/ia64/t-ia64: Fix dependencies for moved files. * config/rs6000/t-rs6000: Fix dependencies for moved files. * config/v850/t-v850: Fix dependencies for moved files. * config/v850/t-v850e: Fix dependencies for moved files. * config/m32c/m32c-pragma.c * po/exgettext: Look in c-family/ also. c-family/ChangeLog: * c-common.c: Include gt-c-family-c-common.h. * c-pragma.c: Include gt-c-family-c-pragma.h. objc/ChangeLog: * objc-act.c: Update include path for moved files. * objc-lang.c: Likewise. * config-lang.in: Update paths in gtfiles for files in c-family/. objcp/ChangeLog: * objcp-lang.c: Update include path for moved files. * config-lang.in: Update paths in gtfiles for files in c-family/. cp/ChangeLog: * typeck.c: Update include path for moved files. * decl.c: Likewise. * rtti.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * pt.c: Likewise. * semantics.c: Likewise. * cxx-pretty-print.h: Likewise. * decl2.c: Likewise. * parser.c: Likewise. * cp-objcp-common.c: Likewise. * cp-tree.h: Likewise. * name-lookup.c: Likewise. * lex.c: Likewise. * name-lookup.h: Likewise. * config-lang.in: Update paths in gtfiles for files in c-family/. * Make-lang.in: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@160330 138bc75d-0d04-0410-961f-82ee72b054a4
2010-06-05 PR c/44322Joseph Myers
* c-typeck.c (build_unary_op): Merge qualifiers into pointer target type for ADDR_EXPR; require no changes to qualifiers except for function types. * c-tree.h (c_build_type_variant): Remove. testsuite: * gcc.dg/c99-restrict-4.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@160312 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-28gcc/ChangeLog:Steven Bosscher
* c-common.h (GCC_DIAG_STYLE): Define earlier in the file, before including diagnostic-core.h. (c_cpp_error): New prototype moved from c-tree.h. Use ATTRIBUTE_GCC_DIAG instead of ATTRIBUTE_GCC_CDIAG. * c-tree.h (ATTRIBUTE_GCC_CDIAG): Remove define. (pedwarn_c90, perwarn_c99): Use ATTRIBUTE_GCC_DIAG instead. (c_cpp_error): Prototype moved to c-common.h. * Makefile.in: Update dependency for C_COMMON_H. cp/ChangeLog: * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that this file is included before c-common.h. Define GCC_DIAG_STYLE before including diagnostic-core.h and toplev.h. (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG. * pt.c: Include cp-tree.h before c-common.h. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@160007 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-26libiberty/Kai Tietz
2010-05-26 Kai Tietz <kai.tietz@onevision.com> * testsuite/demangle-expected: Add tests for __int128 and unsigned __int128 types. gcc/testsuite 2010-05-26 Kai Tietz <kai.tietz@onevision.com> * lib/target-supports.exp (check_effective_target_int128): New function to check if __int128 types are available for target. * testsuite/c-c++-common/int128-types-1.c: New. * testsuite/c-c++-common/int128-1.c: New. * testsuite/c-c++-common/int128-2.c: New. * g++.dg/abi/mangle43.C: New. * g++.dg/init/enum1.C: Handle __int128 case and add -Wno-overflow. * g++.dg/cpp0x/nullptr04.C: Use __SIZE_TYPE__ for getting pointer-wide scalar. * g++.dg/other/pr25632.C: Likewise. * g++.dg/other/large-size-array.C (DIM): Use ULLONG_MAX for win64 case. * g++.dg/warn/pr13358-2.C: Add llp64 for check of special overflow warnings. * g++.dg/warn/pr13358-4.C: Likewise. * g++.dg/warn/Wconversion-null-2.C: Add 'long long' case. * g++.dg/warn/Wconversion-null.C: Likewise. gcc/ 2010-05-26 Kai Tietz <kai.tietz@onevision.com> * builtin-types.def (BT_INT128): New primitive type. (BT_UINT128): Likewise. * c-common.c (c_common_r): Add __int128 keyword. (c_common_type_for_size): Handle __int128. (c_common_type_for_mode): Likewise. (c_common_signed_or_unsigned_type): Likewise. (c_common_nodes_and_builtins): Add builtin type if target supports 128-bit integer scalar. * c-common.h (enum rid): Add RID_INT128. * c-cppbuiltin.c (c_cpp_builtins): Define __SIZEOF_INT128__ if target supports 128-bit integer scalar. * c-decl.c (declspecs_add_type): Handle new keyword __int128. (finish_declspecs): Likewise. * c-parser.c (c_token_starts_typename): Handle RID_INT128. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_attributes): Likewise. (c_parser_objc_selector): Likewise. * c-pretty-print.c (pp_c_integer_constant): Handle __int128. * c-tree.h (enum c_typespec_keyword): Add cts_int128. * gimple.c (gimple_signed_or_unsigned_type): Handle int128 types. * tree.c (make_or_reuse_type): Likewise. (make_unsigned_type): Likewise. (build_common_tree_nodes_2): Likewise. * tree.h (enum integer_type_kind): Add itk_int128 and itk_unsigned_int128. (int128_integer_type_node): New define.. (int128_unsigned_type_node): New define. * cp/cp-tree.h (cp_decl_specifier_seq): Add new bifield explicit_int128_p. * cp/decl.c (grokdeclarator): Handle __int128. * cp/parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise. (cp_parser_simple_type_specifier): Likewise. * cp/rtti.c (emit_support_tinfos): Add int128 nodes for rtti. * cp/typeck.c (cp_common_type): Handle __int128. * cp/mangle.c (integer_type_codes): Add itk_int128 and itk_unsigned_int128. * doc/extend.texi: Add documentation about __int128 type. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@159879 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-23 * c-decl.c (diagnose_mismatched_decls): Give error for duplicateJoseph Myers
typedefs with different but compatible types. Allow duplicate typedefs with the same type except for pedantic non-C1X, but give warning for variably modified types. * c-typeck.c (tagged_types_tu_compatible_p, function_types_compatible_p, type_lists_compatible_p, comptypes_internal): Add parameter different_types_p; set *different_types_p for different but compatible types. All callers changed. (comptypes_check_different_types): New. * c-tree.h (comptypes_check_different_types): Declare. testsuite: * gcc.dg/c1x-typedef-1.c, gcc.dg/c1x-typedef-2.c, gcc.dg/c90-typedef-1.c, gcc.dg/c99-typedef-1.c: New tests. * gcc.dg/decl-8.c: Use -std=gnu89 -pedantic-errors. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@159767 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-05 * stor-layout.c (pending_sizes): Change the type toSteven Bosscher
VEC(tree,gc) *. (get_pending_sizes, put_pending_size, put_pending_sizes): Update the uses of pending_sizes. * c-decl.c (store_parm_decls): Likewise. * c-tree.h (struct c_arg_info): Likewise. * tree.h: Update the prototype for get_pending_sizes and put_pending_sizes. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@159085 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-26 * c-parser.c (struct c_token): Move location field up.Nathan Froyd
* c-tree.h (struct c_typespec): Move expr_const_operands field up. (struct c_declspecs): Convert typespec_word, storage_class, and default_int_p into bitfields. (struct c_declarator): Move loc field up. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@158744 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-222010-04-22 Laurynas Biveinis <laurynas.biveinis@gmail.com>Laurynas Biveinis
* c-tree.h (push_init_level, pop_init_level, set_init_index) (process_init_element): New argument of type struct obstack *. * c-typeck.c (push_init_level, pop_init_level, set_designator) (set_init_index, set_init_label, set_nonincremental_init) (set_nonincremental_init_from_string, find_init_member) (output_init_element, output_pending_init_elements) (process_init_element): New argument braced_init_obstack. Pass it down. (push_range_stack, add_pending_init): New argument braced_init_obstack. Use obstack allocation. * c-parser.c (c_parser_initelt, c_parser_initval): New argument braced_init_obstack. Pass it down. (c_parser_braced_init): New variables ret, braced_init_obstack. Initialize obstack, pass it down and finally free it. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@158634 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-07 PR c/18624Jakub Jelinek
* tree.h (DECL_READ_P): Define. (struct tree_decl_common): Add decl_read_flag. * c-decl.c (pop_scope): If TREE_USED but !DECL_READ_P, issue a set but not used warning. (merge_decls): Merge DECL_READ_P flag. (finish_decl, build_compound_literal): Set DECL_READ_P flag. (finish_function): Issue -Wunused-but-set-parameter diagnostics. * c-common.c (handle_used_attribute, handle_unused_attribute): Likewise. * c-tree.h (default_function_array_read_conversion, mark_exp_read): New prototypes. * c-typeck.c (default_function_array_read_conversion, mark_exp_read): New functions. (default_conversion, c_process_expr_stmt): Call mark_exp_read. * c-parser.c (c_parser_initializer, c_parser_expr_no_commas, c_parser_binary_expression, c_parser_cast_expression, c_parser_expr_list, c_parser_omp_atomic, c_parser_omp_for_loop): Call default_function_array_read_conversion instead of default_function_array_conversion where needed. (c_parser_unary_expression, c_parser_conditional_expression, c_parser_postfix_expression_after_primary, c_parser_initelt): Likewise. Call mark_exp_read where needed. (c_parser_statement_after_labels, c_parser_asm_operands, c_parser_typeof_specifier, c_parser_sizeof_expression, c_parser_alignof_expression, c_parser_initval): Call mark_exp_read where needed. * common.opt (Wunused-but-set-variable, Wunused-but-set-parameter): New. * toplev.c (warn_unused_but_set_variable): Default to warn_unused. (warn_unused_but_set_parameter): Default to warn_unused && extra_warnings. * doc/invoke.texi: Document -Wunused-but-set-variable and -Wunused-but-set-parameter. * objc-act.c (finish_var_decl, objc_begin_catch_clause, really_start_method, get_super_receiver, handle_class_ref): Set DECL_READ_P in addition to TREE_USED. * gcc.dg/Wunused-var-1.c: New test. * gcc.dg/Wunused-var-2.c: New test. * gcc.dg/Wunused-var-3.c: New test. * gcc.dg/Wunused-var-4.c: New test. * gcc.dg/Wunused-var-5.c: New test. * gcc.dg/Wunused-var-6.c: New test. * gcc.dg/Wunused-parm-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@158086 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-07 * diagnostic.h (diagnostic_override_option_index): New macro toSimon Baldwin
set a diagnostic's option_index. * c-tree.h (c_cpp_error): Add warning reason argument. * opts.c (_warning_as_error_callback): New. (register_warning_as_error_callback): Store callback for warnings enabled via enable_warning_as_error. (enable_warning_as_error): Call callback, minor code tidy. * opts.h (register_warning_as_error_callback): Declare. * c-opts.c (warning_as_error_callback): New, set cpp_opts flag in response to -Werror=. (c_common_init_options): Register warning_as_error_callback in opts.c. * common.opt: Add -Wno-cpp option. * c-common.c (struct reason_option_codes_t): Map cpp warning reason codes to gcc option indexes. * (c_option_controlling_cpp_error): New function, lookup the gcc option index for a cpp warning reason code. * (c_cpp_error): Add warning reason argument, call c_option_controlling_cpp_error for diagnostic_override_option_index. * doc/invoke.texi: Document -Wno-cpp. * cpp.c (cb_cpp_error): Add warning reason argument, set a value for diagnostic_override_option_index if CPP_W_WARNING_DIRECTIVE. * directives.c (do_diagnostic): Add warning reason argument, call appropriate error reporting function for code. (directive_diagnostics): Call specific warning functions with warning reason where appropriate. (do_error, do_warning, do_pragma_dependency): Add warning reason argument to do_diagnostic calls. * macro.c (_cpp_warn_if_unused_macro, enter_macro_context, _cpp_create_definition): Call specific warning functions with warning reason where appropriate. * Makefile.in: Add new diagnostic functions to gettext translations. * include/cpplib.h (struct cpp_callbacks): Add warning reason code to error callback. (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR, CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums. (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS, CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR, CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS, CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS, CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF, CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE, CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp warning reason codes. (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, cpp_warning_with_line, cpp_pedwarning_with_line, cpp_warning_with_line_syshdr): New specific error reporting functions. * pch.c (cpp_valid_state): Call specific warning functions with warning reason where appropriate. * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central diagnostic handlers. (cpp_warning, cpp_pedwarning, cpp_warning_syshdr, cpp_warning_with_line, cpp_pedwarning_with_line, cpp_warning_with_line_syshdr): New specific error reporting functions. * expr.c (cpp_classify_number, eval_token, num_unary_op): Call specific warning functions with warning reason where appropriate. * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment, warn_about_normalization, lex_identifier_intern, lex_identifier, _cpp_lex_direct): Ditto. * charset.c (_cpp_valid_ucn, convert_hex, convert_escape, narrow_str_to_charconst): Ditto. * gcc.dg/cpp/warn-undef-2.c: New. * gcc.dg/cpp/warn-traditional-2.c: New. * gcc.dg/cpp/warn-comments-2.c: New. * gcc.dg/cpp/warning-directive-1.c: New. * gcc.dg/cpp/warn-long-long.c: New. * gcc.dg/cpp/warn-traditional.c: New. * gcc.dg/cpp/warn-variadic-2.c: New. * gcc.dg/cpp/warn-undef.c: New. * gcc.dg/cpp/warn-normalized-1.c: New. * gcc.dg/cpp/warning-directive-2.c: New. * gcc.dg/cpp/warn-long-long-2.c: New. * gcc.dg/cpp/warn-variadic.c: New. * gcc.dg/cpp/warn-normalized-2.c: New. * gcc.dg/cpp/warning-directive-3.c: New. * gcc.dg/cpp/warn-deprecated-2.c: New. * gcc.dg/cpp/warn-trigraphs-1.c: New. * gcc.dg/cpp/warn-multichar-2.c: New. * gcc.dg/cpp/warn-normalized-3.c: New. * gcc.dg/cpp/warning-directive-4.c: New. * gcc.dg/cpp/warn-unused-macros.c: New. * gcc.dg/cpp/warn-trigraphs-2.c: New. * gcc.dg/cpp/warn-cxx-compat-2.c: New. * gcc.dg/cpp/warn-cxx-compat.c: New. * gcc.dg/cpp/warn-redefined.c: New. * gcc.dg/cpp/warn-trigraphs-3.c: New. * gcc.dg/cpp/warn-unused-macros-2.c: New. * gcc.dg/cpp/warn-deprecated.c: New. * gcc.dg/cpp/warn-trigraphs-4.c: New. * gcc.dg/cpp/warn-redefined-2.c: New. * gcc.dg/cpp/warn-comments.c: New. * gcc.dg/cpp/warn-multichar.c: New. * g++.dg/cpp/warning-directive-1.C: New. * g++.dg/cpp/warning-directive-2.C: New. * g++.dg/cpp/warning-directive-3.C: New. * g++.dg/cpp/warning-directive-4.C: New. * gfortran.dg/warning-directive-1.F90: New. * gfortran.dg/warning-directive-3.F90: New. * gfortran.dg/warning-directive-2.F90: New. * gfortran.dg/warning-directive-4.F90: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@158079 138bc75d-0d04-0410-961f-82ee72b054a4
2009-11-25Remove trailing white spaces.H.J. Lu
2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4
2009-10-262009-10-26 Ben Elliston <bje@au.ibm.com>Ben Elliston
Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. * c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is defined, add the named address space keywords. (c_addr_space_name): New function. (complete_array_type): Preserve named address space. (handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15, RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE. (ADDR_SPACE_KEYWORD): New macro. (c_addr_space_name): Add prototype. * c-tree.h (struct c_declspecs): Add address_space member. (declspecs_add_addrspace): Add prototype. * c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces. * c-parser.c (c_parse_init): Add assertion. (typedef enum c_id_kind): Add C_ID_ADDRSPACE. (c_lex_one_token): Handle address space keywords. (c_token_starts_typename): Likewise. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_postfix_expression_after_paren_type): Diagnose compound literal within function qualified with named address space. * c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named address space qualifiers. (shadow_tag_warned): Warn about useless address space qualifiers. (quals_from_declspecs): Handle address space qualifiers. (grokdeclarator): Likewise. (build_null_declspecs): Likewise. (declspecs_add_addrspace): New function. * c-typeck.c (addr_space_superset): New function. (qualify_type): Handle named address spaces. (composite_type): Likewise. (common_pointer_type): Likewise. (comp_target_types): Likewise. (build_conditional_expr): Likewise. (handle_warn_cast_qual): Likewise. (build_c_cast): Likewise. (convert_for_assignment): Likewise. (build_binary_op): Likewise. (pointer_diff): Handle named address spaces. Use intermediate integer type of sufficient size if required. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@153574 138bc75d-0d04-0410-961f-82ee72b054a4
2009-09-14 * builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.Richard Henderson
* cfgbuild.c (make_edges): Handle asm goto. * cfglayout.c (fixup_reorder_chain): Likewise. * cfgrtl.c (patch_jump_insn): Likewise. * gimple-pretty-print.c (dump_gimple_asm): Likewise. * gimple.c (gimple_build_asm_1): Add and use nlabels parameter. (gimple_build_asm_vec): Add and use labels parameter. (gimple_build_asm): Remove. (walk_gimple_asm): Walk labels too. * gimple.def (GIMPLE_ASM): Update docs. * gimple.h: Update decls. (struct gimple_statement_asm): Change nc to use unsigned char; add nl member. (gimple_asm_nlabels): New. (gimple_asm_label_op, gimple_asm_set_label_op): New. * gimplify.c (gimplify_asm_expr): Copy labels from ASM_EXPR into gimple_build_asm_vec. * jump.c (mark_jump_label_asm): New. (mark_jump_label): Use it. (redirect_jump_1): Handle asm goto. (invert_jump_1): Soft fail if X is null. * recog.c (extract_asm_operands): New. (asm_noperands): Use it; handle asm labels. (decode_asm_operands): Use extract_asm_operands. (asm_operand_ok): Properly handle empty string. * reg-stack.c (get_asm_operands_in_out): Rename from get_asm_operand_n_inputs; use extract_asm_operands; return both inputs and outputs by reference; update all callers. * rtl.def (ASM_OPERANDS): Add label vector as operand 6. * rtl.h (ASM_OPERANDS_LABEL_VEC): New. (ASM_OPERANDS_LABEL_LENGTH, ASM_OPERANDS_LABEL): New. (ASM_OPERANDS_SOURCE_LOCATION): Renumber. (extract_asm_operands): Declare. * stmt.c (expand_asm_operands): Add and use labels parameter. (check_unique_operand_names): Likewise. (resolve_asm_operand_names, resolve_operand_name_1): Likewise. (expand_asm_stmt): Handle asm labels. * tree-cfg.c (make_gimple_asm_edges): New. (make_edges): Use it. (cleanup_dead_labels): Handle asm labels. (is_ctrl_altering_stmt): Likewise. (gimple_redirect_edge_and_branch): Likewise. * tree.def (ASM_EXPR): Add 5th operand. * tree.h (ASM_LABELS): New. (resolve_asm_operand_names): Update decl. * c-parser.c (c_parser_asm_statement): Parse asm goto. (c_parser_asm_goto_operands): New. * c-tree.h (build_asm_expr): Update decl. * c-typeck.c (build_asm_expr): Add and use labels parameter. * doc/extend.texi: Document asm goto. gcc/ada/ * gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR. gcc/cp/ * cp-tree.h (finish_asm_stmt): Update decl. * parser.c (cp_parser_asm_definition): Parse asm goto. (cp_parser_asm_label_list): New. * pt.c (tsubst_copy_asm_operands): Don't recurse on labels. (tsubst_expr): Handle asm labels. * semantics.c (finish_asm_stmt): Add and use labels parameter. gcc/testsuite/ * c-c++-common/asmgoto-1.c, c-c++-common/asmgoto-2.c, c-c++-common/asmgoto-3.c, gcc.c-torture/compile/asmgoto-1.c, gcc.dg/tree-ssa/asmgoto-1.c: New files. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@151701 138bc75d-0d04-0410-961f-82ee72b054a4
2009-09-132009-09-13 Richard Guenther <rguenther@suse.de>Richard Guenther
Rafael Avila de Espindola <espindola@google.com> * langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (LANG_HOOKS_INITIALIZER): Adjust. (lhd_pass_through_t): Declare. * langhooks.h (struct lang_hooks): Add eh_runtime_type and eh_personality. * langhooks.c (lhd_pass_through_t): New function. * dwarf2out.c (output_call_frame_info, dwarf2out_do_cfi_startproc, dwarf2out_begin_prologue): Use personality from current_function_decl. * expr.h (get_personality_function): Declare. * expr.c (get_personality_function): New function. (build_personality_function): Likewise. * libfuncs.h (libfunc_index): Remove LTI_eh_personality. (eh_personality_libfunc): Remove. * optabs.c (build_libfunc_function): New function split out from ... (init_one_libfunc): ... here. * tree.h (DECL_FUNCTION_PERSONALITY): New. (tree_function_decl): Add personality. (lhd_gcc_personality): Declare. (build_personality_function): Likewise. * tree.c (gcc_eh_personality_decl): New. (lhd_gcc_personality): New function. * except.h (lang_eh_runtime_type): Remove. (enum eh_personality_kind): New. (build_personality_function): Declare. (function_needs_eh_personality): Declare. * except.c (lang_eh_runtime_type): Remove. (function_needs_eh_personality): New function. (add_type_for_runtime): Call lang_hooks.type_for_runtime instead. (sjlj_emit_function_enter, output_function_exception_table): Use personality from current_function_decl. * tree-eh.c (lower_eh_constructs): Set DECL_FUNCTION_PERSONALITY. * tree-inline.c (tree_can_inline_p): Do not inline across different EH personalities. (expand_call_inline): Likewise. Adjust the callers EH personality. (tree_function_versioning): Copy DECL_FUNCTION_PERSONALITY. * cgraph.c (cgraph_add_new_function): Set DECL_FUNCTION_PERSONALITY. * Makefile.in (cgraph.o): Add $(EXCEPT_H) dependency. (c-parser.o): Likewise * c-tree.h (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-decl.c (finish_decl): Don't call c_maybe_initialize_eh. (finish_decl): Don't call c_maybe_initialize_eh. (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-parser.c (c_parser_omp_construct): Likewise. (c_parse_file): Initialize exception handling. objc/ * objc-act.c (objc_eh_runtime_type): Export. (objc_init_exceptions): Remove. Move warning code ... (objc_begin_try_stmt): ... here (objc_build_throw_stmt): ... and here. (objc_eh_personality_decl): New. (objc_eh_personality): New function. * objc-act.h (objc_eh_runtime_type): Declare. (objc_eh_personality): Likewise. * objc-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. cp/ * except.c (init_exception_processing): Do not set lang_eh_runtime_type. (choose_personality_routine): Do not set eh_personality_decl, set pragma_java_exceptions. * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (cp_eh_personality_decl): New. (cp_eh_personality): Likewise. * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H) dependencies. java/ * decl.c (do_nothing): Remove. (java_init_decl_processing): Do not set lang_eh_runtime_type. * Make-lang.in (lang.o): Add $(EXCEPT_H) dependency. * lang.c (java_eh_personality): New. (java_eh_personality_decl): Likewise. (LANG_HOOKS_EH_PERSONALITY): Define. ada/ * gcc-interface/misc.c (gnat_init_gcc_eh): Do not set lang_eh_runtime_type. (LANG_HOOKS_EH_PERSONALITY): Define. (gnat_eh_personality_decl): New. (gnat_eh_personality): Likewise. * Make-lang.in (misc.o): Add gt-ada-misc.h dependency. * config-lang.in (gtfiles): Add misc.c. fortran/ * f95-lang.c (gfc_maybe_initialize_eh): Do not init eh_personality_libfunc. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@151676 138bc75d-0d04-0410-961f-82ee72b054a4
2009-08-202009-08-20 Richard Guenther <rguenther@suse.de>Richard Guenther
* c-objc-common.h (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Do not define. * c-tree.h (c_dup_lang_specific_decl): Remove. (struct lang_decl, struct lang_type): Move definitions ... * c-lang.h: ... here. New file. * c-decl.c: Include c-lang.h. (c_dup_lang_specific_decl): Remove. * c-typeck.c: Include c-lang.h. * Makefile.in (c-decl.o): Add c-lang.h dependency. (c-typeck.o): Likewise. * c-config-lang.in (gtfiles): Add c-lang.h. * gengtype.c (get_output_file_with_visibility): Handle c-lang.h like c-tree.h. objc/ * objc-act.c: Include c-lang.h * Make-lang.in (objc/objc-act.o): Add c-lang.h dependency. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@150966 138bc75d-0d04-0410-961f-82ee72b054a4
2009-06-19./:Ian Lance Taylor
* tree-cfg.c (gimple_redirect_edge_and_branch): Change ERROR_MARK to GIMPLE_ERROR_MARK. * c-typeck.c (build_conditional_expr): Add op1_original_type and op2_original_type parameters. Warn about using different enum types. * c-parser.c (c_parser_conditional_expression): Pass original types to build_conditional_expr. * c-tree.h (build_conditional_expr): Update declaration. testsuite/: * gcc.dg/Wcxx-compat-18.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@148727 138bc75d-0d04-0410-961f-82ee72b054a4
2009-06-19./:Ian Lance Taylor
* dse.c (struct store_info): Rename bitmap field to bmap. Change all uses. * c-decl.c (in_struct, struct_types): Remove. (struct c_binding): Add in_struct field. (c_binding_ptr): Define type, along with VEC. (struct c_struct_parse_info): Define. (struct_parse_info): New static variable. (bind): Initialize in_struct field. (start_struct): Remove enclosing_in_struct and enclosing_struct_types parameters. Add enclosing_struct_parse_info parameter. Change all callers. Set struct_parse_info rather than in_struct and struct_types. (grokfield): If -Wc++-compat and there is a symbol binding for the field name, set the in_struct flag and push it on the struct_parse_info->fields vector. (warn_cxx_compat_finish_struct): New static function. (finish_struct): Remove enclosing_in_struct and enclosing_struct_types parameters. Add enclosing_struct_parse_info parameter. Change all callers. Don't set C_TYPE_DEFINED_IN_STRUCT here. Call warn_cxx_compat_finish_struct. Free struct_parse_info and set to parameter. Only push on struct_types if warn_cxx_compat. (finish_enum): Only push on struct_types if warn_cxx_compat. (declspecs_add_type): Add loc parameter. Change all callers. Change all error calls to error_at. Pass loc, not input_location, to pedwarn calls. Warn if -Wc++-compat and a typedef name is defined in a struct. If -Wc++-compat and parsing a struct, record that a typedef name was used. * c-parser.c (c_parser_declspecs): Get location to pass to declspecs_add_type. (c_parser_struct_or_union_specifier): Update calls to start_struct and finish_struct. * c-tree.h (struct c_struct_parse_info): Declare. (finish_struct, start_struct): Update declarations. (declspecs_add_type): Update declaration. objc/: * objc-act.c (objc_in_struct, objc_struct_types): Remove. (objc_struct_info): New static variable. (objc_start_struct): Pass &objc_struct_info, not &objc_in_struct and &objc_struct_types, to start_struct. (objc_finish_struct): Likewise for finish_struct. objcp/: * objcp-decl.h (start_struct): Remove in_struct and struct_types parameters. Add struct_info parameter. (finish_struct): Likewise. testsuite/: * gcc.dg/Wcxx-compat-15.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@148709 138bc75d-0d04-0410-961f-82ee72b054a4
2009-06-16./:Ian Lance Taylor
* df-problems.c (df_simulate_one_insn_forwards): Fix braces in switch. * gcov.c (read_count_file): Add braces around variables declared before label. * c.opt (Wjump-misses-init): New warning. * c-opts.c (c_common_handle_option): Set warn_jump_misses_init for -Wall and -Wc++-compat if not already set. (c_common_post_options): Clear warn_jump_misses_init if it was not set. * c-decl.c (struct c_binding): Change type field to a union with new label field. Make it the first field in the struct. Update references to type to use u.type instead. (struct c_spot_bindings): Define. (struct c_goto_bindings): Define. (c_goto_bindings_p): Define, along with VECs. (struct c_label_vars): Define. (struct c_scope): Add has_label_bindings field. (bind_label, set_spot_bindings): New static functions. (decl_jump_unsafe, update_spot_bindings): New static functions. (update_label_decls): New static function. (pop_scope): Call update_label_decls. Don't call c_end_vm_scope. Update binding u.label field to shadowed field. (c_binding_start_stmt_expr): New function. (c_binding_end_stmt_expr): New function. (pushdecl): Don't call c_begin_vm_scope. (make_label): Add defining and p_label_vars parameters. Change all callers. (lookup_label): Correct test for whether a label has not yet been defined. Call bind_label rather than bind. (warn_about_goto): New static function. (lookup_label_for_goto): New function. (declare_label): Call bind_label rather than bind. (check_earlier_gotos): New static function. (define_label): Don't give errors about jumping into statement expressions or scopes of variably modified types. Call set_spot_bindings and check_earlier_gotos. Call bind_label instead of bind. Don't set label_context_stack_se or label_context_stack_vm. (c_get_switch_bindings): New function. (c_release_switch_bindings): New function. (c_check_switch_jump_warnings): New function. (start_function): Don't set label_context_stack_se or label_context_stack_vm. (finish_function): Likewise. * c-typeck.c (label_context_stack_se): Don't define. (label_context_stack_vm): Don't define. (c_finish_goto_label): Call lookup_label_for_goto rather than lookup_label. Don't give errors about jumping into a statement expression or the scope of a variably modified type. Don't set label_context_stack_se or label_context_stack_vm. (struct c_switch): Remove blocked_stmt_expr and blocked_vm fields. Add bindings field. (c_start_case): Don't set deleted fields. Set bindings field. (do_case): Rework order of tests. Don't check blocked_stmt_expr or blocked_vm. Call c_check_switch_jump_warnings. (c_finish_case): Don't test blocked_stmt_expr field. Call c_release_switch_bindings. (c_begin_stmt_expr): Don't increment blocked_stmt_expr in c_switch_stack. Don't walk label_context_stack_se labels. Don't set label_context_stack_se. Call c_bindings_start_stmt_expr. (c_finish_stmt_expr): Don't decrement blocked_stmt_expr in c_switch_stack. Don't walk label_context_stack_se labels. Don't set label_context_stack_se. Call c_bindings_end_stmt_expr. (c_begin_vm_scope, c_end_vm_scope): Don't define. * c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR): Don't define. (C_DECL_UNDEFINABLE_STMT_EXPR): Don't define. (C_DECL_UNJUMPABLE_VM): Don't define. (C_DECL_UNDEFINABLE_VM): Don't define. (struct c_label_list): Don't define. (struct c_label_context_se): Don't define. (struct c_label_context_vm): Don't define. (struct c_spot_bindings): Declare. (c_bindings_start_stmt_expr): Declare. (c_bindings_end_stmt_expr): Declare. (lookup_label_for_goto): Declare. (c_get_switch_bindings, c_release_switch_bindings): Declare. (c_check_switch_jump_warnings): Declare. (label_context_stack_se, label_context_stack_vm): Don't declare. (c_finish_goto_label): Update declaration. (c_begin_vm_scope, c_end_vm_scope): Don't declare. * doc/invoke.texi (Option Summary): Mention -Wjump-misses-init. (Warning Options): Document -Wjump-misses-init. cp/: * parser.c (cp_parser_direct_declarator): Add braces around variables declared before label. objc/: * objc-act.c (objc_start_function): Don't set label_context_stack_se or label_context_stack_vm. testsuite/: * gcc.dg/Wjump-misses-init-1.c: New testcase. * gcc.dg/Wjump-misses-init-2.c: New testcase. * gcc.dg/c99-vla-jump-5.c: Adjust expected error messages. Recognize new notes. * gcc.dg/stmt-expr-label-2.c: Likewise. * gcc.dg/c99-vla-jump-1.c: Recognize new notes. Fix column numbers. * gcc.dg/c99-vla-jump-2.c: Recognize new notes. * gcc.dg/c99-vla-jump-3.c: Recognize new notes. * gcc.dg/c99-vla-jump-4.c: Likewise. * gcc.dg/stmt-expr-label-1.c: Likewise. * gcc.dg/stmt-expr-label-3.c: Likewise. * gcc.dg/vla-8.c: Likewise. Move error message to different line. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@148512 138bc75d-0d04-0410-961f-82ee72b054a4
2009-06-12gcc/java/Aldy Hernandez
* java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. * expr.c (force_evaluation_order): Same. * typeck.c: Add location to build_decl or PUSH_FIELD calls. * class.c: Same. * decl.c: Same. * jcf-parse.c: Same. * constants.c: Same. * resource.c: Same. * except.c: Same. * builtins.c: Same. * expr.c: Same. * java-tree.h (PUSH_FIELD): Add location field. gcc/objc/ * objc-act.c (finish_var_decl): Pass location to finish_decl. (objc_get_parm_info): Same. (get_super_receiver): Same. * objc-act.c (objc_build_component_ref): Pass location to build_compound_ref. (build_module_initializer_routine): Pass location to c_end_compound_stmt. (objc_generate_static_init_call): Pass location to build_stmt. (build_typed_selector_reference): New location argument. (build_selector_reference): Same. (objc_substitute_decl): Pass location to build_array_ref. (next_sjlj_build_try_catch_finally): Pass location to build_stmt. (objc_begin_catch_clause): Same. (objc_finish_try_stmt): Same. (objc_finish_catch_clause): Pass location to c_end_compound_stmt. (objc_build_throw_stmt): New argument. (generate_shared_structures): Pass location to build_c_cast. (objc_build_message_expr): Use local location. (objc_finish_message_expr): Use input_location. (build_objc_method_call): New argument. (objc_build_selector_expr): Same. (get_super_receiver): Pass location to build_c_cast, build_modify_expr, build_compound_expr. * objc-act.c: Add location to all calls to start_struct, build_decl, finish_struct. gcc/ * tree-pretty-print.c (dump_generic_node): Dump column numbers. * gimple-pretty-print.c (dump_gimple_stmt): Same. * gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs created. * c-parser.c (c_parser_binary_expression): Use current column while building binary operations. * common.opt (fshow-column): Enable by default. * tree-vrp.c (check_array_ref): Use warning_at. (check_array_bounds): Use location from call back if expr has no location. * tree.h: Add location argument to maybe_fold_*. * tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*. (maybe_fold_offset_to_array_ref): Add location argument and use it. (maybe_fold_offset_to_component_ref): Same. (maybe_fold_offset_to_reference): Same. (maybe_fold_offset_to_address): Same. (maybe_fold_stmt_indirect): Same. (maybe_fold_stmt_addition): Same. (fold_stmt_r): Pass location to maybe_fold_*. (fold_gimple_assign): Same. * c-tree.h: Add location argument to finish_decl, default_function_array_conversion, store_init_value. * c-decl.c (define_label): Use error_at. (c_make_fname_decl): Pass location to finish_decl. (finish_decl): New location argument. (build_compound_literal): Pass location to store_init_value. (grokdeclarator): Pass location to finish_decl. (grokfield): Same. * c-typeck.c (array_to_pointer_conversion): New location argument. (function_to_pointer_conversion): Same. (default_function_array_conversion): Same. (parser_build_unary_op): Pass location to overflow_warning. (parser_build_binary_op): Same. Use warning_at. (build_unary_op): Pass location to array_to_pointer_conversion. (build_c_cast): Pass location to digest_init. (build_modify_expr): New location argument. (convert_for_assignment): Same. (store_init_value): Same. (digest_init): Same. (output_init_element): Pass location to digest_init and array_to_pointer_conversion. (c_finish_return): Pass location to convert_for_assignment. * gimplify.c (gimplify_conversion): Pass location to maybe_fold_offset_to_address. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location to maybe_fold_stmt_addition. * c-omp.c (c_finish_omp_atomic): Pass new location to build_modify_expr. (c_finish_omp_for): Same. * c-common.c (overflow_warning): New argument. * c-common.h: New argument to build_modify_expr, overflow_warning. * c-parser.c (c_parser_declaration_or_fndef): Pass location to finish_decl. (c_parser_initializer): Pass location to default_function_array_conversion. (c_parser_initelt): Same. (c_parser_initval): Same. (c_parser_asm_operands): Same. (c_parser_expr_no_commas): Same. Pass location to build_modify_expr. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Add location info to stack. Use it. (c_parser_unary_expression): Pass location to default_function_array_conversion, parser_build_unary_op, build_indirect_ref, c_parser_postfix_expression_after_primary. (c_parser_postfix_expression_after_primary): New location argument. Use it. (c_parser_expression_conv): Pass location to default_function_array_conversion. (c_parser_expr_list): Same. (c_parser_omp_atomic): Same. (c_parser_omp_for_loop): Same. * c-tree.h: (struct c_declarator): Add comment to id_loc. (build_array_declarator): New argument. * c-decl.c (build_array_declarator): Add location argument. (grokdeclarator): Set id_loc for cdk_array. * c-parser.c (c_parser_direct_declarator_inner): Pass location to build_array_declarator. * tree.c (build_omp_clause): Add location argument. * tree.h (OMP_CLAUSE_HAS_LOCATION): New macro. (OMP_CLAUSE_LOCATION): New macro. (struct tree_omp_clause): Add location field. (build_omp_clause): Add argument. * testsuite/gcc.dg/gomp/for-1.c: Fix column. * cp/pt.c (tsubst_omp_for_iterator): Pass location to build_omp_clause. * cp/parser.c (cp_parser_omp_var_list_no_open): Same. (cp_parser_omp_clause_collapse): Same. (cp_parser_omp_clause_default): Same. (cp_parser_omp_clause_if): Same. (cp_parser_omp_clause_nowait): Same. (cp_parser_omp_clause_num_threads): Same. (cp_parser_omp_clause_ordered): Same. (cp_parser_omp_clause_schedule): Same. (cp_parser_omp_clause_untied): Same. (cp_parser_omp_for_loop): Same. (cp_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (c_start_case): Add location argument. (c_process_expr_stmt): Same. (c_finish_goto_*): Same. * tree-parloops.c (initialize_reductions): Pass location to build_omp_clause. (create_parallel_loop): Same. * fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same. (gfc_trans_omp_reduction_list): Same. (gfc_trans_omp_clauses): Same. (gfc_trans_omp_do): Same. * c-typeck.c (c_finish_goto_label): Same. (c_finish_goto_ptr): New location argument. (c_start_case): Same. (emit_side_effect_warnings): Same. (c_process_expr_stmt): Same. (c_finish_stmt_expr): Same. (c_finish_omp_clauses): Use error_at instead of error. * gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to build_omp_clause. * c-omp.c (c_split_parallel_clauses): New location argument. * tree-nested.c (convert_nonlocal_reference_stmt): Pass location to build_omp_clause. (convert_local_reference_stmt): Same. (convert_gimple_call): Same. * c-common.h (c_split_parallel_clauses): New argument. * c-parser.c (c_parser_statement_after_labels): Pass location to c_finish_goto_label. (c_parser_switch_statement): Pass location to c_start_case. (c_parser_for_statement): Pass location to c_finish_expr_stmt, and c_process_expr_stmt. (c_parser_omp_variable_list): Add location argument. (c_parser_omp_clause_collapse): Pass location to build_omp_clause. (c_parser_omp_clause_default): Same. (c_parser_omp_clause_if): Same. (c_parser_omp_clause_num_threads): Same. (-c_parser_omp_clause_ordered): Same. (c_parser_omp_clause_reduction): Pass location to c_parser_omp_variable_list. (c_parser_omp_clause_schedule): Pass location to build_omp_clause. (c_parser_omp_clause_untied): Same. (c_parser_omp_for_loop): Pass location to c_process_expr_stmt. (c_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (check_for_loop_decls, undeclared_variable, build_component_ref, build_array_ref, build_external_ref, c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op, build_conditional_expr, build_compound_expr, c_cast_expr, build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr, c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New argument. * c-semantics.c (build_stmt): Same. (build_case_label): Same. * c-decl.c (c_finish_incomplete_decl): Pass location on down. (undeclared_variable): New argument. (make_label): Same. (lookup_label): Pass location on down. (define_label): Same. (finish_decl): Same. (build_compound_literal): Same. (finish_struct): Same. (finish_function): Do not set location here. (check_for_loop_decls): New argument. * tree.c (save_expr): Set location. (build_empty_stmt): New argument. * tree.h (build_empty_stmt): New argument to build_empty_stmt. (CAN_HAVE_LOCATION_P): Make sure we have a non empty node. * builtins.c (gimplify_va_arg_expr): Use locations. (expand_builtin_sync_operation): Same. * c-typeck.c (build_component_ref): New argument. (build_array_ref): Same. (build_external_ref): Same. (c_expr_sizeof_expr): Same. (c_expr_sizeof_type): Same. (parser_build_unary_op): Same. (build_conditional_expr): Same. (build_compound_expr): Pass location on down. (build_compound_expr): New argument. (build_c_cast): Same. (c_cast_expr): Same. (build_asm_expr): Same. (c_finish_return): Same. (c_process_expr_stmt): Pass location on down. (c_finish_stmt_expr): New argument. (push_clenaup): Same. (c_finish_omp_parallel): Same. (c_finish_omp_task): Same. * gimplify.c (gimplify_call_expr): Pass location on down. * c-omp.c (c_finish_omp_master): New argument. (c_finish_omp_critical): Same. (c_finish_omp_ordered): Same. (c_finish_omp_barrier): Same. (-c_finish_omp_taskwait): Same. (c_finish_omp_atomic): Same. (c_finish_omp_flush): Same. * tree-inline.c (copy_tree_body_r): Pass location on down. (inline_forbidden_p): Remove use of input_location. * c-gimplify.c (c_build_bind_expr): New argument. * c-common.c (c_common_truthvalue_conversion): Pass location on down. (c_sizeof_or_alignof_type): New argument. (c_alignof_expr): Same. (build_va_arg): Same. (c_add_case_label): Same. * c-common.h (c_sizeof_or_alignof_type, c_alignof_expr, c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label, c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt, 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_taskwait, c_finish_omp_for, c_split_parallel_clauses): New argument. * stub-objc.c (objc_build_selector_expr): Same. (objc_build_throw_stmt): Same. * c-parser.c (c_parser_declaration_or_fndef): Pass location on down. (c_parser_initelt): Same. (c_parser_compound_statement): Same. (c_parser_compound_statement_nostart): Same. (c_parser_label): Same. (c_parser_statement_after_labels): Same. (c_parser_if_body): Same. (c_parser_else_body): Same. (c_parser_if_statement): Same. (c_parser_switch_statement): Same. (c_parser_while_statement): Same. (c_parser_do_statement): Same. (c_parser_for_statement): Same. (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Same. (c_parser_cast_expression): Same. (c_parser_unary_expression): Same. (c_parser_sizeof_expression): Same. (c_parser_alignof_expression): Same. (c_parser_postfix_expression): Same. (c_parser_expression): Same. (c_parser_objc_receiver): Same. (c_parser_omp_variable_list): Same. (c_parser_omp_structured_block): Same. (c_parser_omp_atomic): New argument. (c_parser_omp_barrier): Same. (c_parser_omp_critical): Same. (c_parser_omp_flush): Pass location on down. (c_parser_omp_for_loop): New argument. (c_parser_omp_for): Same. (c_parser_omp_master): Same. (c_parser_omp_ordered): Same. (c_parser_omp_sections_scope): Same. (c_parser_omp_sections): Same. (c_parser_omp_parallel): Same. (c_parser_omp_single): Same. (c_parser_omp_task): Same. (c_parser_omp_taskwait): Pass location on down. (c_parser_omp_construct): Same. (c_parser_omp_threadprivate): Same. * dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h, builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c, tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c, c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c, c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c, emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c, rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h, tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c, config/i386/i386.c, stmt.c: Add location argument to the following function definitions and/or function calls: build_decl, objcp_start_struct, objcp_finish_struct, start_struct, finish_struct, PUSH_FIELD, create_artificial_label, cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl, build_compound_literal, parser_xref_tag, resolve_overloaded_builtin, do_case, c_finish_bc_stmt, build_compound_literal, build_function_call. * c-decl.c (build_compound_literal): Add location argument. Make all diagnostic calls use location. (start_struct): Same. (finish_struct): Same. (start_enum): Same. (build_enumerator): Same. (start_function): Same. (grokdeclarator): Make all diagnostic calls use location. (store_parm_decls_oldstyle): Same. * c-typeck.c (build_function_call): Add location argument. Make all diagnostic calls use location. (do_case): Same. (c_finish_bc_stmt): Same. * tree-nested.c (get_trampoline_type): Add argument. Pass location to build_decl. (lookup_tramp_for_decl): Pass location to get_trampoline_type. * rtl.h (RTL_LOCATION): New. * c-common.c (c_add_case_label): Add location argument. Make all diagnostic calls use location. * c-common.h: Add location argument to make_fname_decl, do_case, c_add_case_label, build_function_call, resolve_overloaded_builtin. * c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc. Set it appropriately for every case. Pass enum_loc to start_enum call. Pass value_loc first to build_enumerator. Pass enum_loc to parser_xref_tag. (c_parser_struct_or_union_specifier): Save location. Use it for start_struct, finish_struct, and parser_xref_tag. gcc/testsuite/ * gcc.dg/old-style-prom-3.c: Add column info. * gcc.dg/overflow-warn-1.c * gcc.dg/gomp/pr27415.c * gcc.dg/gomp/for-1.c: Same. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/c99-tag-3.c: Same. * gcc.dg/Wredundant-decls-2.c: Same. * gcc.dg/func-ptr-conv-1.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/cpp/line3.c: Same. * gcc.dg/array-10.c: Same. * gcc.dg/c99-vla-jump-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/Wshadow-3.c: Same. * gcc.dg/c90-const-expr-8.c: Same. * gcc.dg/label-decl-2.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/builtins-30.c: Same. * gcc.dg/Warray-bounds.c: Same. * gcc.dg/Wcxx-compat-2.c: Same. * gcc.dg/tree-ssa/col-1.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/cast-function-1.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/vla-8.c: Same. * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct line. * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. * gcc.dg/old-style-prom-3.c: Check for error on the correct line. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/builtins-30.c: Same. Test for columns. gcc/objcp/ * objcp-decl.h (c_end_compound_stmt): New argument. * objcp-decl.c (objcp_start_struct): Add argument. (objcp_finish_struct): Same. gcc/cp/ * typeck.c (cp_build_binary_op): Pass location to overflow_warning. (build_modify_expr): New arg. * semantics.c (finish_unary_op_expr): Pass location to overflow_warning. (handle_omp_for_class_iterator): Pass location to build_modify_expr. * typeck.c (cxx_sizeof_or_alignof_type): Pass location to c_sizeof_or_alignof_type. (build_array_ref): New argument. (build_compound_expr): Same. (build_const_cast): Same. (build_ptrmemfunc): Pass location to build_c_cast. * init.c (avoid_placement_new_aliasing): Pass location to build_stmt. (build_vec_delete_1): Pass location to cp_build_modify_expr, build_compound_expr. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * decl.c (poplevel): Pass location to c_build_bind_expr. (finish_case_label): Pass location to build_case_label. (finish_constructor_body): Same. (finish_destructor_body): Pass location to build_stmt. (cxx_maybe_build_cleanup): Same, but to build_compound_expr. * call.c (build_new_op): Pass location to build_array_ref. (build_x_va_arg): Pass location to build_va_arg. * except.c (expand_end_catch_block): Pass location to build_stmt. * cp-tree.h (build_array_ref): New argument. (build_compound_expr): Same. (build_c_cast): Same. * cp-gimplify.c (gimplify_if_stmt): Pass location on down. (gimplify_switch_stmt): Same. * typeck2.c (split_nonconstant_init_1): Same. * pt.c (tsubst_copy): Same. * semantics.c (add_decl_expr): Same. (do_poplevel): Same. (push_cleanup): Same. (finish_goto_stmt): Same. (finish_expr_stmt): Same. (begin_if_stmt): Same. (begin_while_stmt): Same. (begin_do_stmt): Same. (finish_return_stmt): Same. (begin_for_stmt): Same. (finish_break_stmt): Same. (finish_continue_stmt): Same. (begin_switch_stmt): Same. (begin_try_block): Same. (begin_handler): Same. (finish_asm_stmt): Same. (finish_label_stmt): Same. (finish_stmt_expr_expr): Same. (finalize_nrv_r): Same. (finish_omp_atomic): Same. * name-lookup.c (do_using_directive): Same. * decl2.c (grok_array_decl): Same. * parser.c (cp_parser_cast_expression): Same. (cp_parser_selection_statement): Same. (cp_parser_implicitly_scoped_statement): Same. (cp_parser_objc_selector_expression): Same. (cp_parser_objc_synchronized_statement): Same. (cp_parser_objc_throw_statement): Same. (cp_parser_omp_critical): Same. (cp_parser_omp_master): Same. * typeck.c (build_function_call): Add location argument. * init.c: Add location argument to all build_decl calls. * class.c: Same. * method.c: Same. * rtti.c: Same. * tree.c: Same. * pt.c: Same. * semantics.c: Same. * lex.c: Same. * decl2.c: Same. * cp-gimplify.c: Same. * decl.c: Same. (cp_make_fname_decl): Add location argument. Pass location ot build_decl. (finish_case_label): Same. * cp-tree.h (finish_case_label): Add location argument. * parser.c (cp_parser_label_for_labeled_statement): Pass location to finish_case_label. gcc/fortran/ * trans-array.c (gfc_trans_allocate_array_storage): Pass location on down. (gfc_trans_array_constructor_value): Same. (gfc_trans_scalarized_loop_end): Same. (gfc_conv_ss_startstride): Same. (gfc_trans_g77_array): Same. (gfc_trans_dummy_array_bias): Same. (gfc_conv_array_parameter): Same. (structure_alloc_comps): Same. * trans-expr.c (gfc_conv_function_call): Same. (fill_with_spaces): Same. (gfc_trans_string_copy): Same. (gfc_trans_scalar_assign): Same. * trans-stmt.c (gfc_trans_goto): Same. (gfc_trans_if_1): Same. (gfc_trans_simple_do): Same. (gfc_trans_do): Same. (gfc_trans_do_while): Same. (gfc_trans_logical_select): Same. (gfc_trans_select): Same. (gfc_trans_forall_loop): Same. (gfc_trans_nested_forall_loop): Same. (generate_loop_for_temp_to_lhs): Same. (generate_loop_for_rhs_to_temp): Same. (gfc_trans_forall_1): Same. (gfc_trans_where_assign): Same. (gfc_trans_where_3): Same. (gfc_trans_allocate): Same. * trans.c (gfc_finish_block): Same. (gfc_trans_runtime_check): Same. (gfc_call_malloc): Same. (gfc_allocate_with_status): Same. (gfc_call_free): Same. (gfc_deallocate_with_status): Same. (gfc_call_realloc): Same. (gfc_trans_code): Same. * trans-decl.c (gfc_init_default_dt): Same. (gfc_generate_constructors): Same. * trans-io.c (gfc_trans_io_runtime_check): Same. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. (gfc_conv_intrinsic_fdate): Same. (gfc_conv_intrinsic_ttynam): Same. (gfc_conv_intrinsic_minmax): Same. (gfc_conv_intrinsic_minmax_char): Same. (gfc_conv_intrinsic_anyall): Same. (gfc_conv_intrinsic_count): Same. (gfc_conv_intrinsic_arith): Same. (gfc_conv_intrinsic_minmaxloc): Same. (gfc_conv_intrinsic_minmaxval): Same. (gfc_conv_intrinsic_rrspacing): Same. (gfc_conv_intrinsic_array_transfer): Same. (gfc_conv_intrinsic_trim): Same. (gfc_conv_intrinsic_repeat): Same. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@148442 138bc75d-0d04-0410-961f-82ee72b054a4
2009-06-09./:Ian Lance Taylor
* targhooks.c (default_builtin_vectorized_function): Change fn parameter to unsigned int. (default_builtin_vectorized_conversion): Change code parameter to unsigned int. (default_builtin_reciprocal): Change fn parameter to unsigned int. * targhooks.h: Update declarations. * config/rs6000/rs6000.c (rs6000_builtin_conversion): Change code parameter to unsigned int. * c-typeck.c (comptypes_check_enum_int): New static function. (comptypes_internal): Add enum_and_int_p parameter. Change all callers. (comp_target_types): Add location parameter. Change all callers. (tagged_types_tu_compatible_p): Add enum_and_int_p parameter. Change all callers. (function_types_compatible_p, type_lists_compatible_p): Likewise. (build_conditional_expr): Add colon_loc parameter. Change all callers. (convert_for_assignment): Add location parameter. Change all callers. * c-parser.c (c_parser_conditional_expression): Pass location of colon to build_conditional_expr. * c-tree.h (build_conditional_expr): Update declaration. objc/: * objc-act.c (objc_gimplify_expr): Change return type to int. * objc-act.h: Update declaration. testsuite/: * gcc.dg/Wcxx-compat-12.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@148325 138bc75d-0d04-0410-961f-82ee72b054a4
2009-05-29./:Ian Lance Taylor
* builtins.c (validate_gimple_arglist): Don't use va_arg with enum type. * calls.c (emit_library_call_value_1): Likewise. * c-typeck.c (c_build_va_arg): New function. * c-tree.h (c_build_va_arg): Declare. * c-parser.c (c_parser_postfix_expression): Call c_build_va_arg instead of build_va_arg. cp/: * error.c (cp_printer): Don't use va_arg with enum type. testsuite/: * gcc.dg/Wcxx-compat-11.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@147989 138bc75d-0d04-0410-961f-82ee72b054a4
2009-05-11./:Ian Lance Taylor
* basic-block.h (enum profile_status): Break out of struct control_flow_graph. * cgraph.h (struct inline_summary): Break out of struct cgraph_local_info. * cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out of struct cgraph_order_sort. * combine.c (enum undo_kind): New enum, broken out of struct undo. * cse.c (struct branch_path): Break out of struct cse_basic_block_data. * except.h (enum eh_region_type): Break out of struct eh_region. * gcc.c (enum add_del): Break out of struct modify_target. * genrecog.c (enum decision_type): Break out of struct decision_test. * ggc-page.c (struct ggc_pch_ondisk): Break out of struct ggc_pch_data. * matrix-reorg.c (struct free_info): Break out of struct matrix_info. * regmove.c (enum match_use): New enum, broken out of struct match. * sched-int.h (enum post_call_group): New enum, broken out of struct deps. (struct deps_reg): Break out of struct deps. * target.h (struct asm_int_op): Break out of struct gcc_target. * tree-eh.c (struct goto_queue_node): Break out of struct leh_tf_state. * tree-inline.h (enum copy_body_cge_which): Break out of copy_body_data. * tree-pass.h (enum opt_pass_type): Break out of struct opt_pass. * c-decl.c (in_struct, struct_types): New static variables. (pushtag): Add loc parameter. Change all callers. (lookup_tag): Add ploc parameter. Change all callers. (check_compound_literal_type): New function. (parser_xref_tag): Add loc parameter. Change all callers. If -Wc++-compat, warn about struct/union/enum types defined within a struct or union. (start_struct): Add enclosing_in_struct, enclosing_struct_types, and loc parameters. Change all callers. Change error calls to error_at, using loc. For a redefinition, if the location of the original definition is known, report it. Set in_struct and struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. (finish_struct): Add new parameters enclosing_in_struct and enclosing_struct_types. Change all callers. Set C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined in the struct. If in a struct, add this struct to struct_types. (start_enum): Add loc parameter. Change all callers. Use error_at for errors, using loc. For a redefinition, if the location of the original definition is known, report it. If in a struct, add this enum type to struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. * c-parser.c (disable_extension_diagnostics): Disable -Wc++-compat. (enable_extension_diagnostics): Reenable -Wc++-compat if appropriate. (c_parser_enum_specifier): Get enum location for start_enum. (c_parser_struct_or_union_specifier): Get struct location for start_struct. Save in_struct and struct_types status between start_struct and finish_struct. (c_parser_cast_expression): Get location of cast. (c_parser_alignof_expression): Get location of type. (c_parser_postfix_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Add type_loc parameter. Change all callers. Call check_compound_literal_type. Use type_loc for error about variable size type. * c-typeck.c (build_external_ref): If -Wc++-compat, warn about a use of an enum constant from an enum type defined in a struct or union. (c_cast_expr): Add loc parameter. Change all callers. If -Wc++-compat, warn about defining a type in a cast. * c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define. (start_enum, start_struct, finish_struct): Update declarations. (parser_xref_tag, c_cast_expr): Update declarations. (check_compound_literal_type): Declare. fortran/: * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of gfc_omp_clauses. (enum gfc_omp_default_sharing): Likewise. * module.c (enum gfc_rsym_state): New enum, broken out of pointer_info. (enum gfc_wsym_state): Likewise. * parse.c (enum state_order): New enum, broken out of st_state. objc/: * objc-act.c (objc_building_struct): New static variable. (objc_in_struct, objc_struct_types): New static variables. (objc_start_struct, objc_finish_struct): New static functions. (generate_struct_by_value_array): Call objc_start_struct instead of start_struct, and call objc_finish_struct instead of finish_struct. (objc_build_struct, build_objc_symtab_template): Likewise. (build_module_descriptor): Likewise. (build_next_objc_exception_stuff): Likewise. (build_protocol_template): Likewise. (build_method_prototype_list_template): Likewise. (build_method_prototype_template): Likewise. (build_category_template, build_selector_template): Likewise. (build_class_template, build_super_template): Likewise. (build_ivar_template, build_ivar_list_template): Likewise. (build_method_list_template): Likewise. (build_method_template): Likewise. objcp/: * objcp-decl.h (start_struct): Add three new, ignored, macro parameters. (finish_struct): Add two new, ignored, macro parameters. testsuite/: * gcc.dg/Wcxx-compat-7.c: New testcase. * gcc.dg/Wcxx-compat-8.c: New testcase. * gcc.dg/c99-tag-1.c: Recognize new "originally defined here" notes * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr39084.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@147358 138bc75d-0d04-0410-961f-82ee72b054a4
2009-04-26 PR c/39556Joseph Myers
* c-tree.h (enum c_inline_static_type): New. (record_inline_static): Declare. * c-decl.c (struct c_inline_static, c_inline_statics, record_inline_static, check_inline_statics): New. (pop_file_scope): Call check_inline_statics. (start_decl): Call record_inline_static instead of pedwarning directly for static in inline function. * c-typeck.c (build_external_ref): Call record_inline_static instead of pedwarning directly for static referenced in inline function. testsuite: * gcc.dg/inline-34.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@146800 138bc75d-0d04-0410-961f-82ee72b054a4
2009-04-222009-04-21 Taras Glek <tglek@mozilla.com>Taras Glek
* include/hashtab.h: Update GTY annotations to new syntax * include/splay-tree.h: Likewise gcc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * alias.c: Update GTY annotations to new syntax * basic-block.h: Likewise * bitmap.h: Likewise * c-common.h: Likewise * c-decl.c: Likewise * c-parser.c: Likewise * c-pragma.c: Likewise * c-tree.h: Likewise * cfgloop.h: Likewise * cgraph.h: Likewise * config/alpha/alpha.c: Likewise * config/arm/arm.h: Likewise * config/avr/avr.h: Likewise * config/bfin/bfin.c: Likewise * config/cris/cris.c: Likewise * config/darwin.c: Likewise * config/frv/frv.c: Likewise * config/i386/i386.c: Likewise * config/i386/i386.h: Likewise * config/i386/winnt.c: Likewise * config/ia64/ia64.h: Likewise * config/iq2000/iq2000.c: Likewise * config/mips/mips.c: Likewise * config/mmix/mmix.h: Likewise * config/pa/pa.c: Likewise * config/pa/pa.h: Likewise * config/rs6000/rs6000.c: Likewise * config/s390/s390.c: Likewise * config/sparc/sparc.c: Likewise * config/xtensa/xtensa.c: Likewise * cselib.h: Likewise * dbxout.c: Likewise * dwarf2out.c: Likewise * except.c: Likewise * except.h: Likewise * fixed-value.h: Likewise * function.c: Likewise * function.h: Likewise * gimple.h: Likewise * integrate.c: Likewise * optabs.c: Likewise * output.h: Likewise * real.h: Likewise * rtl.h: Likewise * stringpool.c: Likewise * tree-data-ref.c: Likewise * tree-flow.h: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-alias.h: Likewise * tree-ssa-operands.h: Likewise * tree.c: Likewise * tree.h: Likewise * varasm.c: Likewise * varray.h: Likewise * vec.h: Likewise * coretypes.h: Do not define GTY macro if it is already defined * doc/gty.texi: Update GTY documentation to new syntax * gengtype-lex.l: Enforce attribute-like syntax for GTY annotations on structs * gengtype-parse.c: Likewise gcc/ada/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * gcc-interface/ada-tree.h: Update GTY annotations to new syntax * gcc-interface/trans.c: Likewise * gcc-interface/utils.c: Likewise gcc/cp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * cp-tree.h: Update GTY annotations to new syntax * decl.c: Likewise * mangle.c: Likewise * name-lookup.c: Likewise * name-lookup.h: Likewise * parser.c: Likewise * pt.c: Likewise * rtti.c: Likewise * semantics.c: Likewise * typeck2.c: Likewise gcc/fortran/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * f95-lang.c: Update GTY annotations to new syntax * trans-intrinsic.c: Likewise * trans-io.c: Likewise * trans.h: Likewise gcc/java/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * builtins.c: Update GTY annotations to new syntax * decl.c: Likewise * java-tree.h: Likewise * jcf.h: Likewise * lang.c: Likewise gcc/objc/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * objc-act.c: Update GTY annotations to new syntax * objc-act.h: Likewise libcpp/ChangeLog 2009-04-21 Taras Glek <tglek@mozilla.com> * include/cpp-id-data.h: Update GTY annotations to new syntax * include/cpplib.h: Likewise * include/line-map.h: Likewise * include/symtab.h: Likewise git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@146607 138bc75d-0d04-0410-961f-82ee72b054a4
2009-04-20gcc/:Ian Lance Taylor
Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@146451 138bc75d-0d04-0410-961f-82ee72b054a4
2009-04-15gcc/:Ian Lance Taylor
* c.opt (Wenum-compare): Enable for C and Objc. Initialize to -1. * c-opts.c (c_common_handle_option): For C, set warn_enum_compare for -Wall and for -Wc++-compat. (c_common_post_options): For C++, set warn_enum_compare if not already set. * c-tree.h (struct c_expr): Add field original_type. (build_external_ref): Update declaration. * c-parser.c (c_parser_braced_init): Set original_type. (c_parser_initelt): Likewise. (c_parser_expr_no_commas): Likewise. (c_parser_conditional_expression): Likewise. (c_parser_cast_expression): Likewise. (c_parser_unary_expression): Likewise. Pull setting of original_code to top of function. (c_parser_sizeof_expression): Set original_type. (c_parser_alignof_expression): Likewise. (c_parser_postfix_expression): Likewise. Pull setting of original_code to top of function. (c_parser_postfix_expression_after_paren_type): Set original_type. (c_parser_postfix_expression_after_primary): Likewise. (c_parser_expression): Likewise. * c-typeck.c (build_external_ref): Add type parameter. Change all callers. (c_expr_sizeof_expr): Set original_type field. (parser_build_unary_op): Likewise. (parser_build_binary_op): Likewise. Optionally warn about comparisons of enums of different types. (digest_init): Set original_type field. (really_start_incremental_init): Likewise. (push_init_level, pop_init_level): Likewise. * doc/invoke.texi (Warning Options): -Wenum-compare now supported in C. gcc/testsuite/: * gcc.dg/Wenum-compare-1.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@146127 138bc75d-0d04-0410-961f-82ee72b054a4