aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
AgeCommit message (Collapse)AuthorFilesLines
2011-03-18c-decl.c (diagnose_mismatched_decls): Give an error for redefining a typedef ↵Joseph Myers1-10/+6
with variably modified type. * c-decl.c (diagnose_mismatched_decls): Give an error for redefining a typedef with variably modified type. testsuite: * gcc.dg/c1x-typedef-1.c: Expect errors for redefinitions of variably modified typedefs. * gcc.dg/c1x-typedef-2.c: Remove. From-SVN: r171172
2011-03-18c-decl.c (grokfield): Don't allow typedefs for structures or unions with no ↵Joseph Myers1-2/+5
tag by default. * c-decl.c (grokfield): Don't allow typedefs for structures or unions with no tag by default. * doc/extend.texi (Unnamed Fields): Update. testsuite: * gcc.dg/c1x-anon-struct-1.c: Don't test use of typedefs. * gcc.dg/c1x-anon-struct-3.c: New test. * gcc.dg/anon-struct-11.c: Update. From-SVN: r171170
2011-01-26re PR tree-optimization/26854 (Inordinate compile times on large routines)Ian Lance Taylor1-45/+74
PR tree-optimization/26854 * c-decl.c (struct c_scope): Add field has_jump_unsafe_decl. (decl_jump_unsafe): Move higher in file, with no other change. (bind): Set has_jump_unsafe_decl if appropriate. (update_label_decls): Test has_jump_unsafe_decl to avoid loop. (check_earlier_gotos): Likewise. (c_check_switch_jump_warnings): Likewise. From-SVN: r169267
2010-12-30re PR c/46889 (Missing diagnosis on duplicate struct member with anonymous ↵Joseph Myers1-4/+2
union) PR c/46889 * c-decl.c (detect_field_duplicates): Ensure hash is used for finding duplicates when first field is anonymous. testsuite: * gcc.dg/anon-struct-15.c: New test. From-SVN: r168348
2010-12-22c-aux-info.c (gen_formal_list_for_type): Use prototype_p.Nathan Froyd1-13/+12
gcc/ * 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. From-SVN: r168181
2010-12-17re PR c/20385 (Lame parse error message for undefined type)Paolo Bonzini1-7/+8
gcc: 2010-12-17 Paolo Bonzini <bonzini@gnu.org> PR c/20385 * function.c (used_types_insert): Handle ERROR_MARK. * c-decl.c (grokdeclarator): Handle ERROR_MARK. (declspecs_add_type): Leave error_mark_node in specs->type. (finish_declspecs): Change it to integer_type_node here. * c-parser.c (c_parser_peek_2nd_token): Move earlier. (enum c_lookahead_kind): New. (c_parser_next_token_starts_typename): New name of c_parser_next_tokens_start_typename. Accept lookahead enum and handle it here instead of... (c_parser_next_tokens_start_declaration): ... here. Call it. (c_parser_declspecs): Accept another argument. Do not exit on C_ID_ID if it is guessed to be an unknown typename. (c_parser_parms_declarator): Use 2nd token to distinguish a K&R declaration from an ANSI declaration starting with an unknown typename. (c_parser_struct_declaration, c_parser_objc_type_name, c_parser_typeof_specifier, c_parser_declarator, c_parser_direct_declarator_inner): Adjust calls. (c_parser_parameter_declaration): Likewise. (c_parser_type_name): Pass back an error_mark_node to the caller. (c_parser_postfix_expression): Do error recovery when c_parser_type_name returns NULL. testsuite: 2010-12-17 Paolo Bonzini <bonzini@gnu.org> PR c/20385 * objc.dg/tls/init-2.m: Adjust. * gcc.dg/noncompile/920923-1.c: Adjust. * gcc.dg/noncompile/pr44517.c: Adjust. * gcc.dg/declspec-18.c: New test. From-SVN: r167999
2010-12-06In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+1
In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * c-family/c-common.h: Removed the declarations of all the objc_ callbacks, and moved them into c-objc.h. Removed objc_ivar_visibility_kind and moved it into c-objc.h. * c-family/c-objc.h: New file. * c-family/c-common.c: Include c-objc.h. * c-family/c-format.c: Same change. * c-family/stub-objc.c: Same change. * c-decl.c: Include c-family/c-objc.h. * c-parser.c: Same change. * c-typeck.c: Same change. * c-config-lang.in (gtfiles): Added c-family/c-objc.h. * Makefile.in (c-decl.o): Depend on c-family/c-objc.h. (c-parser.o): same change. (c-typeck.o): Same change. (c-family/c-format.o): Same change. (c-family/stub-objc.o): Same change. (c-family/c-common.o): Same change. (PLUGIN_HEADERS): Added c-family/c-objc.h. In gcc/cp/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * call.c: Include c-family/c-objc.h. * decl.c: Same change. * decl2.c: Same change. * error.c: Same change. * lex.c: Same change. * parser.c: Same change. * pt.c: Same change. * semantics.c: Same change. * typeck.c: Same change. * Make-lang.in (cp/decl.o): Depend on c-family/c-objc.h. (cp/decl2.o): Same change. (cp/call.o): Same change. (cp/error.o): Same change. (cp/lex.o): Same change. (cp/parser.o): Same change. (cp/pt.o): Same change. (cp/semantics.o): Same change. (cp/typeck.o): Same change. * config-lang.in (gtfiles): Added c-family/c-objc.h. In gcc/objc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c: Include c-family/c-objc.h. * objc-lang.c: Same change. * Make-lang.in (objc/objc-act.o): Depend on c-family/c-objc.h. (objc/objc-lang.o): Same change. * config-lang.in (gtfiles): Added c-family/c-objc.h. In gcc/objcp/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com> * config-lang.in (gtfiles): Added c-family/c-objc.h. * Make-lang.in (objcp/objcp-act.o): Depend on c-family/c-objc.h. (objcp/objcp-lang.o): Same change. (objcp/objcp-decl.o): Same change. * objcp-lang.c: Include c-family/c-objc.h. * objcp-decl.c: Same change. From-SVN: r167481
2010-12-02re PR c/45062 (Revision 162223 caused ICE at c-decl.c:4064)Nathan Froyd1-2/+6
PR c/45062 * c-decl.c (grokparms): Set arg_info->parms to NULL_TREE when !funcdef_flag. From-SVN: r167381
2010-11-30In gcc/c-family/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+3
In gcc/c-family/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * c-common.h (objc_finish_function): New. (objc_non_volatilized_type): Removed. (objc_type_quals_match): Removed. * stub-objc.c (objc_finish_function): New. (objc_non_volatilized_type): Removed. (objc_type_quals_match): Removed. In gcc/objc/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (objc_build_volatilized_type): Removed. (objc_non_volatilized_type): Removed. (objc_type_quals_match): Removed. (local_variables_to_volatilize): New. (objc_volatilize_decl): Add the decl to volatilize to local_variables_to_volatilize, but don't volatilize it yet. (objc_finish_function): New. * objc-act.h (local_variables_to_volatilize): New. In gcc/cp/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * decl.c (finish_function): Call objc_finish_function when compiling Objective-C++. * call.c (standard_conversion): Do not call objc_non_volatilized_type(). (implicit_conversion): Same change. * typeck.c (comp_ptr_ttypes_real): Same change. In gcc/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * c-decl.c (finish_function): Call objc_finish_function in Objective-C. * c-typeck.c (convert_for_assignment): Do not call objc_type_quals_match(). From-SVN: r167318
2010-11-14re PR c/46462 (Revision 166700 caused new C test failures)Paolo Bonzini1-0/+5
2010-11-13 Paolo Bonzini <bonzini@gnu.org> PR c/46462 * c-decl.c (declspecs_add_type): Make variables with error types integers. * c-parser.c (c_parser_next_tokens_start_declaration): Two IDs do not start a declaration before an Objective-C foreach. (c_parser_declaration_or_fndef): Improve recovery after unknown type name. (c_parser_for_statement): Hoist entrance of "foreach context" before ifs, add corresponding reset where it was missing. Do not set objc_could_be_foreach_context for C. From-SVN: r166732
2010-11-13c-tree.h (enum c_typespec_kind): Add ctsk_none.Paolo Bonzini1-8/+9
2010-11-13 Paolo Bonzini <bonzini@gnu.org> * 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. From-SVN: r166699
2010-11-06re PR c/43384 (ICE: Segmentation fault with invalid K&R-like code)Simon Martin1-1/+4
gcc/ 2010-11-16 Simon Martin <simartin@users.sourceforge.net> PR c/43384 * c-decl.c (lookup_label): Labels can only be referenced in a function's scope. (store_parm_decls_oldstyle): Skip erroneous parameters. gcc/testsuite/ 2010-11-16 Simon Martin <simartin@users.sourceforge.net> PR c/43384 * gcc.dg/parser-error-3.c: New test. From-SVN: r166408
2010-11-06re PR c/44772 (-Wc++-compat warns incorrectly for anonymous unions)Jakub Jelinek1-1/+2
PR c/44772 * c-decl.c (warn_cxx_compat_finish_struct): Don't call pointer_set_contains if DECL_NAME is NULL. * gcc.dg/Wcxx-compat-21.c: New test. From-SVN: r166384
2010-10-31tree.h (EXPR_LOC_OR_HERE): New macro.Jason Merrill1-3/+2
* tree.h (EXPR_LOC_OR_HERE): New macro. * builtins.c (c_strlen): Use it. * c-decl.c (build_enumerator): Likewise. * gimplify.c (internal_get_tmp_var): Likewise. (shortcut_cond_expr): Likewise. (gimplify_one_sizepos): Likewise. c-family/ * c-common.c (conversion_warning, warn_for_collisions_1): Use EXPR_LOC_OR_HERE. cp/ * decl.c (pop_switch): Use EXPR_LOC_OR_HERE. * typeck.c (convert_for_assignment): Likewise. From-SVN: r166123
2010-10-20In gcc/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+6
In gcc/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> * c-decl.c (c_write_global_declarations): Call objc_write_global_declarations when compiling Objective-C. * c-lang.c (finish_file): Removed. In gcc/c-family/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> * c-common.h (finish_file): Removed. (objc_write_global_declarations): New. * c-opts.c (c_common_parse_file): Do not call finish_file. * stub-objc.c (objc_write_global_declarations): New. In gcc/cp/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> * cp-lang.c (finish_file): Removed. * decl2.c (cp_write_global_declarations): Call objc_write_global_declarations when compiling Objective-C++. In gcc/objc/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> * objc-lang.c (finish_file): Removed. * objc-act.c (objc_finish_file): Renamed to objc_write_global_declarations. Do not try to instantiate C++ templates when compiling Objective-C++ as this is now automatically done before this function is called. Do not check for syntax-only run or PCH generation as this is done by the callers. * objc-act.h (objc_finish_file): Removed. In gcc/objcp/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> * objcp-lang.c (finish_file): Removed. In gcc/testsuite/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. Test adapted to not require Foundation and run with the GNU runtime as well. 2006-03-13 Fariborz Jahanian <fjahanian@apple.com> Radar 4439126 * obj-c++.dg/template-8.mm: New. From-SVN: r165714
2010-10-17In gcc/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-1/+2
In gcc/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4133425 * c-decl.c (undeclared_variable): Issue diagnostic on private 'ivar' access. In gcc/c-family/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4133425 * c-common.h (objc_diagnose_private_ivar): New decl. * stub-objc.c (objc_diagnose_private_ivar): New stub. In gcc/cp/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from apple/trunk branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4133425 * lex.c (unqualified_name_lookup_error): Issue diagnostic for private 'ivar' access. In gcc/objc/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4133425 * objc-act.c (objc_diagnose_private_ivar): New. In gcc/testsuite/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4133425 * objc.dg/private-1.m: Test modified. * obj-c++.dg/private-1.mm: Test modified. From-SVN: r165601
2010-10-06In gcc/: 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-3/+10
In gcc/: 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. From-SVN: r165019
2010-10-04c-typeck.c (lookup_field): If -fplan9-extensions, permit referring to a ↵Ian Lance Taylor1-8/+75
field using a typedef name. gcc/: * c-typeck.c (lookup_field): If -fplan9-extensions, permit referring to a field using a typedef name. (find_anonymous_field_with_type): New static function. (convert_to_anonymous_field): New static function. (convert_for_assignment): If -fplan9-extensions, permit converting pointer to struct to pointer to anonymous field. * c-decl.c (grokfield): If -fplan9-extensions, permit anonymous fields. (is_duplicate_field): New static function. (detect_field_duplicates_hash): If -fplan9-extensions, check for typedef names duplicating field names. (detect_field_duplicates): Likewise. * doc/invoke.texi (Option Summary): Mention -fplan9-extensions. (C Dialect Options): Document -fplan9-extensions. * doc/extend.texi (Unnamed Fields): Document -fplan9-extensions. gcc/c-family/: * c.opt (-fplan9-extensions): New option. gcc/testsuite/: * gcc.dg/anon-struct-11.c: New test. * gcc.dg/anon-struct-12.c: New test. * gcc.dg/anon-struct-13.c: New test. * gcc.dg/anon-struct-14.c: New test. From-SVN: r164926
2010-09-29In gcc/: 2010-09-29 Nicola Pero <nicola.pero@meta-innovation.com>Nicola Pero1-0/+5
In gcc/: 2010-09-29 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. * c-parser.c: Applied change originally in c-parse.in. 2005-10-04 Fariborz Jahanian <fjahanian@apple.com> Radar 4281748 * c-decl.c (start_decl): Check for redeclaration of class name. * c-parse.in (after_type_declarator): Recognize CLASSNAME. In gcc/c-family/: 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2005-10-04 Fariborz Jahanian <fjahanian@apple.com> Radar 4281748 * c-common.h (objc_check_global_decl): New declaration. * stub-objc.c (objc_check_global_decl): New stub. In gcc/objc/: 2010-09-28 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2005-10-04 Fariborz Jahanian <fjahanian@apple.com> Radar 4281748 * objc-act.c (objc_check_global_decl): New In gcc/testsuite/: 2010-09-28 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2005-10-04 Fariborz Jahanian <fjahanian@apple.com> Radar 4281748 * objc.dg/naming-2.m: Update * objc.dg/naming-3.m: New From-SVN: r164735
2010-09-24c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT.Richard Guenther1-7/+6
2010-09-24 Richard Guenther <rguenther@suse.de> * c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT. Make sure to not call set_type_context with error_mark_node. * langhooks.c (lhd_set_decl_assembler_name): Use DECL_FILE_SCOPE_P. * gcc.dg/lto/20091006-2_0.c: Prune warnings. From-SVN: r164591
2010-09-21re PR objc/25965 (Allows duplicate member names in objc subclasses)Nicola Pero1-0/+11
PR objc/25965 In gcc/objc/: * objc-act.c (objc_get_interface_ivars): New function. (objc_collecting_ivars): New variable. (continue_class): Set and reset objc_collecting_ivars for context. In gcc/: * c-decl.c (detect_field_duplicates): If compiling Objective-C, call objc_get_interface_ivars (). * c-family/c-common.h (objc_get_interface_ivars): New declaration. * c-family/stub-objc.c (objc_get_interface_ivars): New stub. In gcc/objcp/: * objcp-decl.c (objcp_finish_struct): Call objc_get_interface_ivars() and check for duplicate ivars. In gcc/testsuite/: Merge from 'apple/trunk' branch on FSF servers. 2005-10-11 Fariborz Jahanian <fjahanian@apple.com> Radar 4291785 objc.dg/naming-4.m: New objc.dg/naming-5.m: New obj-c++.dg/naming-1.mm: New obj-c++.dg/naming-2.mm: New From-SVN: r164491
2010-09-16tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL is ↵Richard Guenther1-14/+8
TS_TRANSLATION_UNIT_DECL. 2010-09-16 Richard Guenther <rguenther@suse.de> * tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL is TS_TRANSLATION_UNIT_DECL. (initialize_tree_contains_struct): Adjust. (all_translation_units): New global vector. (build_translation_unit_decl): New function. * tree.h (TRANSLATION_UNIT_LANGUAGE): New macro. (struct tree_translation_unit_decl): New. (all_translation_units): Declare. (union tree_node): Add translation_unit_decl member. (build_translation_unit_decl): Declare. * treestruct.def (TS_TRANSLATION_UNIT_DECL): New. * lto-streamer-out.c (pack_ts_translation_unit_decl_value_fields): New function. (pack_value_fields): Call it. (lto_output_tree_ref): Handle references to TRANSLATION_UNIT_DECL. (lto_output_ts_translation_unit_decl_tree_pointers): New function. (lto_output_tree_pointers): Call it. * lto-streamer-in.c (lto_input_tree_ref): Handle references to TRANSLATION_UNIT_DECL. (unpack_ts_translation_unit_decl_value_fields): New function. (unpack_value_fields): Call it. (lto_input_ts_translation_unit_decl_tree_pointers): New function. (lto_input_tree_pointers): Call it. * lto-streamer.c (check_handled_ts_structures): Adjust. * lto-streamer.h (enum LTO_tags): Add LTO_translation_unit_decl_ref. * c-decl.c (all_translation_units): Remove. (pop_scope): Use build_translation_unit_decl. (collect_all_refs): Adjust. (for_each_global_decl): Likewise. (c_write_global_declarations): Likewise. java/ * jcf-parse.c (current_file_list): Remove. (java_parse_file): Use build_translation_unit_decl. Adjust. From-SVN: r164331
2010-09-10tree.c (type_hash_eq): For ARRAY_TYPEs also compare TYPE_SIZE.Richard Guenther1-0/+2
2010-09-10 Richard Guenther <rguenther@suse.de> * tree.c (type_hash_eq): For ARRAY_TYPEs also compare TYPE_SIZE. (build_index_type): Implement in terms of build_range_type. (build_range_type): Do not allow NULL_TREE type, improve hashing to cover more cases. Set TYPE_STRUCTURAL_EQUALITY_P if we didn't hash. * c-decl.c (grokdeclarator): When modifying TYPE_SIZE manually create a distinct copy of the type. From-SVN: r164174
2010-09-08c-tree.h, c-decl.c (build_enumerator): Add location parameter.Arnaud Charlet1-3/+4
* c-tree.h, c-decl.c (build_enumerator): Add location parameter. * c-parser.c (c_parser_enum_specifier): Adjust call to build_enumerator. From-SVN: r163988
2010-08-20vec.h (FOR_EACH_VEC_ELT): Define.Nathan Froyd1-21/+9
gcc/ * vec.h (FOR_EACH_VEC_ELT): Define. * c-decl.c: Use it. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/bfin/bfin.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * dbxout.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * ggc-common.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * ipa-prop.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * lambda-code.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-opts.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-symtab.c: Likewise. * matrix-reorg.c: Likewise. * opts.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-emutls.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-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-live.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-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.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-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Use FOR_EACH_VEC_ELT. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. gcc/c-family/ * c-common.c: Use FOR_EACH_VEC_ELT. * c-gimplify.c: Likewise. * c-pragma.c: Likewise. gcc/cp/ * call.c: Use FOR_EACH_VEC_ELT. * class.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * except.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * repo.c: Likewise. * semantics.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * trans-openmp.c: Use FOR_EACH_VEC_ELT. gcc/java/ * class.c: Use FOR_EACH_VEC_ELT. * expr.c: Likewise. * jcf-parse.c: Likewise. * resource.c: Likewise. gcc/lto/ * lto.c: Use FOR_EACH_VEC_ELT. From-SVN: r163401
2010-08-17re PR c/40563 (-Wc++-compat does not warn about uninitialized const field in ↵Shujing Zhao1-6/+40
struct) /gcc 2010-08-17 Shujing Zhao <pearly.zhao@oracle.com> PR c/40563 * c-decl.c (diagnose_uninitialized_cst_member): New function. (finish_decl): Use it to issue a -Wc++-compat warning about uninitialized const field in struct or union. (finish_struct): Use strip_array_types. /gcc/testsuite 2010-08-17 Shujing Zhao <pearly.zhao@oracle.com> PR c/40563 * gcc.dg/Wcxx-compat-20.c: New test. From-SVN: r163296
2010-08-08c-tree.h (build_arg_info): Declare.Nathan Froyd1-7/+18
* c-tree.h (build_arg_info): Declare. * 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. From-SVN: r163014
2010-08-08c-tree.h (c_arg_tag): Define.Nathan Froyd1-10/+14
* c-tree.h (c_arg_tag): Define. Define a VEC containing it. (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. From-SVN: r163013
2010-07-16c-decl.c (detect_field_duplicates): Use DECL_CHAIN insted of TREE_CHAIN.Nathan Froyd1-2/+1
* c-decl.c (detect_field_duplicates): Use DECL_CHAIN insted of TREE_CHAIN. * c-typeck.c (push_init_level): Likewise. (process_init_element): Likewise. From-SVN: r162239
2010-07-15tree.h (DECL_CHAIN): Define.Nathan Froyd1-40/+41
gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-13c-decl.c (finish_function): Fix typo in comment.Manuel López-Ibáñez1-1/+1
2010-07-13 Manuel López-Ibáñez <manu@gcc.gnu.org> * c-decl.c (finish_function): Fix typo in comment. From-SVN: r162121
2010-06-19c-decl.c (c_write_global_declarations): Don't check flag_syntax_only.Philip Herron1-5/+0
2010-06-19 Philip Herron <herron.philip@googlemail.com> * c-decl.c (c_write_global_declarations): Don't check flag_syntax_only. From-SVN: r161024
2010-06-08utils.c (init_gnat_to_gnu): Use typed GC allocation.Laurynas Biveinis1-10/+10
gcc/ada: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. From-SVN: r160425
2010-06-06re PR c/20000 (missing warning for noreturn function returning non-void)Manuel López-Ibáñez1-6/+0
2010-06-06 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/20000 * c-decl.c (grokdeclarator): Delete warning. testsuite/ * c-c++-common/pr20000.c: New. From-SVN: r160346
2010-06-05c-common.c: Move to c-family/.Steven Bosscher1-3/+3
gcc/ChangeLog: * 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. From-SVN: r160330
2010-06-01invoke.texi: Mention -fdump-ada-spec.Arnaud Charlet1-0/+50
* doc/invoke.texi: Mention -fdump-ada-spec. * tree-dump.c (dump_files): Add ada-spec. (FIRST_AUTO_NUMBERED_DUMP): Bump to 8. * tree-pass.h (tree_dump_index): Add TDI_ada. * gcc.c: Add support for -C without -E and for -fdump-ada-spec. (cpp_unique_options): Do not reject -C or -CC when -E isn't present. (default_compilers) <@c-header>: Allow -fdump-ada-spec on header files. * c-decl.c: Include c-ada-spec.h. (collect_source_ref_cb, collect_all_refs, for_each_global_decl): New functions. (c_write_global_declarations): Add handling of -fdump-ada-spec. * c-lex.c (c_lex_with_flags): Add handling of CPP_COMMENT. * Makefile.in (C_AND_OBJC_OBJS): Add c-ada-spec.o. * c-ada-spec.h, c-ada-spec.c: New files. Co-Authored-By: Matthew Gingell <gingell@adacore.com> From-SVN: r160100
2010-05-28c-common.h: Add FIXME for awkward split of c_register_addr_space.Steven Bosscher1-0/+19
gcc/ChangeLog: * c-common.h: Add FIXME for awkward split of c_register_addr_space. * c-common.c (c_register_addr_space): Remove here. * c-decl.c (c_register_addr_space): Re-add here. cp/ChangeLog: * tree.c (c_register_addr_space): Add stub. From-SVN: r160006
2010-05-27diagnostic-core.h: New.Joseph Myers1-3/+3
* diagnostic-core.h: New. Contents moved from diagnostic.h and toplev.h. * diagnostic.c: Don't include toplev.h. (progname): Define. Moved from toplev.c. (seen_error): New function. * diagnostic.h: Include diagnostic-core.h. (diagnostic_t, emit_diagnostic): Don't declare here. * toplev.c (progname): Move to toplev.c. (emit_debug_global_declarations, compile_file, finalize, do_compile, toplev_main): Use seen_error. * toplev.h: Include diagnostic-core.h. (trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG, internal_error, warning, warning_at, error, error_n, error_at, fatal_error, pedwarn, permerror, sorry, inform, inform_n, verbatim, fnotice, progname): Move to diagnostic-core.h. * builtins.c: Include diagnostic-core.h instead of diagnostic.h. (expand_builtin_expect): Use seen_error. * c-decl.c: Include diagnostic-core.h instead of diagnostic.h. (c_make_fname_decl, c_write_global_declarations): Use seen_error. * c-format.c: Include diagnostic-core.h instead of diagnostic.h. * c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h. * c-lang.c: Include diagnostic-core.h instead of diagnostic.h. * c-lex.c (c_lex_with_flags, interpret_float): Don't increment errorcount for errors. * c-opts.c (c_common_finish): Use seen_error. * cgraph.c: Include diagnostic-core.h instead of diagnostic.h. * cgraphunit.c (verify_cgraph_node, verify_cgraph, cgraph_output_pending_asms, cgraph_optimize): Use seen_error. * coverage.c: Include diagnostic-core.h instead of diagnostic.h. (get_coverage_counts): Use seen_error. * dwarf2out.c (dwarf2out_finish): Use seen_error. * gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup, gimplify_body): Use seen_error. * ipa-inline.c (cgraph_early_inlining): Use seen_error. * ipa-pure-const.c (gate_pure_const): Use seen_error. * ipa-reference.c (gate_reference): Use seen_error. * jump.c: Include diagnostic-core.h instead of diagnostic.h. * lambda-code.c: Include diagnostic-core.h instead of diagnostic.h. * lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h. * lto-compress.c: Include diagnostic-core.h instead of diagnostic.h. * lto-section-in.c: Include diagnostic-core.h instead of diagnostic.h. * lto-streamer-out.c: Include diagnostic-core.h instead of diagnostic.h. * lto-streamer.c: Include diagnostic-core.h instead of diagnostic.h. (gate_lto_out): Use seen_error. * matrix-reorg.c: Include diagnostic-core.h instead of diagnostic.h. * omega.c: Include diagnostic-core.h instead of diagnostic.h. * omp-low.c: Include diagnostic-core.h instead of diagnostic.h. (gate_expand_omp, lower_omp_1): Use seen_error. * passes.c: Include diagnostic-core.h instead of diagnostic.h. (rest_of_decl_compilation, rest_of_type_compilation, gate_rest_of_compilation, ipa_write_summaries): Use seen_error. * tree-cfg.c (label_to_block_fn): Use seen_error. * tree-inline.c (optimize_inline_calls): Use seen_error. * tree-mudflap.c (mudflap_finish_file): Use seen_error. * tree-optimize.c (gate_all_optimizations, gate_all_early_local_passes, gate_all_early_optimizations): Use seen_error. * tree-ssa-structalias.c (gate_ipa_pta): Use seen_error. * varpool.c: Include diagnostic-core.h instead of diagnostic.h. (varpool_remove_unreferenced_decls, varpool_assemble_pending_decls): Use seen_error. * Makefile.in (DIAGNOSTIC_CORE_H): Define. (TOPLEV_H, DIAGNOSTIC_H): Update. (c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o, lto-streamer-out.o, lto-section-in.o, lto-streamer.o, c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o, builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o, coverage.o, lambda-code.o): Update dependencies. cp: * call.c: Include diagnostic-core.h instead of diagnostic.h. * cp-lang.c: Don't include diagnostic.h * name-lookup.c: Include diagnostic-core.h instead of diagnostic.h. (cp_emit_debug_info_for_using): Use seen_error. * optimize.c: Include diagnostic-core.h instead of diagnostic.h. * parser.c: Include diagnostic-core.h instead of diagnostic.h. * pt.c (iterative_hash_template_arg): Use seen_error. * repo.c: Include diagnostic-core.h instead of diagnostic.h. * typeck2.c: Include diagnostic-core.h instead of diagnostic.h. * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o, cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update dependencies. lto: * lto.c: Include diagnostic-core.h instead of diagnostic.h. (read_cgraph_and_symbols, lto_main): Use seen_error. * Make-lang.in (lto/lto.o): Update dependencies. objc: * objc-act.c: Include diagnostic-core.h instead of diagnostic.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r159947
2010-05-26demangle-expected: Add tests for __int128 and unsigned __int128 types.Kai Tietz1-2/+54
libiberty/ 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. From-SVN: r159879
2010-05-26rtl.h (decl_default_tls_model): Move prototype from here...Steven Bosscher1-1/+0
gcc/ChangeLog: * rtl.h (decl_default_tls_model): Move prototype from here... * output.h: ...to here. * c-decl.c: Do not include rtl.h. * c-pragma.c: Likewise. * c-parser.c: Likewise. * c-gimplify.c: Likewise. And also not hard-reg-set. * c-common.c: Do not include rtl.h. Include tm_p.h and add a FIXME note for it. Add a FIXME note for expr.h. * config/i386/i386-protos.h (ix86_enum_va_list, ix86_fn_abi_va_list, ix86_canonical_va_list_type): Make visible even if RTX_CODE is not defined. cp/ChangeLog: * decl.c: Do not include rtl.h * semantics.c: Likewise. ada/ChangeLog: * gcc-interface/utils.c: Do not include rtl.h. fortran/ChangeLog: * trans-common.c: Do not include rtl.h, include output.h instead. * trans-decl.c: Likewise. From-SVN: r159856
2010-05-23c-decl.c (diagnose_mismatched_decls): Give error for duplicate typedefs with ↵Joseph Myers1-4/+34
different but compatible types. * c-decl.c (diagnose_mismatched_decls): Give error for duplicate 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. From-SVN: r159767
2010-05-16c-decl.c: Don't include gimple.h.Steven Bosscher1-5/+0
* c-decl.c: Don't include gimple.h. (merge_decls): Do not copy gimple_body. From-SVN: r159451
2010-05-15vecir.h: New file with VEC primitives for tree, gimple, and rtl.Steven Bosscher1-6/+1
gcc/ChangeLog * vecir.h: New file with VEC primitives for tree, gimple, and rtl. * Makefile.in: Add it. Fix all other Makefile dependencies for changes below. * tree.h: Include it instead of defining VEC primitives here. * gimple.h: Likewise. * rtl.h: Likewise. * tree-inline.h: Inlclude vecir.h instead of gimple.h. * except.h: Include vecir.h, break dependence on tree.h. * gimplify.c (append_to_statement_list_1, append_to_statement_list): Move from here... * tree-iterator.c: ...to here. * tree-iterator.h: Fix file introduction comment. Add extern markers. * c-lex.c: Include fixed-value.h instead of rtl.h. Do not include tm_p.h. * c-cppbuiltin.c: Explain why debug.h and tm_p.h are included. * c-objc-common.h: Do not include tm.h, rtl.h, insn-config.h, integrate.h, function.h, toplev.h, tree-inline.h, ggc.h, tree-mudflap.h, and target.h. * c-semantics.c: Do not include except.h, ggc.h, rtl.h, timevar.h, predict.h, tree-inline.h, gimple.h, and langhooks.h. * c-decl.c: Do not include expr.h, ggc.h, libfuncs.h, except.h. Add FIXME for why gimple.h is still included (should be unnecessary since GCC 4.5 gimplification unit-at-a-time). * c-typeck.c: Do not include rtl.h, tm_p.h, ggc.h, and gimple.h. * c-pragma.c: Add FIXME for why function.h needs to be included just for cfun, at front-end level. Add note that REGISTER_TARGET_PRAGMAS should probably be a target hook. Do not include ggc.h, but include vecprim.h for VEC(char). * c-opts.c: Do not include tm.h, tree-inline.h, and tm_p.h. Explain why target.h is included. * c-omp.h: Do not include tm.h, function.h, and bitmap.h. Explain why gimple.h is included. * c-ppoutput.c: Do not include tm.h. * c-common.c: Do not include gimple.h. Explain why expr.h is included. * c-parses.c: Explain why rtl.h is included, and that this (and only this) is also why tm.h must be included. Do not include except.h. * c-lang.c: Do not include ggc.h. cp/ChangeLog * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes. * Make-lang.in: Fix dependencies accordingly. From-SVN: r159442
2010-05-15c-decl.c (grokfield): Allow typedefs for anonymous structs and unions by ↵Joseph Myers1-9/+24
default if... * c-decl.c (grokfield): Allow typedefs for anonymous structs and unions by default if those structs and unions have no tags. Do not condition anonymous struct and unions handling on flag_iso. Allow anonymous structs and unions for C1X. (finish_struct): Do not diagnose lack of named fields when anonymous structs and unions present for C1X. Accept flexible array members in structure with anonymous structs or unions but no directly named fields. * doc/extend.texi (Unnamed Fields): Update. testsuite: * gcc.dg/c1x-anon-struct-1.c, gcc.dg/c1x-anon-struct-2.c, gcc.dg/c90-anon-struct-1.c, gcc.dg/c99-anon-struct-1.c: New tests. * gcc.dg/20080820.c, gcc.dg/anon-struct-1.c: Update expected diagnostics and type sizes. From-SVN: r159439
2010-05-09re PR c/4784 (Anonymous structs issues)Joseph Myers1-15/+33
PR c/4784 * c-decl.c (detect_field_duplicates_hash): New. Handle anonymous structures and unions recursively. (detect_field_duplicates): Move duplicate detection with a hash to detect_field_duplicates_hash. Always use a hash if anonymous structures or unions are present. * doc/extend.texi (Unnamed Fields): Document that duplicate fields give errors. testsuite: * gcc.dg/anon-struct-9.c: New test. From-SVN: r159204
2010-05-05stor-layout.c (pending_sizes): Change the type to VEC(tree,gc) *.Steven Bosscher1-2/+5
* stor-layout.c (pending_sizes): Change the type to 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. From-SVN: r159085
2010-04-18fold-const.c (fold_comparison): Use ssizetype.Eric Botcazou1-1/+1
2010-04-18  Eric Botcazou  <ebotcazou@adacore.com> * fold-const.c (fold_comparison): Use ssizetype. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Use sizetype. * tree-loop-distribution.c (build_size_arg_loc): Likewise. * tree-object-size.c (compute_object_sizes): Use size_type_node. * tree.h (initialize_sizetypes): Remove parameter. (build_common_tree_nodes): Remove second parameter. * stor-layout.c (initialize_sizetypes): Remove parameter. Always create an unsigned type. (set_sizetype): Assert that the passed type is unsigned and simplify. * tree.c (build_common_tree_nodes): Remove second parameter. Adjust call to initialize_sizetypes. * c-decl.c (c_init_decl_processing): Remove second argument in call to build_common_tree_nodes. cp/ * decl.c (cxx_init_decl_processing): Remove second argument in call to build_common_tree_nodes. java/ * decl.c (java_init_decl_processing): Remove argument in call to initialize_sizetypes fortran/ * f95-lang.c (gfc_init_decl_processing): Remove second argument in call to build_common_tree_nodes. ada/ * gcc-interface/misc.c (gnat_init): Remove second argument in call to build_common_tree_nodes. lto/ * lto-lang.c (lto_init): Remove second argument in call to build_common_tree_nodes. From-SVN: r158496
2010-04-12re PR c/36774 (-Wmissing-prototypes triggers on nested functions)Shujing Zhao1-4/+4
gcc/ 2010-04-12 Shujing Zhao <pearly.zhao@oracle.com> PR c/36774 * c-decl.c (start_function): Move forward check for nested function. gcc/testsuite/ 2010-04-12 Shujing Zhao <pearly.zhao@oracle.com> PR c/36774 * gcc.dg/pr36774-1.c: New test. * gcc.dg/pr36774-2.c: New test. From-SVN: r158214
2010-04-07re PR c/18624 (GCC does not detect local variable set but never used)Jakub Jelinek1-3/+36
PR c/18624 * 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. From-SVN: r158086
2010-03-26re PR c/43381 (infinite loop in gcc.dg/parm-impl-decl-1.c with -g)Joseph Myers1-1/+8
PR c/43381 * c-decl.c (get_parm_info): Assert that decl going in OTHERS has a nested binding iff it is a FUNCTION_DECL. (store_parm_decls_newstyle): Pass nested=true to bind for FUNCTION_DECLs amongst parameters. testsuite: * gcc.dg/parm-impl-decl-3.c: New test. From-SVN: r157766