backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion). As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch changes the default bootstrap process so that stage 1 always builds with a C++ compiler. Other than the bootstrap change, the patch makes no functional changes to the compiler. Everything should build as it does now in trunk. The main changes in this patch are: 1- Configuration changes. 2- Re-write of VEC. 3- Re-write of gengtype to support C++ templates and user-provided marking functions. 4- New hash table class. 5- Re-write double_int. 6- Implement tree macros as inline functions so they can be called from gdb. As discussed before, several of these changes do not fully change the call sites to use the new APIs. The bootstrap changes have already been tested on a wide range of targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally, I have tested the merged trunk on: x86_64-unknown-linux-gnu, mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu, i686-pc-linux-gnu, and ia64-unknown-linux-gnu. ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. * Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove POSTSTAGE1_CONFIGURE_FLAGS. * Makefile.in: Regenerate. * configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users. Force C++ when bootstrapping. * configure: Regenerate. libcpp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure.ac: Likewise. * configure: Regenerate. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. New C++ hash table. * include/symtab.h (typedef struct ht hash_table): Change the typedef name to cpp_hash_table. Update all users of the typedef. gcc/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define. Remove all handlers of ENABLE_BUILD_WITH_CXX. Force all build to be with C++. * Makefile.in (BUILD_CXXFLAGS): Use it. Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi: Remove documentation for --enable-build-with-cxx and --enable-build-poststage1-with-cxx. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-implement VEC in C++. * vec.c (vec_heap_free): Convert into a template function. (vec_gc_o_reserve_1): Make extern. (vec_gc_p_reserve): Remove. (vec_gc_p_reserve_exact): Remove. (vec_gc_o_reserve): Remove. (vec_gc_o_reserve_exact): Remove. (vec_heap_o_reserve_1): Make extern. (vec_heap_p_reserve): Remove. (vec_heap_p_reserve_exact): Remove. (vec_heap_o_reserve): Remove. (vec_heap_o_reserve_exact): Remove. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. * vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS, VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier in the file. (VEC): Define to vec_t<T>. (vec_allocation_t): Define. (struct vec_prefix): Move earlier in the file. (vec_t<T>): New template. (DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O, DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK, DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'. (DEF_VEC_A): Provide template instantiations for GC/PCH markers that do not traverse the vector. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (vec_stack_free): Re-write as a template function. (vec_reserve): New template function. (vec_reserve_exact): New template function. (vec_heap_free): New template function if GATHER_STATISTICS is defined. Otherwise, macro that expands to free(). (VEC_length_1): New template function. (VEC_length): Call it. (VEC_empty_1): New template function. (VEC_empty): Call it. (VEC_address_1): New template function. (VEC_address): Call it. (VEC_last_1): New template function. (VEC_last): Call it. Change return type to T&. Change all users that used VEC_Os. (VEC_index_1): New template function. (VEC_index): Call it. Return a T& instead of a T*. Update all callers that were using VEC_O before. (VEC_iterate_1): New template function. (VEC_iterate): Call it. (VEC_embedded_size_1): New template function. (VEC_embedded_size): Call it. (VEC_embedded_init_1): New template function. (VEC_embedded_init): Call it. (VEC_alloc_1): New template function. (VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to do the allocation. (VEC_free_1): New template function. (VEC_free): Call it. (VEC_copy_1): New template function. (VEC_copy): Call it. (VEC_space_1): New template function (VEC_space): Call it. (VEC_reserve_1): New template function. (VEC_reserve): Call it. (VEC_reserve_exact_1): New template function. (VEC_reserve_exact): Call it. (VEC_splice_1): New template function. (VEC_splice): Call it. (VEC_safe_splice_1): New template function. (VEC_safe_splice): Call it. (VEC_quick_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_quick_push): Call it. (VEC_safe_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_safe_push): Call it. (VEC_pop_1): New template function. (VEC_pop): Call it. (VEC_truncate_1): New template function. (VEC_truncate): Call it. (VEC_safe_grow_1): New template function. (VEC_safe_grow): Call it. (VEC_safe_grow_cleared_1): New template function. (VEC_safe_grow_cleared): Call it. (VEC_replace_1): New template function. (VEC_replace): Call it. Always accept T instead of T*. Update all callers that used VEC_Os. (VEC_quick_insert_1): New template function. (VEC_quick_insert): Call it. (VEC_safe_insert_1): New template function. (VEC_safe_insert): Call it. (VEC_ordered_remove_1): New template function. (VEC_ordered_remove): Call it. (VEC_unordered_remove_1): New template function. (VEC_unordered_remove): Call it. (VEC_block_remove_1): New template function. (VEC_block_remove): Call it. (VEC_lower_bound_1): New template function. (VEC_lower_bound): Call it. (VEC_OP): Remove. (DEF_VEC_FUNC_P): Remove. (DEF_VEC_ALLOC_FUNC_P): Remove. (DEF_VEC_NONALLOC_FUNCS_P): Remove. (DEF_VEC_FUNC_O): Remove. (DEF_VEC_ALLOC_FUNC_O): Remove. (DEF_VEC_NONALLOC_FUNCS_O): Remove. (DEF_VEC_ALLOC_FUNC_I): Remove. (DEF_VEC_NONALLOC_FUNCS_I): Remove. (DEF_VEC_ALLOC_FUNC_P_STACK): Remove. (DEF_VEC_ALLOC_FUNC_O_STACK): Remove. (DEF_VEC_ALLOC_FUNC_I_STACK): Remove. (vec_reserve_exact): New template function. * gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove. * gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP]. (typedef_name): Emit vec_t<C1> instead of VEC_C1_C2. (def_vec_alloc): Remove. Update all callers. * gengtype.c (filter_type_name): New. (output_mangled_typename): Call it. (write_func_for_structure): Likewise. (write_types): Likewise. (write_root): Likewise. (write_typed_alloc_def): Likewise. (note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base. (note_def_vec_alloc): Remove. * gengtype.h (note_def_vec_alloc): Remove. (DEFVEC_ALLOC): Remove token code. * df-scan.c (df_bb_verify): Remove call to df_free_collection_rec inside the insn traversal loop. * gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK. * ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP. * reg-stack.c (stack): Rename to STACK_PTR. Update all users. * tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users. * config/bfin/bfin.c (hwloop_optimize): Update some calls to VEC_* for vectors of non-pointers. * config/c6x/c6x.c (try_rename_operands): Likewise. (reshuffle_units): Likewise. * config/mips/mips.c (mips_multi_start): Likewise. (mips_multi_add): Likewise. (mips_multi_copy_insn): Likewise. (mips_multi_set_operand): Likewise. * hw-doloop.c (discover_loop): Likewise. (discover_loops): Likewise. (reorg_loops): Likewise. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. C++ support in gengtype. * coretypes.h (gt_pointer_operator): Move from ... * ggc.h: ... here. * doc/gty.texi: Document support for C++ templates and user-provided markers. * gcc/gengtype-lex.l: Update copyright year. Remove support for recognizing DEF_VEC_O, DEF_VEC_P and DEFVEC_I. * gengtype-parse.c: Update copyright year. (token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I. (require_template_declaration): New. (typedef_name): Call it. (type): Replace IS_UNION with KIND. Replace all users. (def_vec): Remove. Update all users. * gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT. (write_state_user_struct_type): New. (write_state_type): Call it. (read_state_user_struct_type): New. (read_state_type): Call it. * gengtype.c: Update copyright year. (dump_pair): Move declaration to the top. (dump_type): Likewise. (dump_type_list): Likewise. (dbgprint_count_type_at): Handle TYPE_USER_STRUCT. (create_user_defined_type): New. (resolve_typedef): Call it. (new_structure): Replace argument ISUNION with KIND. Change users to refer to KIND directly. Update all callers. (find_structure): Likewise. (set_gc_used_type): Handle TYPE_USER_STRUCT. (create_file): Update HDR to include new copyright year. (struct walk_type_data): Add field IN_PTR_FIELD. (output_mangled_typename): Handle TYPE_USER_STRUCT. (walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER. Clear it afterwards. Handle TYPE_USER_STRUCT. (write_types_process_field): Handle TYPE_USER_STRUCT. (get_type_specifier): Move earlier in the file. (write_type_decl): New. (write_marker_function_name): New. (write_user_func_for_structure_ptr): New. (write_user_func_for_structure_body): New. (write_user_marking_functions): New. (write_func_for_structure): Call write_marker_function_name and write_type_decl. Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user function directly. Call write_user_marking_functions on TYPE_USER_STRUCTs. (write_types_local_user_process_field): New. (write_pch_user_walking_for_structure_body): New. (write_pch_user_walking_functions): New. (write_types_local_process_field): Handle TYPE_USER_STRUCT. (write_local_func_for_structure): Do not call walk_type for TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly. Call write_pch_user_walking_functions for TYPE_USER_STRUCTs. (write_root): Handle TYPE_USER_STRUCT. (vec_prefix_type): Remove. Update all users. (note_def_vec): Remove. Update all users. (dump_typekind): Handle TYPE_USER_STRUCT. (dump_type): Initialize SEEN_TYPES, if needed. Handle TYPE_USER_STRUCT. (dump_everything): Do not initialize SEEN_TYPES. * gengtype.h: Update copyright year. (enum typekind): Add TYPE_USER_STRUCT. (union_or_struct_p): Rename from UNION_OR_STRUCT_P. Convert into function. Add an overload taking const_type_p. Update all callers. (new_structure): Change second field to type enum typekind. Update all users. (find_structure): Likewise. (note_def_vec): Remove. (DEFVEC_OP): Remove. (DEFVEC_I): Remove. * ggc-page.c (gt_ggc_mx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. * ggc-zone.c (gt_ggc_mx): Add entry points for marking 'const char *&' and 'unsigned char *&'. * stringpool.c (gt_pch_nx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. Add an entry point for the overload taking arguments 'unsigned char *', 'gt_pointer_operator' and 'void *'. * vec.h (struct vec_prefix): Remove GTY marker. (struct vec_t): Remove GTY((length)) attribute from field 'vec'. (gt_ggc_mx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template function. (gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template function. * basic-block.h (struct edge_def): Mark GTY((user)). Remove all GTY markers from fields. (gt_ggc_mx): Declare. (gt_pch_nx): Declare. * tree-cfg.c (gt_ggc_mx): New. (gt_pch_nx): New. * gengtype-lex.l (USER_GTY): Add pattern for "user". * gengtype-parse.c (option): Handle USER_GTY. (opts_have): New. (type): Call it. If the keyword 'user' is used, do not walk the fields of the structure. * gengtype.h (USER_GTY): Add. * doc/gty.texi: Update. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Implement C++ hash table. * hash-table.h: New. Implementation borrowed from libiberty/hashtab.c. * hash-table.c: Likewise. * tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h. (static htab_t same_succ_htab): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (same_succ_print_traverse): Make extern ssa_.... Change callers. Remove void* casting. (same_succ_hash): Likewise. (same_succ_equal): Likewise. (same_succ_delete): Likewise. * tree-ssa-threadupdate.c: Include hash-table.h. (struct local_info): Rename to ssa_local_info_t to avoid overloading the type name local_info with the variable name local_info. (static htab_t redirection_data): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (redirection_data_hash): Make extern ssa_.... Change callers. Remove void* casting. (redirection_data_eq): Likewise. (fix_duplicate_block_edges): Likewise. (create_duplicates): Likewise. (fixup_template_block): Likewise. (redirect_edges): Likewise. (lookup_redirection_data): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. * tree-ssa-ccp.c: Include hash-table.h. (typedef gimple_htab): New. Uses hash_table. Replace specific uses of htab_t with gimple_htab. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h. (hash_ssa_name_by_var): Make extern. Remove void* casting. (eq_ssa_name_by_var): Likewise. (coalesce_ssa_name): Change type of local static htab_t ssa_name_hash to hash_table. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * coverage.c: Include hash-table.h instead of hashtab.h. (static htab_t counts_hash): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (htab_counts_entry_hash): Make extern. Rename with coverage_... instead of htab_... Remove void* casting. (htab_counts_entry_eq): Likewise. (htab_counts_entry_del): Likewise. * tree-ssa-pre.c: Include hash-table.h instead of hashtab.h. (static htab_t expression_to_id): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (static htab_t phi_translate_table): Likewise. (pre_expr_eq): Make extern ssa_.... Change callers. Remove void* casting. (pre_expr_hash): Likewise. (expr_pred_trans_hash): Likewise. (expr_pred_trans_eq): Likewise. (alloc_expression_id): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. (lookup_expression_id): Likewise. (phi_trans_lookup): Likewise. (phi_trans_add): Likewise. * stringpool.c: Rename uses of libcpp typedef hash_table to cpp_hash_table. * Makefile.in: Add hash-table.o to OBJS-libcommon-target. Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H). 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. Re-write double_int in C++. * hash-table.h (typedef double_int): Change to struct (POD). (double_int::make): New overloads for int to double-int conversion. (double_int::mask): New. (double_int::max_value): New. (double_int::min_value): New. (double_int::operator ++): New. (double_int::operator --): New. (double_int::operator *=): New. (double_int::operator +=): New. (double_int::operator -=): New. (double_int::to_signed): New. (double_int::to_unsigned): New. (double_int::fits_unsigned): New. (double_int::fits_signed): New. (double_int::fits): New. (double_int::trailing_zeros): New. (double_int::popcount): New. (double_int::multiple_of): New. (double_int::set_bit): New. (double_int::mul_with_sign): New. (double_int::operator * (binary)): New. (double_int::operator + (binary)): New. (double_int::operator - (binary)): New. (double_int::operator - (unary)): New. (double_int::operator ~ (unary)): New. (double_int::operator & (binary)): New. (double_int::operator | (binary)): New. (double_int::operator ^ (binary)): New. (double_int::and_not): New. (double_int::lshift): New. (double_int::rshift): New. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::lrotate): New. (double_int::rrotate): New. (double_int::div): New. (double_int::sdiv): New. (double_int::udiv): New. (double_int::mod): New. (double_int::smod): New. (double_int::umod): New. (double_int::divmod): New. (double_int::sdivmod): New. (double_int::udivmod): New. (double_int::ext): New. (double_int::zext): New. (double_int::sext): New. (double_int::is_zero): New. (double_int::is_one): New. (double_int::is_minus_one): New. (double_int::is_negative): New. (double_int::cmp): New. (double_int::ucmp): New. (double_int::scmp): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int::max): New. (double_int::smax): New. (double_int::umax): New. (double_int::min): New. (double_int::smin): New. (double_int::umin): New. (double_int::operator ==): New. (double_int::operator !=): New. (shwi_to_double_int): Change implementation to use member function. (double_int_minus_one): Likewise. (double_int_zero): Likewise. (double_int_one): Likewise. (double_int_two): Likewise. (double_int_ten): Likewise. (uhwi_to_double_int): Likewise. (double_int_to_shwi): Likewise. (double_int_to_uhwi): Likewise. (double_int_fits_in_uhwi_p): Likewise. (double_int_fits_in_shwi_p): Likewise. (double_int_fits_in_hwi_p): Likewise. (double_int_mul): Likewise. (double_int_mul_with_sign): Likewise. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_multiple_of): Likewise. (double_int_setbit): Likewise. (double_int_ctz): Likewise. (double_int_not): Likewise. (double_int_ior): Likewise. (double_int_and): Likewise. (double_int_and_not): Likewise. (double_int_xor): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_scmp): Likewise. (double_int_ucmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_ext): Likewise. (double_int_sext): Likewise. (double_int_zext): Likewise. (double_int_mask): Likewise. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_zero_p): Likewise. (double_int_one_p): Likewise. (double_int_minus_one_p): Likewise. (double_int_equal_p): Likewise. (double_int_popcount): Likewise. * hash-table.c (double_int_mask): Reuse implementation for double_int::mask. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_ext): Likewise. (double_int_zext): Likewise. (double_int_sext): Likewise. (double_int_mul_with_sign): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_multiple_of): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_ucmp): Likewise. (double_int_scmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int_setbit): Reuse implementation for double_int::set_bit, which avoids a name conflict with a macro. (double_int_double_int_ctz): Reuse implementation for double_int::trailing_zeros. (double_int_fits_in_shwi_p): Reuse implementation for double_int::fits_signed. (double_int_fits_in_hwi_p): Reuse implementation for double_int::fits. (double_int_mul): Reuse implementation for binary double_int::operator *. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Reuse implementation for unary double_int::operator -. (double_int_max_value): Likewise. * fixed-value.c: Change to use member functions introduced above. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Support tree macro calling from gdb. * tree.h (tree_check): New. (TREE_CHECK): Use inline function above instead of __extension__. (tree_not_check): New. (TREE_NOT_CHECK): Use inline function above instead of __extension__. (tree_check2): New. (TREE_CHECK2): Use inline function above instead of __extension__. (tree_not_check2): New. (TREE_NOT_CHECK2): Use inline function above instead of __extension__. (tree_check3): New. (TREE_CHECK3): Use inline function above instead of __extension__. (tree_not_check3): New. (TREE_NOT_CHECK3): Use inline function above instead of __extension__. (tree_check4): New. (TREE_CHECK4): Use inline function above instead of __extension__. (tree_not_check4): New. (TREE_NOT_CHECK4): Use inline function above instead of __extension__. (tree_check5): New. (TREE_CHECK5): Use inline function above instead of __extension__. (tree_not_check5): New. (TREE_NOT_CHECK5): Use inline function above instead of __extension__. (contains_struct_check): New. (CONTAINS_STRUCT_CHECK): Use inline function above instead of __extension__. (tree_class_check): New. (TREE_CLASS_CHECK): Use inline function above instead of __extension__. (tree_range_check): New. (TREE_RANGE_CHECK): Use inline function above instead of __extension__. (omp_clause_subcode_check): New. (OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of __extension__. (omp_clause_range_check): New. (OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of __extension__. (expr_check): New. (EXPR_CHECK): Use inline function above instead of __extension__. (non_type_check): New. (NON_TYPE_CHECK): Use inline function above instead of __extension__. (tree_vec_elt_check): New. (TREE_VEC_ELT_CHECK): Use inline function above instead of __extension__. (omp_clause_elt_check): New. (OMP_CLAUSE_ELT_CHECK): Use inline function above instead of __extension__. (tree_operand_check): New. (TREE_OPERAND_CHECK): Use inline function above instead of __extension__. (tree_operand_check_code): New. (TREE_OPERAND_CHECK_CODE): Use inline function above instead of __extension__. (TREE_CHAIN): Simplify implementation. (TREE_TYPE): Simplify implementation. (tree_operand_length): Move for compilation dependences. * gdbinit.in: (macro define __FILE__): New. (macro define __LINE__): New. (skip "tree.h"): New. gcc/cp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-write VEC in C++. * call.c (add_function_candidate): Remove const qualifier from call to VEC_index. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX. * go-gcc.cc: Likewise. * go-system.h: Likewise. From-SVN: r190402
This commit is contained in:
parent
4ce8f1176c
commit
0823efedd0
126 changed files with 5732 additions and 3645 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch.
|
||||
|
||||
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
|
||||
POSTSTAGE1_CONFIGURE_FLAGS.
|
||||
* Makefile.in: Regenerate.
|
||||
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
|
||||
Force C++ when bootstrapping.
|
||||
* configure: Regenerate.
|
||||
|
||||
2012-07-24 Jan-Benedict Glaw <jbglaw@lug-owl.de>
|
||||
|
||||
* MAINTAINERS (Write After Approval): Add myself.
|
||||
|
|
34
Makefile.in
34
Makefile.in
|
@ -420,7 +420,6 @@ TFLAGS =
|
|||
STAGE_CFLAGS = $(BOOT_CFLAGS)
|
||||
STAGE_TFLAGS = $(TFLAGS)
|
||||
STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
|
||||
POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
|
||||
|
||||
|
||||
# Defaults for stage 1; some are overridden below.
|
||||
|
@ -431,10 +430,7 @@ STAGE1_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGE1_CXXFLAGS = $(STAGE1_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGE1_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGE1_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGE1_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
# Defaults for stage 2; some are overridden below.
|
||||
STAGE2_CFLAGS = $(STAGE_CFLAGS)
|
||||
|
@ -444,10 +440,7 @@ STAGE2_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGE2_CXXFLAGS = $(STAGE2_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGE2_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGE2_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGE2_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
# Defaults for stage 3; some are overridden below.
|
||||
STAGE3_CFLAGS = $(STAGE_CFLAGS)
|
||||
|
@ -457,10 +450,7 @@ STAGE3_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGE3_CXXFLAGS = $(STAGE3_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGE3_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGE3_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGE3_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
# Defaults for stage 4; some are overridden below.
|
||||
STAGE4_CFLAGS = $(STAGE_CFLAGS)
|
||||
|
@ -470,10 +460,7 @@ STAGE4_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGE4_CXXFLAGS = $(STAGE4_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGE4_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGE4_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGE4_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
# Defaults for stage profile; some are overridden below.
|
||||
STAGEprofile_CFLAGS = $(STAGE_CFLAGS)
|
||||
|
@ -483,10 +470,7 @@ STAGEprofile_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGEprofile_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGEprofile_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGEprofile_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
# Defaults for stage feedback; some are overridden below.
|
||||
STAGEfeedback_CFLAGS = $(STAGE_CFLAGS)
|
||||
|
@ -496,10 +480,7 @@ STAGEfeedback_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGEfeedback_CXXFLAGS = $(STAGEfeedback_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGEfeedback_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGEfeedback_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGEfeedback_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
|
||||
|
||||
# Only build the C compiler for stage1, because that is the only one that
|
||||
|
@ -517,9 +498,6 @@ STAGE1_LANGUAGES = @stage1_languages@
|
|||
# the last argument when conflicting --enable arguments are passed.
|
||||
# * Likewise, we force-disable coverage flags, since the installed
|
||||
# compiler probably has never heard of them.
|
||||
# * Don't remove this, because above we added
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS to STAGE_CONFIGURE_FLAGS, which
|
||||
# we don't want for STAGE1_CONFIGURE_FLAGS.
|
||||
STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
|
||||
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
|
||||
|
||||
|
|
|
@ -423,7 +423,6 @@ TFLAGS =
|
|||
STAGE_CFLAGS = $(BOOT_CFLAGS)
|
||||
STAGE_TFLAGS = $(TFLAGS)
|
||||
STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
|
||||
POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
|
||||
|
||||
[+ FOR bootstrap-stage +]
|
||||
# Defaults for stage [+id+]; some are overridden below.
|
||||
|
@ -434,10 +433,7 @@ STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
|
|||
STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
|
||||
@endif target-libstdc++-v3-bootstrap
|
||||
STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
|
||||
# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS here.
|
||||
STAGE[+id+]_CONFIGURE_FLAGS = \
|
||||
$(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
|
||||
[+ ENDFOR bootstrap-stage +]
|
||||
|
||||
# Only build the C compiler for stage1, because that is the only one that
|
||||
|
@ -455,9 +451,6 @@ STAGE1_LANGUAGES = @stage1_languages@
|
|||
# the last argument when conflicting --enable arguments are passed.
|
||||
# * Likewise, we force-disable coverage flags, since the installed
|
||||
# compiler probably has never heard of them.
|
||||
# * Don't remove this, because above we added
|
||||
# POSTSTAGE1_CONFIGURE_FLAGS to STAGE[+id+]_CONFIGURE_FLAGS, which
|
||||
# we don't want for STAGE1_CONFIGURE_FLAGS.
|
||||
STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
|
||||
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
|
||||
|
||||
|
|
88
configure
vendored
88
configure
vendored
|
@ -556,7 +556,6 @@ enable_option_checking=no
|
|||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
compare_exclusions
|
||||
POSTSTAGE1_CONFIGURE_FLAGS
|
||||
stage2_werror_flag
|
||||
stage1_checking
|
||||
stage1_cflags
|
||||
|
@ -753,8 +752,6 @@ enable_libada
|
|||
enable_libssp
|
||||
enable_static_libjava
|
||||
enable_bootstrap
|
||||
enable_build_with_cxx
|
||||
enable_build_poststage1_with_cxx
|
||||
with_mpc
|
||||
with_mpc_include
|
||||
with_mpc_lib
|
||||
|
@ -1471,9 +1468,6 @@ Optional Features:
|
|||
--enable-static-libjava[=ARG]
|
||||
build static libjava [default=no]
|
||||
--enable-bootstrap enable bootstrapping [yes if native build]
|
||||
--enable-build-with-cxx build with C++ compiler instead of C compiler
|
||||
--enable-build-poststage1-with-cxx
|
||||
build stages 2 and 3 with C++, not C
|
||||
--disable-isl-version-check
|
||||
disable check for ISL version
|
||||
--disable-cloog-version-check
|
||||
|
@ -5109,24 +5103,6 @@ $as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;}
|
|||
;;
|
||||
esac
|
||||
|
||||
# See if we are building gcc with C++.
|
||||
# Check whether --enable-build-with-cxx was given.
|
||||
if test "${enable_build_with_cxx+set}" = set; then :
|
||||
enableval=$enable_build_with_cxx; ENABLE_BUILD_WITH_CXX=$enableval
|
||||
else
|
||||
ENABLE_BUILD_WITH_CXX=no
|
||||
fi
|
||||
|
||||
|
||||
# Build stage1 with C and build stages 2 and 3 with C++.
|
||||
# Check whether --enable-build-poststage1-with-cxx was given.
|
||||
if test "${enable_build_poststage1_with_cxx+set}" = set; then :
|
||||
enableval=$enable_build_poststage1_with_cxx; ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval
|
||||
else
|
||||
ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes
|
||||
fi
|
||||
|
||||
|
||||
# Used for setting $lt_cv_objdir
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
|
||||
$as_echo_n "checking for objdir... " >&6; }
|
||||
|
@ -5980,7 +5956,7 @@ fi
|
|||
|
||||
|
||||
|
||||
# By default, C is the only stage 1 language.
|
||||
# By default, C and C++ are the only stage 1 languages.
|
||||
stage1_languages=,c,
|
||||
|
||||
# Target libraries that we bootstrap.
|
||||
|
@ -6018,15 +5994,14 @@ if test -d ${srcdir}/gcc; then
|
|||
;;
|
||||
esac
|
||||
|
||||
# If bootstrapping, then using --enable-build-with-cxx or
|
||||
# --enable-build-poststage1-with-cxx requires enabling C++.
|
||||
case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
|
||||
*,c++,*:*:*) ;;
|
||||
*:*,yes,*:yes)
|
||||
# If bootstrapping, C++ must be enabled.
|
||||
case ",$enable_languages,:$enable_bootstrap" in
|
||||
*,c++,*:*) ;;
|
||||
*:yes)
|
||||
if test -f ${srcdir}/gcc/cp/config-lang.in; then
|
||||
enable_languages="${enable_languages},c++"
|
||||
else
|
||||
as_fn_error "bootstrapping with --enable-build-with-cxx or --enable-build-poststage1-with-cxx requires c++ sources" "$LINENO" 5
|
||||
as_fn_error "bootstrapping requires c++ sources" "$LINENO" 5
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
@ -6121,10 +6096,7 @@ if test -d ${srcdir}/gcc; then
|
|||
fi
|
||||
|
||||
if test "$language" = "c++"; then
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
|
||||
|| test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
|
||||
boot_language=yes
|
||||
fi
|
||||
boot_language=yes
|
||||
fi
|
||||
|
||||
case ,${enable_languages}, in
|
||||
|
@ -14215,43 +14187,6 @@ case $build in
|
|||
esac ;;
|
||||
esac
|
||||
|
||||
# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
|
||||
if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
|
||||
# Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
|
||||
CFLAGS="$CFLAGS -fkeep-inline-functions"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fkeep-inline-functions is supported" >&5
|
||||
$as_echo_n "checking whether -fkeep-inline-functions is supported... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#if (__GNUC__ < 3) \
|
||||
|| (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
|
||||
|| (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
|
||||
#error http://gcc.gnu.org/PR29382
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; stage1_cflags="$stage1_cflags -fkeep-inline-functions"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Enable --enable-checking in stage1 of the compiler.
|
||||
|
@ -14286,15 +14221,6 @@ case ${enable_werror} in
|
|||
esac
|
||||
|
||||
|
||||
# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
|
||||
# --enable-build-with-cxx after stage1.
|
||||
if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
|
||||
POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
|
||||
else
|
||||
POSTSTAGE1_CONFIGURE_FLAGS=
|
||||
fi
|
||||
|
||||
|
||||
# Specify what files to not compare during bootstrap.
|
||||
|
||||
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
|
||||
|
|
61
configure.ac
61
configure.ac
|
@ -1204,20 +1204,6 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in
|
|||
;;
|
||||
esac
|
||||
|
||||
# See if we are building gcc with C++.
|
||||
AC_ARG_ENABLE(build-with-cxx,
|
||||
[AS_HELP_STRING([--enable-build-with-cxx],
|
||||
[build with C++ compiler instead of C compiler])],
|
||||
ENABLE_BUILD_WITH_CXX=$enableval,
|
||||
ENABLE_BUILD_WITH_CXX=no)
|
||||
|
||||
# Build stage1 with C and build stages 2 and 3 with C++.
|
||||
AC_ARG_ENABLE(build-poststage1-with-cxx,
|
||||
[AS_HELP_STRING([--enable-build-poststage1-with-cxx],
|
||||
[build stages 2 and 3 with C++, not C])],
|
||||
ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval,
|
||||
ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes)
|
||||
|
||||
# Used for setting $lt_cv_objdir
|
||||
_LT_CHECK_OBJDIR
|
||||
|
||||
|
@ -1595,7 +1581,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
|
|||
])
|
||||
|
||||
|
||||
# By default, C is the only stage 1 language.
|
||||
# By default, C and C++ are the only stage 1 languages.
|
||||
stage1_languages=,c,
|
||||
|
||||
# Target libraries that we bootstrap.
|
||||
|
@ -1633,15 +1619,14 @@ if test -d ${srcdir}/gcc; then
|
|||
;;
|
||||
esac
|
||||
|
||||
# If bootstrapping, then using --enable-build-with-cxx or
|
||||
# --enable-build-poststage1-with-cxx requires enabling C++.
|
||||
case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
|
||||
*,c++,*:*:*) ;;
|
||||
*:*,yes,*:yes)
|
||||
# If bootstrapping, C++ must be enabled.
|
||||
case ",$enable_languages,:$enable_bootstrap" in
|
||||
*,c++,*:*) ;;
|
||||
*:yes)
|
||||
if test -f ${srcdir}/gcc/cp/config-lang.in; then
|
||||
enable_languages="${enable_languages},c++"
|
||||
else
|
||||
AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-poststage1-with-cxx requires c++ sources])
|
||||
AC_MSG_ERROR([bootstrapping requires c++ sources])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
@ -1736,10 +1721,7 @@ if test -d ${srcdir}/gcc; then
|
|||
fi
|
||||
|
||||
if test "$language" = "c++"; then
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
|
||||
|| test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
|
||||
boot_language=yes
|
||||
fi
|
||||
boot_language=yes
|
||||
fi
|
||||
|
||||
case ,${enable_languages}, in
|
||||
|
@ -3129,26 +3111,6 @@ case $build in
|
|||
esac ;;
|
||||
esac
|
||||
|
||||
# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
|
||||
if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
|
||||
# Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
|
||||
CFLAGS="$CFLAGS -fkeep-inline-functions"
|
||||
AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
|
||||
AC_TRY_COMPILE([
|
||||
#if (__GNUC__ < 3) \
|
||||
|| (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
|
||||
|| (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
|
||||
#error http://gcc.gnu.org/PR29382
|
||||
#endif
|
||||
],,
|
||||
[AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
|
||||
[AC_MSG_RESULT([no])])
|
||||
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_SUBST(stage1_cflags)
|
||||
|
||||
# Enable --enable-checking in stage1 of the compiler.
|
||||
|
@ -3178,15 +3140,6 @@ case ${enable_werror} in
|
|||
esac
|
||||
AC_SUBST(stage2_werror_flag)
|
||||
|
||||
# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
|
||||
# --enable-build-with-cxx after stage1.
|
||||
if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
|
||||
POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
|
||||
else
|
||||
POSTSTAGE1_CONFIGURE_FLAGS=
|
||||
fi
|
||||
AC_SUBST(POSTSTAGE1_CONFIGURE_FLAGS)
|
||||
|
||||
# Specify what files to not compare during bootstrap.
|
||||
|
||||
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
|
||||
|
|
601
gcc/ChangeLog
601
gcc/ChangeLog
|
@ -1,3 +1,604 @@
|
|||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. Configury.
|
||||
|
||||
* configure.ac (CXX_FOR_BUILD): Define and substitute.
|
||||
(BUILD_CXXFLAGS): Define.
|
||||
Remove all handlers of ENABLE_BUILD_WITH_CXX.
|
||||
Force all build to be with C++.
|
||||
* Makefile.in (BUILD_CXXFLAGS): Use it.
|
||||
Remove all handlers of ENABLE_BUILD_WITH_CXX.
|
||||
* configure: Regenerate.
|
||||
* config.in: Regenerate.
|
||||
* doc/install.texi: Remove documentation for --enable-build-with-cxx
|
||||
and --enable-build-poststage1-with-cxx.
|
||||
|
||||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. Re-implement VEC in C++.
|
||||
|
||||
* vec.c (vec_heap_free): Convert into a template function.
|
||||
(vec_gc_o_reserve_1): Make extern.
|
||||
(vec_gc_p_reserve): Remove.
|
||||
(vec_gc_p_reserve_exact): Remove.
|
||||
(vec_gc_o_reserve): Remove.
|
||||
(vec_gc_o_reserve_exact): Remove.
|
||||
(vec_heap_o_reserve_1): Make extern.
|
||||
(vec_heap_p_reserve): Remove.
|
||||
(vec_heap_p_reserve_exact): Remove.
|
||||
(vec_heap_o_reserve): Remove.
|
||||
(vec_heap_o_reserve_exact): Remove.
|
||||
(vec_stack_p_reserve): Remove.
|
||||
(vec_stack_p_reserve_exact): Remove.
|
||||
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
|
||||
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
|
||||
in the file.
|
||||
(VEC): Define to vec_t<T>.
|
||||
(vec_allocation_t): Define.
|
||||
(struct vec_prefix): Move earlier in the file.
|
||||
(vec_t<T>): New template.
|
||||
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
|
||||
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
|
||||
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
|
||||
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
|
||||
(DEF_VEC_A): Provide template instantiations for
|
||||
GC/PCH markers that do not traverse the vector.
|
||||
(vec_stack_p_reserve): Remove.
|
||||
(vec_stack_p_reserve_exact): Remove.
|
||||
(vec_stack_p_reserve_exact_1): Remove.
|
||||
(vec_stack_o_reserve): Remove.
|
||||
(vec_stack_o_reserve_exact): Remove.
|
||||
(vec_stack_free): Re-write as a template function.
|
||||
(vec_reserve): New template function.
|
||||
(vec_reserve_exact): New template function.
|
||||
(vec_heap_free): New template function if GATHER_STATISTICS is
|
||||
defined. Otherwise, macro that expands to free().
|
||||
(VEC_length_1): New template function.
|
||||
(VEC_length): Call it.
|
||||
(VEC_empty_1): New template function.
|
||||
(VEC_empty): Call it.
|
||||
(VEC_address_1): New template function.
|
||||
(VEC_address): Call it.
|
||||
(VEC_last_1): New template function.
|
||||
(VEC_last): Call it. Change return type to T&.
|
||||
Change all users that used VEC_Os.
|
||||
(VEC_index_1): New template function.
|
||||
(VEC_index): Call it. Return a T& instead of a T*.
|
||||
Update all callers that were using VEC_O before.
|
||||
(VEC_iterate_1): New template function.
|
||||
(VEC_iterate): Call it.
|
||||
(VEC_embedded_size_1): New template function.
|
||||
(VEC_embedded_size): Call it.
|
||||
(VEC_embedded_init_1): New template function.
|
||||
(VEC_embedded_init): Call it.
|
||||
(VEC_alloc_1): New template function.
|
||||
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
|
||||
do the allocation.
|
||||
(VEC_free_1): New template function.
|
||||
(VEC_free): Call it.
|
||||
(VEC_copy_1): New template function.
|
||||
(VEC_copy): Call it.
|
||||
(VEC_space_1): New template function
|
||||
(VEC_space): Call it.
|
||||
(VEC_reserve_1): New template function.
|
||||
(VEC_reserve): Call it.
|
||||
(VEC_reserve_exact_1): New template function.
|
||||
(VEC_reserve_exact): Call it.
|
||||
(VEC_splice_1): New template function.
|
||||
(VEC_splice): Call it.
|
||||
(VEC_safe_splice_1): New template function.
|
||||
(VEC_safe_splice): Call it.
|
||||
(VEC_quick_push_1): New template function. Create two overloads, one
|
||||
accepting T, the other accepting T *. Update all callers
|
||||
where T and T * are ambiguous.
|
||||
(VEC_quick_push): Call it.
|
||||
(VEC_safe_push_1): New template function. Create two overloads, one
|
||||
accepting T, the other accepting T *. Update all callers
|
||||
where T and T * are ambiguous.
|
||||
(VEC_safe_push): Call it.
|
||||
(VEC_pop_1): New template function.
|
||||
(VEC_pop): Call it.
|
||||
(VEC_truncate_1): New template function.
|
||||
(VEC_truncate): Call it.
|
||||
(VEC_safe_grow_1): New template function.
|
||||
(VEC_safe_grow): Call it.
|
||||
(VEC_safe_grow_cleared_1): New template function.
|
||||
(VEC_safe_grow_cleared): Call it.
|
||||
(VEC_replace_1): New template function.
|
||||
(VEC_replace): Call it. Always accept T instead of T*.
|
||||
Update all callers that used VEC_Os.
|
||||
(VEC_quick_insert_1): New template function.
|
||||
(VEC_quick_insert): Call it.
|
||||
(VEC_safe_insert_1): New template function.
|
||||
(VEC_safe_insert): Call it.
|
||||
(VEC_ordered_remove_1): New template function.
|
||||
(VEC_ordered_remove): Call it.
|
||||
(VEC_unordered_remove_1): New template function.
|
||||
(VEC_unordered_remove): Call it.
|
||||
(VEC_block_remove_1): New template function.
|
||||
(VEC_block_remove): Call it.
|
||||
(VEC_lower_bound_1): New template function.
|
||||
(VEC_lower_bound): Call it.
|
||||
(VEC_OP): Remove.
|
||||
(DEF_VEC_FUNC_P): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_P): Remove.
|
||||
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
|
||||
(DEF_VEC_FUNC_O): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_O): Remove.
|
||||
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_I): Remove.
|
||||
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
|
||||
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
|
||||
(vec_reserve_exact): New template function.
|
||||
|
||||
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
|
||||
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
|
||||
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
|
||||
(def_vec_alloc): Remove. Update all callers.
|
||||
* gengtype.c (filter_type_name): New.
|
||||
(output_mangled_typename): Call it.
|
||||
(write_func_for_structure): Likewise.
|
||||
(write_types): Likewise.
|
||||
(write_root): Likewise.
|
||||
(write_typed_alloc_def): Likewise.
|
||||
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
|
||||
(note_def_vec_alloc): Remove.
|
||||
* gengtype.h (note_def_vec_alloc): Remove.
|
||||
(DEFVEC_ALLOC): Remove token code.
|
||||
|
||||
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
|
||||
inside the insn traversal loop.
|
||||
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
|
||||
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
|
||||
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
|
||||
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
|
||||
|
||||
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
|
||||
VEC_* for vectors of non-pointers.
|
||||
* config/c6x/c6x.c (try_rename_operands): Likewise.
|
||||
(reshuffle_units): Likewise.
|
||||
* config/mips/mips.c (mips_multi_start): Likewise.
|
||||
(mips_multi_add): Likewise.
|
||||
(mips_multi_copy_insn): Likewise.
|
||||
(mips_multi_set_operand): Likewise.
|
||||
* hw-doloop.c (discover_loop): Likewise.
|
||||
(discover_loops): Likewise.
|
||||
(reorg_loops): Likewise.
|
||||
|
||||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. C++ support in gengtype.
|
||||
|
||||
* coretypes.h (gt_pointer_operator): Move from ...
|
||||
* ggc.h: ... here.
|
||||
* doc/gty.texi: Document support for C++ templates and
|
||||
user-provided markers.
|
||||
* gcc/gengtype-lex.l: Update copyright year.
|
||||
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
|
||||
DEFVEC_I.
|
||||
* gengtype-parse.c: Update copyright year.
|
||||
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
|
||||
(require_template_declaration): New.
|
||||
(typedef_name): Call it.
|
||||
(type): Replace IS_UNION with KIND. Replace all users.
|
||||
(def_vec): Remove. Update all users.
|
||||
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
|
||||
(write_state_user_struct_type): New.
|
||||
(write_state_type): Call it.
|
||||
(read_state_user_struct_type): New.
|
||||
(read_state_type): Call it.
|
||||
* gengtype.c: Update copyright year.
|
||||
(dump_pair): Move declaration to the top.
|
||||
(dump_type): Likewise.
|
||||
(dump_type_list): Likewise.
|
||||
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
|
||||
(create_user_defined_type): New.
|
||||
(resolve_typedef): Call it.
|
||||
(new_structure): Replace argument ISUNION with KIND.
|
||||
Change users to refer to KIND directly.
|
||||
Update all callers.
|
||||
(find_structure): Likewise.
|
||||
(set_gc_used_type): Handle TYPE_USER_STRUCT.
|
||||
(create_file): Update HDR to include new copyright year.
|
||||
(struct walk_type_data): Add field IN_PTR_FIELD.
|
||||
(output_mangled_typename): Handle TYPE_USER_STRUCT.
|
||||
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
|
||||
Clear it afterwards.
|
||||
Handle TYPE_USER_STRUCT.
|
||||
(write_types_process_field): Handle TYPE_USER_STRUCT.
|
||||
(get_type_specifier): Move earlier in the file.
|
||||
(write_type_decl): New.
|
||||
(write_marker_function_name): New.
|
||||
(write_user_func_for_structure_ptr): New.
|
||||
(write_user_func_for_structure_body): New.
|
||||
(write_user_marking_functions): New.
|
||||
(write_func_for_structure): Call write_marker_function_name
|
||||
and write_type_decl.
|
||||
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
|
||||
function directly.
|
||||
Call write_user_marking_functions on TYPE_USER_STRUCTs.
|
||||
(write_types_local_user_process_field): New.
|
||||
(write_pch_user_walking_for_structure_body): New.
|
||||
(write_pch_user_walking_functions): New.
|
||||
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
|
||||
(write_local_func_for_structure): Do not call walk_type for
|
||||
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
|
||||
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
|
||||
(write_root): Handle TYPE_USER_STRUCT.
|
||||
(vec_prefix_type): Remove. Update all users.
|
||||
(note_def_vec): Remove. Update all users.
|
||||
(dump_typekind): Handle TYPE_USER_STRUCT.
|
||||
(dump_type): Initialize SEEN_TYPES, if needed.
|
||||
Handle TYPE_USER_STRUCT.
|
||||
(dump_everything): Do not initialize SEEN_TYPES.
|
||||
* gengtype.h: Update copyright year.
|
||||
(enum typekind): Add TYPE_USER_STRUCT.
|
||||
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
|
||||
Convert into function.
|
||||
Add an overload taking const_type_p.
|
||||
Update all callers.
|
||||
(new_structure): Change second field to type enum typekind.
|
||||
Update all users.
|
||||
(find_structure): Likewise.
|
||||
(note_def_vec): Remove.
|
||||
(DEFVEC_OP): Remove.
|
||||
(DEFVEC_I): Remove.
|
||||
* ggc-page.c (gt_ggc_mx): Add entry points for marking
|
||||
'const char *&', 'unsigned char *&' and 'unsigned char&'.
|
||||
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
|
||||
'const char *&' and 'unsigned char *&'.
|
||||
* stringpool.c (gt_pch_nx): Add entry points for marking
|
||||
'const char *&', 'unsigned char *&' and 'unsigned char&'.
|
||||
Add an entry point for the overload taking arguments 'unsigned char
|
||||
*', 'gt_pointer_operator' and 'void *'.
|
||||
* vec.h (struct vec_prefix): Remove GTY marker.
|
||||
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
|
||||
(gt_ggc_mx (vec_t<T> *)): New template function.
|
||||
(gt_pch_nx (vec_t<T> *)): New template function.
|
||||
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
|
||||
function.
|
||||
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
|
||||
function.
|
||||
|
||||
* basic-block.h (struct edge_def): Mark GTY((user)).
|
||||
Remove all GTY markers from fields.
|
||||
(gt_ggc_mx): Declare.
|
||||
(gt_pch_nx): Declare.
|
||||
* tree-cfg.c (gt_ggc_mx): New.
|
||||
(gt_pch_nx): New.
|
||||
|
||||
* gengtype-lex.l (USER_GTY): Add pattern for "user".
|
||||
* gengtype-parse.c (option): Handle USER_GTY.
|
||||
(opts_have): New.
|
||||
(type): Call it.
|
||||
If the keyword 'user' is used, do not walk the fields
|
||||
of the structure.
|
||||
* gengtype.h (USER_GTY): Add.
|
||||
* doc/gty.texi: Update.
|
||||
|
||||
2012-08-14 Lawrence Crowl <crowl@google.com>
|
||||
|
||||
Merge cxx-conversion branch. Implement C++ hash table.
|
||||
|
||||
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
|
||||
* hash-table.c: Likewise.
|
||||
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
|
||||
(static htab_t same_succ_htab): Change type to hash_table;
|
||||
move specification of helper functions from create call to declaration.
|
||||
Change users to invoke member functions.
|
||||
(same_succ_print_traverse): Make extern ssa_.... Change callers.
|
||||
Remove void* casting.
|
||||
(same_succ_hash): Likewise.
|
||||
(same_succ_equal): Likewise.
|
||||
(same_succ_delete): Likewise.
|
||||
* tree-ssa-threadupdate.c: Include hash-table.h.
|
||||
(struct local_info): Rename to ssa_local_info_t to avoid overloading
|
||||
the type name local_info with the variable name local_info.
|
||||
(static htab_t redirection_data): Change type to hash_table.
|
||||
Move specification of helper functions from create call to declaration.
|
||||
Change users to invoke member functions.
|
||||
(redirection_data_hash): Make extern ssa_.... Change callers.
|
||||
Remove void* casting.
|
||||
(redirection_data_eq): Likewise.
|
||||
(fix_duplicate_block_edges): Likewise.
|
||||
(create_duplicates): Likewise.
|
||||
(fixup_template_block): Likewise.
|
||||
(redirect_edges): Likewise.
|
||||
(lookup_redirection_data): Change types associated with the hash table
|
||||
from void* to their actual type. Remove unnecessary casts.
|
||||
* tree-ssa-ccp.c: Include hash-table.h.
|
||||
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
|
||||
of htab_t with gimple_htab. Change users to invoke member functions.
|
||||
Move specification of helper functions from create call to declaration.
|
||||
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
|
||||
(hash_ssa_name_by_var): Make extern. Remove void* casting.
|
||||
(eq_ssa_name_by_var): Likewise.
|
||||
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
|
||||
to hash_table. Change users to invoke member functions.
|
||||
Move specification of helper functions from create call to declaration.
|
||||
* coverage.c: Include hash-table.h instead of hashtab.h.
|
||||
(static htab_t counts_hash): Change type to hash_table;
|
||||
move specification of helper functions from create call to declaration.
|
||||
Change users to invoke member functions.
|
||||
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
|
||||
of htab_... Remove void* casting.
|
||||
(htab_counts_entry_eq): Likewise.
|
||||
(htab_counts_entry_del): Likewise.
|
||||
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
|
||||
(static htab_t expression_to_id): Change type to hash_table.
|
||||
Move specification of helper functions from create call to declaration.
|
||||
Change users to invoke member functions.
|
||||
(static htab_t phi_translate_table): Likewise.
|
||||
(pre_expr_eq): Make extern ssa_.... Change callers.
|
||||
Remove void* casting.
|
||||
(pre_expr_hash): Likewise.
|
||||
(expr_pred_trans_hash): Likewise.
|
||||
(expr_pred_trans_eq): Likewise.
|
||||
(alloc_expression_id): Change types associated with the hash table
|
||||
from void* to their actual type. Remove unnecessary casts.
|
||||
(lookup_expression_id): Likewise.
|
||||
(phi_trans_lookup): Likewise.
|
||||
(phi_trans_add): Likewise.
|
||||
* stringpool.c: Rename uses of libcpp typedef hash_table to
|
||||
cpp_hash_table.
|
||||
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
|
||||
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
|
||||
|
||||
2012-08-14 Lawrence Crowl <crowl@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. Re-write double_int in C++.
|
||||
|
||||
* hash-table.h
|
||||
(typedef double_int): Change to struct (POD).
|
||||
(double_int::make): New overloads for int to double-int conversion.
|
||||
(double_int::mask): New.
|
||||
(double_int::max_value): New.
|
||||
(double_int::min_value): New.
|
||||
(double_int::operator ++): New.
|
||||
(double_int::operator --): New.
|
||||
(double_int::operator *=): New.
|
||||
(double_int::operator +=): New.
|
||||
(double_int::operator -=): New.
|
||||
(double_int::to_signed): New.
|
||||
(double_int::to_unsigned): New.
|
||||
(double_int::fits_unsigned): New.
|
||||
(double_int::fits_signed): New.
|
||||
(double_int::fits): New.
|
||||
(double_int::trailing_zeros): New.
|
||||
(double_int::popcount): New.
|
||||
(double_int::multiple_of): New.
|
||||
(double_int::set_bit): New.
|
||||
(double_int::mul_with_sign): New.
|
||||
(double_int::operator * (binary)): New.
|
||||
(double_int::operator + (binary)): New.
|
||||
(double_int::operator - (binary)): New.
|
||||
(double_int::operator - (unary)): New.
|
||||
(double_int::operator ~ (unary)): New.
|
||||
(double_int::operator & (binary)): New.
|
||||
(double_int::operator | (binary)): New.
|
||||
(double_int::operator ^ (binary)): New.
|
||||
(double_int::and_not): New.
|
||||
(double_int::lshift): New.
|
||||
(double_int::rshift): New.
|
||||
(double_int::alshift): New.
|
||||
(double_int::arshift): New.
|
||||
(double_int::llshift): New.
|
||||
(double_int::lrshift): New.
|
||||
(double_int::lrotate): New.
|
||||
(double_int::rrotate): New.
|
||||
(double_int::div): New.
|
||||
(double_int::sdiv): New.
|
||||
(double_int::udiv): New.
|
||||
(double_int::mod): New.
|
||||
(double_int::smod): New.
|
||||
(double_int::umod): New.
|
||||
(double_int::divmod): New.
|
||||
(double_int::sdivmod): New.
|
||||
(double_int::udivmod): New.
|
||||
(double_int::ext): New.
|
||||
(double_int::zext): New.
|
||||
(double_int::sext): New.
|
||||
(double_int::is_zero): New.
|
||||
(double_int::is_one): New.
|
||||
(double_int::is_minus_one): New.
|
||||
(double_int::is_negative): New.
|
||||
(double_int::cmp): New.
|
||||
(double_int::ucmp): New.
|
||||
(double_int::scmp): New.
|
||||
(double_int::ult): New.
|
||||
(double_int::ugt): New.
|
||||
(double_int::slt): New.
|
||||
(double_int::sgt): New.
|
||||
(double_int::max): New.
|
||||
(double_int::smax): New.
|
||||
(double_int::umax): New.
|
||||
(double_int::min): New.
|
||||
(double_int::smin): New.
|
||||
(double_int::umin): New.
|
||||
(double_int::operator ==): New.
|
||||
(double_int::operator !=): New.
|
||||
(shwi_to_double_int): Change implementation to use member function.
|
||||
(double_int_minus_one): Likewise.
|
||||
(double_int_zero): Likewise.
|
||||
(double_int_one): Likewise.
|
||||
(double_int_two): Likewise.
|
||||
(double_int_ten): Likewise.
|
||||
(uhwi_to_double_int): Likewise.
|
||||
(double_int_to_shwi): Likewise.
|
||||
(double_int_to_uhwi): Likewise.
|
||||
(double_int_fits_in_uhwi_p): Likewise.
|
||||
(double_int_fits_in_shwi_p): Likewise.
|
||||
(double_int_fits_in_hwi_p): Likewise.
|
||||
(double_int_mul): Likewise.
|
||||
(double_int_mul_with_sign): Likewise.
|
||||
(double_int_add): Likewise.
|
||||
(double_int_sub): Likewise.
|
||||
(double_int_neg): Likewise.
|
||||
(double_int_div): Likewise.
|
||||
(double_int_sdiv): Likewise.
|
||||
(double_int_udiv): Likewise.
|
||||
(double_int_mod): Likewise.
|
||||
(double_int_smod): Likewise.
|
||||
(double_int_umod): Likewise.
|
||||
(double_int_divmod): Likewise.
|
||||
(double_int_sdivmod): Likewise.
|
||||
(double_int_udivmod): Likewise.
|
||||
(double_int_multiple_of): Likewise.
|
||||
(double_int_setbit): Likewise.
|
||||
(double_int_ctz): Likewise.
|
||||
(double_int_not): Likewise.
|
||||
(double_int_ior): Likewise.
|
||||
(double_int_and): Likewise.
|
||||
(double_int_and_not): Likewise.
|
||||
(double_int_xor): Likewise.
|
||||
(double_int_lshift): Likewise.
|
||||
(double_int_rshift): Likewise.
|
||||
(double_int_lrotate): Likewise.
|
||||
(double_int_rrotate): Likewise.
|
||||
(double_int_cmp): Likewise.
|
||||
(double_int_scmp): Likewise.
|
||||
(double_int_ucmp): Likewise.
|
||||
(double_int_max): Likewise.
|
||||
(double_int_smax): Likewise.
|
||||
(double_int_umax): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_smin): Likewise.
|
||||
(double_int_umin): Likewise.
|
||||
(double_int_ext): Likewise.
|
||||
(double_int_sext): Likewise.
|
||||
(double_int_zext): Likewise.
|
||||
(double_int_mask): Likewise.
|
||||
(double_int_max_value): Likewise.
|
||||
(double_int_min_value): Likewise.
|
||||
(double_int_zero_p): Likewise.
|
||||
(double_int_one_p): Likewise.
|
||||
(double_int_minus_one_p): Likewise.
|
||||
(double_int_equal_p): Likewise.
|
||||
(double_int_popcount): Likewise.
|
||||
* hash-table.c
|
||||
(double_int_mask): Reuse implementation for double_int::mask.
|
||||
(double_int_max_value): Likewise.
|
||||
(double_int_min_value): Likewise.
|
||||
(double_int_ext): Likewise.
|
||||
(double_int_zext): Likewise.
|
||||
(double_int_sext): Likewise.
|
||||
(double_int_mul_with_sign): Likewise.
|
||||
(double_int_divmod): Likewise.
|
||||
(double_int_sdivmod): Likewise.
|
||||
(double_int_udivmod): Likewise.
|
||||
(double_int_div): Likewise.
|
||||
(double_int_sdiv): Likewise.
|
||||
(double_int_udiv): Likewise.
|
||||
(double_int_mod): Likewise.
|
||||
(double_int_smod): Likewise.
|
||||
(double_int_umod): Likewise.
|
||||
(double_int_multiple_of): Likewise.
|
||||
(double_int_lshift): Likewise.
|
||||
(double_int_rshift): Likewise.
|
||||
(double_int_lrotate): Likewise.
|
||||
(double_int_rrotate): Likewise.
|
||||
(double_int_cmp): Likewise.
|
||||
(double_int_ucmp): Likewise.
|
||||
(double_int_scmp): Likewise.
|
||||
(double_int_max): Likewise.
|
||||
(double_int_smax): Likewise.
|
||||
(double_int_umax): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_smin): Likewise.
|
||||
(double_int_umin): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int_min): Likewise.
|
||||
(double_int::alshift): New.
|
||||
(double_int::arshift): New.
|
||||
(double_int::llshift): New.
|
||||
(double_int::lrshift): New.
|
||||
(double_int::ult): New.
|
||||
(double_int::ugt): New.
|
||||
(double_int::slt): New.
|
||||
(double_int::sgt): New.
|
||||
(double_int_setbit): Reuse implementation for double_int::set_bit,
|
||||
which avoids a name conflict with a macro.
|
||||
(double_int_double_int_ctz): Reuse implementation for
|
||||
double_int::trailing_zeros.
|
||||
(double_int_fits_in_shwi_p): Reuse implementation for
|
||||
double_int::fits_signed.
|
||||
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
|
||||
(double_int_mul): Reuse implementation for binary
|
||||
double_int::operator *.
|
||||
(double_int_add): Likewise.
|
||||
(double_int_sub): Likewise.
|
||||
(double_int_neg): Reuse implementation for unary
|
||||
double_int::operator -.
|
||||
(double_int_max_value): Likewise.
|
||||
* fixed-value.c: Change to use member functions introduced above.
|
||||
|
||||
2012-08-14 Lawrence Crowl <crowl@google.com>
|
||||
|
||||
Merge cxx-conversion branch. Support tree macro calling
|
||||
from gdb.
|
||||
|
||||
* tree.h (tree_check): New.
|
||||
(TREE_CHECK): Use inline function above instead of __extension__.
|
||||
(tree_not_check): New.
|
||||
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
|
||||
(tree_check2): New.
|
||||
(TREE_CHECK2): Use inline function above instead of __extension__.
|
||||
(tree_not_check2): New.
|
||||
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
|
||||
(tree_check3): New.
|
||||
(TREE_CHECK3): Use inline function above instead of __extension__.
|
||||
(tree_not_check3): New.
|
||||
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
|
||||
(tree_check4): New.
|
||||
(TREE_CHECK4): Use inline function above instead of __extension__.
|
||||
(tree_not_check4): New.
|
||||
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
|
||||
(tree_check5): New.
|
||||
(TREE_CHECK5): Use inline function above instead of __extension__.
|
||||
(tree_not_check5): New.
|
||||
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
|
||||
(contains_struct_check): New.
|
||||
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(tree_class_check): New.
|
||||
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
|
||||
(tree_range_check): New.
|
||||
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
|
||||
(omp_clause_subcode_check): New.
|
||||
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(omp_clause_range_check): New.
|
||||
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(expr_check): New.
|
||||
(EXPR_CHECK): Use inline function above instead of __extension__.
|
||||
(non_type_check): New.
|
||||
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
|
||||
(tree_vec_elt_check): New.
|
||||
(TREE_VEC_ELT_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(omp_clause_elt_check): New.
|
||||
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(tree_operand_check): New.
|
||||
(TREE_OPERAND_CHECK): Use inline function above instead of
|
||||
__extension__.
|
||||
(tree_operand_check_code): New.
|
||||
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
|
||||
__extension__.
|
||||
(TREE_CHAIN): Simplify implementation.
|
||||
(TREE_TYPE): Simplify implementation.
|
||||
(tree_operand_length): Move for compilation dependences.
|
||||
* gdbinit.in: (macro define __FILE__): New.
|
||||
(macro define __LINE__): New.
|
||||
(skip "tree.h"): New.
|
||||
|
||||
2012-08-14 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* config/i386/i386.md (enabled): Add comment with explanation
|
||||
|
|
|
@ -223,13 +223,6 @@ RANLIB_FLAGS = @ranlib_flags@
|
|||
HOST_LIBS = @HOST_LIBS@
|
||||
|
||||
# The name of the compiler to use.
|
||||
ENABLE_BUILD_WITH_CXX = @ENABLE_BUILD_WITH_CXX@
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
COMPILER = $(CC)
|
||||
COMPILER_FLAGS = $(CFLAGS)
|
||||
LINKER = $(CC)
|
||||
LINKER_FLAGS = $(CFLAGS)
|
||||
else
|
||||
COMPILER = $(CXX)
|
||||
COMPILER_FLAGS = $(CXXFLAGS)
|
||||
# If HOST_LIBS is set, then the user is controlling the libraries to
|
||||
|
@ -243,7 +236,6 @@ else
|
|||
LINKER = $(CC)
|
||||
LINKER_FLAGS = $(CFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
# -------------------------------------------
|
||||
# Programs which operate on the build machine
|
||||
|
@ -336,13 +328,8 @@ CLOOGINC = @CLOOGINC@
|
|||
enable_lto = @enable_lto@
|
||||
|
||||
# Compiler and flags needed for plugin support
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
PLUGINCC = @CC@
|
||||
PLUGINCFLAGS = @CFLAGS@
|
||||
else
|
||||
PLUGINCC = @CXX@
|
||||
PLUGINCFLAGS = @CXXFLAGS@
|
||||
endif
|
||||
|
||||
# Libs and linker options needed for plugin support
|
||||
PLUGINLIBS = @pluginlibs@
|
||||
|
@ -732,22 +719,12 @@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
|
|||
BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE
|
||||
|
||||
# Native compiler that we use. This may be C++ some day.
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
COMPILER_FOR_BUILD = $(CC_FOR_BUILD)
|
||||
BUILD_COMPILERFLAGS = $(BUILD_CFLAGS)
|
||||
else
|
||||
COMPILER_FOR_BUILD = $(CXX_FOR_BUILD)
|
||||
BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS)
|
||||
endif
|
||||
|
||||
# Native linker that we use.
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
LINKER_FOR_BUILD = $(CC_FOR_BUILD)
|
||||
BUILD_LINKERFLAGS = $(BUILD_CFLAGS)
|
||||
else
|
||||
LINKER_FOR_BUILD = $(CXX_FOR_BUILD)
|
||||
BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
|
||||
endif
|
||||
|
||||
# Native linker and preprocessor flags. For x-fragment overrides.
|
||||
BUILD_LDFLAGS=@BUILD_LDFLAGS@
|
||||
|
@ -839,6 +816,7 @@ endif
|
|||
|
||||
# Shorthand variables for dependency lists.
|
||||
VEC_H = vec.h statistics.h
|
||||
HASH_TABLE_H = $(HASHTAB_H) hash-table.h
|
||||
EXCEPT_H = except.h $(HASHTAB_H) vecprim.h vecir.h
|
||||
TARGET_DEF = target.def target-hooks-macros.h
|
||||
C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
|
||||
|
@ -998,18 +976,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
|
|||
ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
|
||||
|
||||
# This is the variable to use when using $(COMPILER).
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
ALL_COMPILERFLAGS = $(ALL_CFLAGS)
|
||||
else
|
||||
ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
|
||||
endif
|
||||
|
||||
# This is the variable to use when using $(LINKER).
|
||||
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
|
||||
ALL_LINKERFLAGS = $(ALL_CFLAGS)
|
||||
else
|
||||
ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
|
||||
endif
|
||||
|
||||
# Build and host support libraries.
|
||||
LIBIBERTY = ../libiberty/libiberty.a
|
||||
|
@ -1466,7 +1436,8 @@ OBJS-libcommon = diagnostic.o pretty-print.o intl.o input.o version.o
|
|||
# Objects in libcommon-target.a, used by drivers and by the core
|
||||
# compiler and containing target-dependent code.
|
||||
OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
|
||||
opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o
|
||||
opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
|
||||
hash-table.o
|
||||
|
||||
# This lists all host objects for the front ends.
|
||||
ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
|
||||
|
@ -2224,7 +2195,7 @@ stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
|||
tree-ssa-tail-merge.o: tree-ssa-tail-merge.c \
|
||||
$(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(BITMAP_H) \
|
||||
$(FLAGS_H) $(TM_P_H) $(BASIC_BLOCK_H) \
|
||||
$(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) $(TREE_DUMP_H) \
|
||||
$(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) $(TREE_DUMP_H) $(HASH_TABLE_H) \
|
||||
$(GIMPLE_H) $(FUNCTION_H) tree-ssa-sccvn.h \
|
||||
$(CGRAPH_H) $(GIMPLE_PRETTY_PRINT_H) $(PARAMS_H)
|
||||
tree-ssa-structalias.o: tree-ssa-structalias.c \
|
||||
|
@ -2260,7 +2231,7 @@ tree-ssa-ter.o : tree-ssa-ter.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
|
|||
$(GIMPLE_PRETTY_PRINT_H)
|
||||
tree-ssa-coalesce.o : tree-ssa-coalesce.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h dumpfile.h \
|
||||
$(TREE_SSA_LIVE_H) $(BITMAP_H) $(FLAGS_H) $(HASHTAB_H) \
|
||||
$(TREE_SSA_LIVE_H) $(BITMAP_H) $(FLAGS_H) $(HASH_TABLE_H) \
|
||||
$(TREE_PRETTY_PRINT_H)
|
||||
tree-outof-ssa.o : tree-outof-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
|
||||
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h dumpfile.h \
|
||||
|
@ -2321,7 +2292,7 @@ tree-ssa-threadedge.o : tree-ssa-threadedge.c $(TREE_FLOW_H) $(CONFIG_H) \
|
|||
tree-ssa-propagate.h langhooks.h \
|
||||
$(PARAMS_H)
|
||||
tree-ssa-threadupdate.o : tree-ssa-threadupdate.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||
$(SYSTEM_H) $(TREE_H) $(TM_P_H) \
|
||||
$(SYSTEM_H) $(TREE_H) $(TM_P_H) $(HASH_TABLE_H) \
|
||||
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h dumpfile.h \
|
||||
$(BASIC_BLOCK_H) $(FLAGS_H) $(CFGLOOP_H)
|
||||
tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
|
@ -2343,7 +2314,7 @@ tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \
|
|||
tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) \
|
||||
$(TM_H) coretypes.h $(TREE_PASS_H) $(FLAGS_H) langhooks.h \
|
||||
$(CFGLOOP_H) alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) $(HASHTAB_H) \
|
||||
$(CFGLOOP_H) alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) $(HASH_TABLE_H) \
|
||||
$(GIMPLE_H) $(TREE_INLINE_H) tree-iterator.h tree-ssa-sccvn.h $(PARAMS_H) \
|
||||
$(DBGCNT_H) tree-scalar-evolution.h $(GIMPLE_PRETTY_PRINT_H)
|
||||
tree-ssa-sccvn.o : tree-ssa-sccvn.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||
|
@ -2927,8 +2898,8 @@ ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
|
|||
coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h \
|
||||
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
|
||||
$(FUNCTION_H) $(BASIC_BLOCK_H) toplev.h $(DIAGNOSTIC_CORE_H) $(GGC_H) langhooks.h $(COVERAGE_H) \
|
||||
$(HASHTAB_H) tree-iterator.h $(CGRAPH_H) gcov-io.c $(TM_P_H) \
|
||||
$(DIAGNOSTIC_CORE_H) intl.h gt-coverage.h $(TARGET_H)
|
||||
tree-iterator.h $(CGRAPH_H) gcov-io.c $(TM_P_H) \
|
||||
$(DIAGNOSTIC_CORE_H) intl.h gt-coverage.h $(TARGET_H) $(HASH_TABLE_H)
|
||||
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h $(TM_H) $(RTL_H) \
|
||||
$(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) \
|
||||
$(EMIT_RTL_H) $(DIAGNOSTIC_CORE_H) $(FUNCTION_H) \
|
||||
|
@ -2999,7 +2970,8 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
|
|||
$(SYSTEM_H) $(TREE_H) $(TM_P_H) \
|
||||
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h \
|
||||
$(BASIC_BLOCK_H) $(TREE_PASS_H) langhooks.h $(PARAMS_H) \
|
||||
tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(DIAGNOSTIC_CORE_H) \
|
||||
tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) \
|
||||
$(DIAGNOSTIC_CORE_H) $(HASH_TABLE_H) \
|
||||
$(DBGCNT_H) $(GIMPLE_PRETTY_PRINT_H) gimple-fold.h
|
||||
tree-ssa-strlen.o : tree-ssa-strlen.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TREE_FLOW_H) $(TREE_PASS_H) domwalk.h alloc-pool.h tree-ssa-propagate.h \
|
||||
|
@ -3153,6 +3125,8 @@ bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
|||
$(GGC_H) gt-bitmap.h $(BITMAP_H) $(OBSTACK_H) $(HASHTAB_H)
|
||||
vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) $(GGC_H) \
|
||||
$(DIAGNOSTIC_CORE_H) $(HASHTAB_H)
|
||||
hash-table.o : hash-table.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(HASHTAB_H)
|
||||
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
|
||||
$(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \
|
||||
hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h \
|
||||
|
|
|
@ -2921,7 +2921,7 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
= VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS
|
||||
(TREE_OPERAND (TREE_OPERAND (ret_val, 0), 1)),
|
||||
1)->value;
|
||||
1).value;
|
||||
else
|
||||
ret_val = TREE_OPERAND (TREE_OPERAND (ret_val, 0), 1);
|
||||
}
|
||||
|
@ -2980,7 +2980,7 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
TREE_OPERAND (alloc, 0),
|
||||
VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (TREE_OPERAND (alloc, 1)),
|
||||
0)->value);
|
||||
0).value);
|
||||
|
||||
/* Build a modified CONSTRUCTOR that references NEW_VAR. */
|
||||
p_array = TYPE_FIELDS (TREE_TYPE (alloc));
|
||||
|
@ -2990,7 +2990,7 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
|
|||
VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS
|
||||
(TREE_OPERAND (alloc, 1)),
|
||||
1)->value);
|
||||
1).value);
|
||||
new_ret = build_constructor (TREE_TYPE (alloc), v);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4491,10 +4491,10 @@ convert (tree type, tree expr)
|
|||
inner expression. */
|
||||
if (TREE_CODE (expr) == CONSTRUCTOR
|
||||
&& !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (expr))
|
||||
&& VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0)->index
|
||||
&& VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0).index
|
||||
== TYPE_FIELDS (etype))
|
||||
unpadded
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0)->value;
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0).value;
|
||||
|
||||
/* Otherwise, build an explicit component reference. */
|
||||
else
|
||||
|
@ -5047,7 +5047,7 @@ remove_conversions (tree exp, bool true_address)
|
|||
&& TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (exp)))
|
||||
return
|
||||
remove_conversions (VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (exp), 0)->value,
|
||||
CONSTRUCTOR_ELTS (exp), 0).value,
|
||||
true);
|
||||
break;
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
|
||||
/* The constant folder doesn't fold fat pointer types so we do it here. */
|
||||
if (TREE_CODE (p1) == CONSTRUCTOR)
|
||||
p1_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 0)->value;
|
||||
p1_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 0).value;
|
||||
else
|
||||
p1_array = build_component_ref (p1, NULL_TREE,
|
||||
TYPE_FIELDS (TREE_TYPE (p1)), true);
|
||||
|
@ -452,7 +452,7 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
null_pointer_node));
|
||||
|
||||
if (TREE_CODE (p2) == CONSTRUCTOR)
|
||||
p2_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 0)->value;
|
||||
p2_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 0).value;
|
||||
else
|
||||
p2_array = build_component_ref (p2, NULL_TREE,
|
||||
TYPE_FIELDS (TREE_TYPE (p2)), true);
|
||||
|
@ -473,14 +473,14 @@ compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
|
|||
= fold_build2_loc (loc, EQ_EXPR, result_type, p1_array, p2_array);
|
||||
|
||||
if (TREE_CODE (p1) == CONSTRUCTOR)
|
||||
p1_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 1)->value;
|
||||
p1_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 1).value;
|
||||
else
|
||||
p1_bounds
|
||||
= build_component_ref (p1, NULL_TREE,
|
||||
DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (p1))), true);
|
||||
|
||||
if (TREE_CODE (p2) == CONSTRUCTOR)
|
||||
p2_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 1)->value;
|
||||
p2_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 1).value;
|
||||
else
|
||||
p2_bounds
|
||||
= build_component_ref (p2, NULL_TREE,
|
||||
|
@ -1336,7 +1336,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
|
|||
{
|
||||
result = VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (operand),
|
||||
0)->value;
|
||||
0).value;
|
||||
result = convert (build_pointer_type (TREE_TYPE (operand)),
|
||||
build_unary_op (ADDR_EXPR, NULL_TREE, result));
|
||||
break;
|
||||
|
@ -2676,9 +2676,9 @@ gnat_stabilize_reference (tree ref, bool force, bool *success)
|
|||
&& VEC_length (constructor_elt, CONSTRUCTOR_ELTS (ref)) == 1)
|
||||
{
|
||||
tree index
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0)->index;
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0).index;
|
||||
tree value
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0)->value;
|
||||
= VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ref), 0).value;
|
||||
result
|
||||
= build_constructor_single (type, index,
|
||||
gnat_stabilize_reference_1 (value,
|
||||
|
|
|
@ -852,8 +852,8 @@ new_alias_set (void)
|
|||
if (flag_strict_aliasing)
|
||||
{
|
||||
if (alias_sets == 0)
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, (alias_set_entry) 0);
|
||||
VEC_safe_push (alias_set_entry, gc, alias_sets, (alias_set_entry) 0);
|
||||
return VEC_length (alias_set_entry, alias_sets) - 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -33,19 +33,19 @@ along with GCC; see the file COPYING3. If not see
|
|||
typedef HOST_WIDEST_INT gcov_type;
|
||||
|
||||
/* Control flow edge information. */
|
||||
struct GTY(()) edge_def {
|
||||
struct GTY((user)) edge_def {
|
||||
/* The two blocks at the ends of the edge. */
|
||||
basic_block src;
|
||||
basic_block dest;
|
||||
|
||||
/* Instructions queued on the edge. */
|
||||
union edge_def_insns {
|
||||
gimple_seq GTY ((tag ("true"))) g;
|
||||
rtx GTY ((tag ("false"))) r;
|
||||
} GTY ((desc ("current_ir_type () == IR_GIMPLE"))) insns;
|
||||
gimple_seq g;
|
||||
rtx r;
|
||||
} insns;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
PTR GTY ((skip (""))) aux;
|
||||
PTR aux;
|
||||
|
||||
/* Location of any goto implicit in the edge and associated BLOCK. */
|
||||
tree goto_block;
|
||||
|
@ -65,6 +65,11 @@ DEF_VEC_P(edge);
|
|||
DEF_VEC_ALLOC_P(edge,gc);
|
||||
DEF_VEC_ALLOC_P(edge,heap);
|
||||
|
||||
/* Garbage collection and PCH support for edge_def. */
|
||||
extern void gt_ggc_mx (edge_def *e);
|
||||
extern void gt_pch_nx (edge_def *e);
|
||||
extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
|
||||
|
||||
/* Masks for edge.flags. */
|
||||
#define DEF_EDGE_FLAG(NAME,IDX) EDGE_##NAME = 1 << IDX ,
|
||||
enum cfg_edge_flags {
|
||||
|
|
|
@ -8392,7 +8392,7 @@ parse_optimize_options (tree args, bool attr_p)
|
|||
/* Build up argv vector. Just in case the string is stored away, use garbage
|
||||
collected strings. */
|
||||
VEC_truncate (const_char_p, optimize_args, 0);
|
||||
VEC_safe_push (const_char_p, gc, optimize_args, NULL);
|
||||
VEC_safe_push (const_char_p, gc, optimize_args, (const_char_p)NULL);
|
||||
|
||||
for (ap = args; ap != NULL_TREE; ap = TREE_CHAIN (ap))
|
||||
{
|
||||
|
@ -9390,10 +9390,10 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
|||
constructor_elt *ce;
|
||||
bool fold_p = false;
|
||||
|
||||
if (VEC_index (constructor_elt, v, 0)->index)
|
||||
if (VEC_index (constructor_elt, v, 0).index)
|
||||
maxindex = fold_convert_loc (input_location, sizetype,
|
||||
VEC_index (constructor_elt,
|
||||
v, 0)->index);
|
||||
v, 0).index);
|
||||
curindex = maxindex;
|
||||
|
||||
for (cnt = 1;
|
||||
|
|
|
@ -1209,9 +1209,9 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
|
|||
+ VEC_length (pragma_ns_name, registered_pp_pragmas)))
|
||||
{
|
||||
*space = VEC_index (pragma_ns_name, registered_pp_pragmas,
|
||||
id - PRAGMA_FIRST_EXTERNAL)->space;
|
||||
id - PRAGMA_FIRST_EXTERNAL).space;
|
||||
*name = VEC_index (pragma_ns_name, registered_pp_pragmas,
|
||||
id - PRAGMA_FIRST_EXTERNAL)->name;
|
||||
id - PRAGMA_FIRST_EXTERNAL).name;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ c_invoke_pragma_handler (unsigned int id)
|
|||
pragma_handler_2arg handler_2arg;
|
||||
|
||||
id -= PRAGMA_FIRST_EXTERNAL;
|
||||
ihandler = VEC_index (internal_pragma_handler, registered_pragmas, id);
|
||||
ihandler = &VEC_index (internal_pragma_handler, registered_pragmas, id);
|
||||
if (ihandler->extra_data)
|
||||
{
|
||||
handler_2arg = ihandler->handler.handler_2arg;
|
||||
|
|
|
@ -3932,7 +3932,7 @@ add_flexible_array_elts_to_size (tree decl, tree init)
|
|||
if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
return;
|
||||
|
||||
elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init))->value;
|
||||
elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init)).value;
|
||||
type = TREE_TYPE (elt);
|
||||
if (TREE_CODE (type) == ARRAY_TYPE
|
||||
&& TYPE_SIZE (type) == NULL_TREE
|
||||
|
|
|
@ -6529,9 +6529,9 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
e1_p = VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = VEC_index (c_expr_t, cexpr_list, 1);
|
||||
e3_p = VEC_index (c_expr_t, cexpr_list, 2);
|
||||
e1_p = &VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = &VEC_index (c_expr_t, cexpr_list, 1);
|
||||
e3_p = &VEC_index (c_expr_t, cexpr_list, 2);
|
||||
|
||||
c = e1_p->value;
|
||||
mark_exp_read (e2_p->value);
|
||||
|
@ -6611,8 +6611,8 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
break;
|
||||
}
|
||||
|
||||
e1_p = VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = VEC_index (c_expr_t, cexpr_list, 1);
|
||||
e1_p = &VEC_index (c_expr_t, cexpr_list, 0);
|
||||
e2_p = &VEC_index (c_expr_t, cexpr_list, 1);
|
||||
|
||||
mark_exp_read (e1_p->value);
|
||||
if (TREE_CODE (e1_p->value) == EXCESS_PRECISION_EXPR)
|
||||
|
@ -6671,15 +6671,15 @@ c_parser_postfix_expression (c_parser *parser)
|
|||
if (VEC_length (c_expr_t, cexpr_list) == 2)
|
||||
expr.value =
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0)->value,
|
||||
NULL_TREE, VEC_index (c_expr_t, cexpr_list, 1)->value);
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0).value,
|
||||
NULL_TREE, VEC_index (c_expr_t, cexpr_list, 1).value);
|
||||
|
||||
else if (VEC_length (c_expr_t, cexpr_list) == 3)
|
||||
expr.value =
|
||||
c_build_vec_perm_expr
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0)->value,
|
||||
VEC_index (c_expr_t, cexpr_list, 1)->value,
|
||||
VEC_index (c_expr_t, cexpr_list, 2)->value);
|
||||
(loc, VEC_index (c_expr_t, cexpr_list, 0).value,
|
||||
VEC_index (c_expr_t, cexpr_list, 1).value,
|
||||
VEC_index (c_expr_t, cexpr_list, 2).value);
|
||||
else
|
||||
{
|
||||
error_at (loc, "wrong number of arguments to "
|
||||
|
|
|
@ -6950,7 +6950,7 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
bool constructor_zeroinit =
|
||||
(VEC_length (constructor_elt, constructor_elements) == 1
|
||||
&& integer_zerop
|
||||
(VEC_index (constructor_elt, constructor_elements, 0)->value));
|
||||
(VEC_index (constructor_elt, constructor_elements, 0).value));
|
||||
|
||||
/* Do not warn for flexible array members or zero-length arrays. */
|
||||
while (constructor_unfilled_fields
|
||||
|
@ -6997,10 +6997,10 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
|
|||
else if (VEC_length (constructor_elt,constructor_elements) != 1)
|
||||
{
|
||||
error_init ("extra elements in scalar initializer");
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0)->value;
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0).value;
|
||||
}
|
||||
else
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0)->value;
|
||||
ret.value = VEC_index (constructor_elt,constructor_elements,0).value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7671,9 +7671,9 @@ find_init_member (tree field, struct obstack * braced_init_obstack)
|
|||
else if (TREE_CODE (constructor_type) == UNION_TYPE)
|
||||
{
|
||||
if (!VEC_empty (constructor_elt, constructor_elements)
|
||||
&& (VEC_last (constructor_elt, constructor_elements)->index
|
||||
&& (VEC_last (constructor_elt, constructor_elements).index
|
||||
== field))
|
||||
return VEC_last (constructor_elt, constructor_elements)->value;
|
||||
return VEC_last (constructor_elt, constructor_elements).value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -7856,7 +7856,7 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
|
|||
if (!implicit)
|
||||
{
|
||||
if (TREE_SIDE_EFFECTS (VEC_last (constructor_elt,
|
||||
constructor_elements)->value))
|
||||
constructor_elements).value))
|
||||
warning_init (0,
|
||||
"initialized field with side-effects overwritten");
|
||||
else if (warn_override_init)
|
||||
|
|
|
@ -1587,7 +1587,7 @@ set_nonzero_bits_and_sign_copies (rtx x, const_rtx set, void *data)
|
|||
(DF_LR_IN (ENTRY_BLOCK_PTR->next_bb), REGNO (x))
|
||||
&& HWI_COMPUTABLE_MODE_P (GET_MODE (x)))
|
||||
{
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
|
||||
if (set == 0 || GET_CODE (set) == CLOBBER)
|
||||
{
|
||||
|
@ -3635,21 +3635,21 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
|
|||
&& ! (temp = SET_DEST (XVECEXP (newpat, 0, 1)),
|
||||
(REG_P (temp)
|
||||
&& VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp))->nonzero_bits != 0
|
||||
REGNO (temp)).nonzero_bits != 0
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < BITS_PER_WORD
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < HOST_BITS_PER_INT
|
||||
&& (VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp))->nonzero_bits
|
||||
REGNO (temp)).nonzero_bits
|
||||
!= GET_MODE_MASK (word_mode))))
|
||||
&& ! (GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) == SUBREG
|
||||
&& (temp = SUBREG_REG (SET_DEST (XVECEXP (newpat, 0, 1))),
|
||||
(REG_P (temp)
|
||||
&& VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp))->nonzero_bits != 0
|
||||
REGNO (temp)).nonzero_bits != 0
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < BITS_PER_WORD
|
||||
&& GET_MODE_PRECISION (GET_MODE (temp)) < HOST_BITS_PER_INT
|
||||
&& (VEC_index (reg_stat_type, reg_stat,
|
||||
REGNO (temp))->nonzero_bits
|
||||
REGNO (temp)).nonzero_bits
|
||||
!= GET_MODE_MASK (word_mode)))))
|
||||
&& ! reg_overlap_mentioned_p (SET_DEST (XVECEXP (newpat, 0, 1)),
|
||||
SET_SRC (XVECEXP (newpat, 0, 1)))
|
||||
|
@ -9425,7 +9425,7 @@ reg_nonzero_bits_for_combine (const_rtx x, enum machine_mode mode,
|
|||
value. Otherwise, use the previously-computed global nonzero bits
|
||||
for this register. */
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
if (rsp->last_set_value != 0
|
||||
&& (rsp->last_set_mode == mode
|
||||
|| (GET_MODE_CLASS (rsp->last_set_mode) == MODE_INT
|
||||
|
@ -9494,7 +9494,7 @@ reg_num_sign_bit_copies_for_combine (const_rtx x, enum machine_mode mode,
|
|||
rtx tem;
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
if (rsp->last_set_value != 0
|
||||
&& rsp->last_set_mode == mode
|
||||
&& ((rsp->last_set_label >= label_tick_ebb_start
|
||||
|
@ -12033,7 +12033,7 @@ update_table_tick (rtx x)
|
|||
|
||||
for (r = regno; r < endregno; r++)
|
||||
{
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, r);
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, r);
|
||||
rsp->last_set_table_tick = label_tick;
|
||||
}
|
||||
|
||||
|
@ -12135,7 +12135,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
register. */
|
||||
for (i = regno; i < endregno; i++)
|
||||
{
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
|
||||
if (insn)
|
||||
rsp->last_set = insn;
|
||||
|
@ -12161,7 +12161,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
|
||||
for (i = regno; i < endregno; i++)
|
||||
{
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp->last_set_label = label_tick;
|
||||
if (!insn
|
||||
|| (value && rsp->last_set_table_tick >= label_tick_ebb_start))
|
||||
|
@ -12173,7 +12173,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value)
|
|||
/* The value being assigned might refer to X (like in "x++;"). In that
|
||||
case, we must replace it with (clobber (const_int 0)) to prevent
|
||||
infinite loops. */
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
if (value && !get_last_value_validate (&value, insn, label_tick, 0))
|
||||
{
|
||||
value = copy_rtx (value);
|
||||
|
@ -12271,7 +12271,7 @@ record_dead_and_set_regs (rtx insn)
|
|||
{
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp->last_death = insn;
|
||||
}
|
||||
}
|
||||
|
@ -12286,7 +12286,7 @@ record_dead_and_set_regs (rtx insn)
|
|||
{
|
||||
reg_stat_type *rsp;
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, i);
|
||||
rsp->last_set_invalid = 1;
|
||||
rsp->last_set = insn;
|
||||
rsp->last_set_value = 0;
|
||||
|
@ -12344,7 +12344,7 @@ record_promoted_value (rtx insn, rtx subreg)
|
|||
continue;
|
||||
}
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
if (rsp->last_set == insn)
|
||||
{
|
||||
if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0)
|
||||
|
@ -12369,7 +12369,7 @@ record_promoted_value (rtx insn, rtx subreg)
|
|||
static bool
|
||||
reg_truncated_to_mode (enum machine_mode mode, const_rtx x)
|
||||
{
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
enum machine_mode truncated = rsp->truncated_to_mode;
|
||||
|
||||
if (truncated == 0
|
||||
|
@ -12414,7 +12414,7 @@ record_truncated_value (rtx *p, void *data ATTRIBUTE_UNUSED)
|
|||
else
|
||||
return 0;
|
||||
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, REGNO (x));
|
||||
if (rsp->truncated_to_mode == 0
|
||||
|| rsp->truncation_label < label_tick_ebb_start
|
||||
|| (GET_MODE_SIZE (truncated_mode)
|
||||
|
@ -12493,7 +12493,7 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace)
|
|||
|
||||
for (j = regno; j < endregno; j++)
|
||||
{
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, j);
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, j);
|
||||
if (rsp->last_set_invalid
|
||||
/* If this is a pseudo-register that was only set once and not
|
||||
live at the beginning of the function, it is always valid. */
|
||||
|
@ -12597,7 +12597,7 @@ get_last_value (const_rtx x)
|
|||
return 0;
|
||||
|
||||
regno = REGNO (x);
|
||||
rsp = VEC_index (reg_stat_type, reg_stat, regno);
|
||||
rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
value = rsp->last_set_value;
|
||||
|
||||
/* If we don't have a value, or if it isn't for this basic block and
|
||||
|
@ -12661,7 +12661,7 @@ use_crosses_set_p (const_rtx x, int from_luid)
|
|||
#endif
|
||||
for (; regno < endreg; regno++)
|
||||
{
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, regno);
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
if (rsp->last_set
|
||||
&& rsp->last_set_label == label_tick
|
||||
&& DF_INSN_LUID (rsp->last_set) > from_luid)
|
||||
|
@ -12909,7 +12909,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_luid, rtx to_insn,
|
|||
if (code == REG)
|
||||
{
|
||||
unsigned int regno = REGNO (x);
|
||||
rtx where_dead = VEC_index (reg_stat_type, reg_stat, regno)->last_death;
|
||||
rtx where_dead = VEC_index (reg_stat_type, reg_stat, regno).last_death;
|
||||
|
||||
/* Don't move the register if it gets killed in between from and to. */
|
||||
if (maybe_kill_insn && reg_set_p (x, maybe_kill_insn)
|
||||
|
@ -13524,7 +13524,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
|
|||
if (place && REG_NOTE_KIND (note) == REG_DEAD)
|
||||
{
|
||||
unsigned int regno = REGNO (XEXP (note, 0));
|
||||
reg_stat_type *rsp = VEC_index (reg_stat_type, reg_stat, regno);
|
||||
reg_stat_type *rsp = &VEC_index (reg_stat_type, reg_stat, regno);
|
||||
|
||||
if (dead_or_set_p (place, XEXP (note, 0))
|
||||
|| reg_bitfield_target_p (XEXP (note, 0), PATTERN (place)))
|
||||
|
|
|
@ -45,12 +45,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* Define if building with C++. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef ENABLE_BUILD_WITH_CXX
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if you want more run-time sanity checks. This one gets a grab bag of
|
||||
miscellaneous but relatively cheap checks. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
|
|
|
@ -3478,7 +3478,7 @@ hwloop_optimize (hwloop_info loop)
|
|||
/* If we have to insert the LSETUP before a jump, count that jump in the
|
||||
length. */
|
||||
if (VEC_length (edge, loop->incoming) > 1
|
||||
|| !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
|
||||
|| !(VEC_last (edge, loop->incoming).flags & EDGE_FALLTHRU))
|
||||
{
|
||||
gcc_assert (JUMP_P (insn));
|
||||
insn = PREV_INSN (insn);
|
||||
|
@ -3747,7 +3747,7 @@ hwloop_optimize (hwloop_info loop)
|
|||
{
|
||||
rtx prev = BB_END (loop->incoming_src);
|
||||
if (VEC_length (edge, loop->incoming) > 1
|
||||
|| !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
|
||||
|| !(VEC_last (edge, loop->incoming).flags & EDGE_FALLTHRU))
|
||||
{
|
||||
gcc_assert (JUMP_P (prev));
|
||||
prev = PREV_INSN (prev);
|
||||
|
|
|
@ -126,7 +126,7 @@ DEF_VEC_ALLOC_O(c6x_sched_insn_info, heap);
|
|||
static VEC(c6x_sched_insn_info, heap) *insn_info;
|
||||
|
||||
#define INSN_INFO_LENGTH (VEC_length (c6x_sched_insn_info, insn_info))
|
||||
#define INSN_INFO_ENTRY(N) (*VEC_index (c6x_sched_insn_info, insn_info, (N)))
|
||||
#define INSN_INFO_ENTRY(N) (VEC_index (c6x_sched_insn_info, insn_info, (N)))
|
||||
|
||||
static bool done_cfi_sections;
|
||||
|
||||
|
@ -3448,8 +3448,8 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn,
|
|||
{
|
||||
unsigned int mask1, mask2, mask_changed;
|
||||
int count, side1, side2, req1, req2;
|
||||
insn_rr_info *this_rr = VEC_index (insn_rr_info, insn_rr,
|
||||
INSN_UID (chain->insn));
|
||||
insn_rr_info *this_rr = &VEC_index (insn_rr_info, insn_rr,
|
||||
INSN_UID (chain->insn));
|
||||
|
||||
count = get_unit_reqs (chain->insn, &req1, &side1, &req2, &side2);
|
||||
|
||||
|
@ -3555,7 +3555,7 @@ reshuffle_units (basic_block loop)
|
|||
if (!get_unit_operand_masks (insn, &mask1, &mask2))
|
||||
continue;
|
||||
|
||||
info = VEC_index (insn_rr_info, insn_rr, INSN_UID (insn));
|
||||
info = &VEC_index (insn_rr_info, insn_rr, INSN_UID (insn));
|
||||
if (info->op_info == NULL)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -3971,7 +3971,8 @@ mips_multi_start (void)
|
|||
static struct mips_multi_member *
|
||||
mips_multi_add (void)
|
||||
{
|
||||
return VEC_safe_push (mips_multi_member, heap, mips_multi_members, 0);
|
||||
return VEC_safe_push (mips_multi_member, heap, mips_multi_members,
|
||||
(struct mips_multi_member *) 0);
|
||||
}
|
||||
|
||||
/* Add a normal insn with the given asm format to the current multi-insn
|
||||
|
@ -4026,7 +4027,7 @@ mips_multi_copy_insn (unsigned int i)
|
|||
struct mips_multi_member *member;
|
||||
|
||||
member = mips_multi_add ();
|
||||
memcpy (member, VEC_index (mips_multi_member, mips_multi_members, i),
|
||||
memcpy (member, &VEC_index (mips_multi_member, mips_multi_members, i),
|
||||
sizeof (*member));
|
||||
gcc_assert (!member->is_label_p);
|
||||
}
|
||||
|
@ -4038,7 +4039,7 @@ mips_multi_copy_insn (unsigned int i)
|
|||
static void
|
||||
mips_multi_set_operand (unsigned int i, unsigned int op, rtx x)
|
||||
{
|
||||
VEC_index (mips_multi_member, mips_multi_members, i)->operands[op] = x;
|
||||
VEC_index (mips_multi_member, mips_multi_members, i).operands[op] = x;
|
||||
}
|
||||
|
||||
/* Write out the asm code for the current multi-insn sequence. */
|
||||
|
|
259
gcc/configure
vendored
259
gcc/configure
vendored
|
@ -766,7 +766,6 @@ enable_shared
|
|||
enable_fixed_point
|
||||
enable_decimal_float
|
||||
enable_multilib
|
||||
ENABLE_BUILD_WITH_CXX
|
||||
coverage_flags
|
||||
valgrind_command
|
||||
valgrind_path_defines
|
||||
|
@ -873,7 +872,6 @@ enable_werror_always
|
|||
enable_checking
|
||||
enable_coverage
|
||||
enable_gather_detailed_mem_stats
|
||||
enable_build_with_cxx
|
||||
with_stabs
|
||||
enable_multilib
|
||||
enable___cxa_atexit
|
||||
|
@ -1575,7 +1573,6 @@ Optional Features:
|
|||
Values are opt, noopt, default is noopt
|
||||
--enable-gather-detailed-mem-stats
|
||||
enable detailed memory allocation stats gathering
|
||||
--enable-build-with-cxx build with C++ compiler instead of C compiler
|
||||
--enable-multilib enable library support for multiple ABIs
|
||||
--enable-__cxa_atexit enable __cxa_atexit for C++
|
||||
--enable-decimal-float={no,yes,bid,dpd}
|
||||
|
@ -6997,21 +6994,6 @@ _ACEOF
|
|||
# Miscenalleous configure options
|
||||
# -------------------------------
|
||||
|
||||
# See if we are building gcc with C++.
|
||||
# Check whether --enable-build-with-cxx was given.
|
||||
if test "${enable_build_with_cxx+set}" = set; then :
|
||||
enableval=$enable_build_with_cxx; ENABLE_BUILD_WITH_CXX=$enableval
|
||||
else
|
||||
ENABLE_BUILD_WITH_CXX=no
|
||||
fi
|
||||
|
||||
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
|
||||
|
||||
$as_echo "#define ENABLE_BUILD_WITH_CXX 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# With stabs
|
||||
|
||||
# Check whether --with-stabs was given.
|
||||
|
@ -9516,6 +9498,12 @@ fi
|
|||
|
||||
# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
|
||||
# iconv() prototype.
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
if test "X$prefix" = "XNONE"; then
|
||||
acl_final_prefix="$ac_default_prefix"
|
||||
|
@ -10057,13 +10045,6 @@ fi
|
|||
fi
|
||||
|
||||
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then :
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10219,169 +10200,12 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
else
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
|
||||
for element in $INCICONV; do
|
||||
haveit=
|
||||
for x in $CPPFLAGS; do
|
||||
|
||||
acl_save_prefix="$prefix"
|
||||
prefix="$acl_final_prefix"
|
||||
acl_save_exec_prefix="$exec_prefix"
|
||||
exec_prefix="$acl_final_exec_prefix"
|
||||
eval x=\"$x\"
|
||||
exec_prefix="$acl_save_exec_prefix"
|
||||
prefix="$acl_save_prefix"
|
||||
|
||||
if test "X$x" = "X$element"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
|
||||
$as_echo_n "checking for iconv... " >&6; }
|
||||
if test "${am_cv_func_iconv+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
am_cv_lib_iconv=yes
|
||||
am_cv_func_iconv=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
|
||||
$as_echo "$am_cv_func_iconv" >&6; }
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
|
||||
$as_echo "#define HAVE_ICONV 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
|
||||
$as_echo_n "checking how to link with libiconv... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
|
||||
$as_echo "$LIBICONV" >&6; }
|
||||
else
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
|
||||
$as_echo_n "checking for iconv declaration... " >&6; }
|
||||
if test "${am_cv_proto_iconv+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
am_cv_proto_iconv_arg1=""
|
||||
else
|
||||
am_cv_proto_iconv_arg1="const"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
|
||||
fi
|
||||
|
||||
am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:-
|
||||
}$am_cv_proto_iconv" >&5
|
||||
$as_echo "${ac_t:-
|
||||
}$am_cv_proto_iconv" >&6; }
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define ICONV_CONST $am_cv_proto_iconv_arg1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Until we have in-tree GNU iconv:
|
||||
LIBICONV_DEP=
|
||||
|
@ -10767,14 +10591,13 @@ done
|
|||
|
||||
# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise()
|
||||
# prototype.
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then :
|
||||
ac_ext=cpp
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
for ac_func in madvise
|
||||
for ac_func in madvise
|
||||
do
|
||||
ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5
|
||||
|
@ -10787,8 +10610,8 @@ else
|
|||
#undef $ac_tr_decl
|
||||
#define $ac_tr_decl 1
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
|
||||
|
||||
int
|
||||
|
@ -10825,66 +10648,12 @@ fi
|
|||
|
||||
done
|
||||
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
else
|
||||
for ac_func in madvise
|
||||
do
|
||||
ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5
|
||||
$as_echo_n "checking whether $ac_func is declared... " >&6; }
|
||||
if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#undef $ac_tr_decl
|
||||
#define $ac_tr_decl 1
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#ifndef $ac_func
|
||||
char *(*pfn) = (char *(*)) $ac_func ;
|
||||
#endif
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
eval "gcc_cv_have_decl_$ac_func=yes"
|
||||
else
|
||||
eval "gcc_cv_have_decl_$ac_func=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; } ; cat >>confdefs.h <<_ACEOF
|
||||
#define $ac_tr_decl 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; } ; cat >>confdefs.h <<_ACEOF
|
||||
#define $ac_tr_decl 0
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# More time-related stuff.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct tms" >&5
|
||||
|
@ -17973,7 +17742,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 17975 "configure"
|
||||
#line 17744 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -18079,7 +17848,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 18081 "configure"
|
||||
#line 17850 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
|
|
@ -596,18 +596,6 @@ AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
|
|||
# Miscenalleous configure options
|
||||
# -------------------------------
|
||||
|
||||
# See if we are building gcc with C++.
|
||||
AC_ARG_ENABLE(build-with-cxx,
|
||||
[AS_HELP_STRING([--enable-build-with-cxx],
|
||||
[build with C++ compiler instead of C compiler])],
|
||||
ENABLE_BUILD_WITH_CXX=$enableval,
|
||||
ENABLE_BUILD_WITH_CXX=no)
|
||||
AC_SUBST(ENABLE_BUILD_WITH_CXX)
|
||||
if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
|
||||
AC_DEFINE(ENABLE_BUILD_WITH_CXX, 1,
|
||||
[Define if building with C++.])
|
||||
fi
|
||||
|
||||
# With stabs
|
||||
AC_ARG_WITH(stabs,
|
||||
[AS_HELP_STRING([--with-stabs],
|
||||
|
@ -1067,11 +1055,9 @@ AC_FUNC_FORK
|
|||
|
||||
# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
|
||||
# iconv() prototype.
|
||||
AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"],
|
||||
[AC_LANG_PUSH([C++])
|
||||
AM_ICONV
|
||||
AC_LANG_POP([C++])],
|
||||
[AM_ICONV])
|
||||
AC_LANG_PUSH([C++])
|
||||
AM_ICONV
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
# Until we have in-tree GNU iconv:
|
||||
LIBICONV_DEP=
|
||||
|
@ -1140,18 +1126,12 @@ gcc_AC_CHECK_DECLS(sigaltstack, , ,[
|
|||
|
||||
# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise()
|
||||
# prototype.
|
||||
AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"],
|
||||
[AC_LANG_PUSH([C++])
|
||||
gcc_AC_CHECK_DECLS(madvise, , ,[
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
])
|
||||
AC_LANG_POP([C++])],
|
||||
[gcc_AC_CHECK_DECLS(madvise, , ,[
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
])
|
||||
AC_LANG_PUSH([C++])
|
||||
gcc_AC_CHECK_DECLS(madvise, , ,[
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"
|
||||
])
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
# More time-related stuff.
|
||||
AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
|
||||
|
|
|
@ -196,5 +196,9 @@ enum memmodel
|
|||
/* Suppose that higher bits are target dependant. */
|
||||
#define MEMMODEL_MASK ((1<<16)-1)
|
||||
|
||||
/* Support for user-provided GGC and PCH markers. The first parameter
|
||||
is a pointer to a pointer, the second a cookie. */
|
||||
typedef void (*gt_pointer_operator) (void *, void *);
|
||||
|
||||
#endif /* coretypes.h */
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "ggc.h"
|
||||
#include "coverage.h"
|
||||
#include "langhooks.h"
|
||||
#include "hashtab.h"
|
||||
#include "hash-table.h"
|
||||
#include "tree-iterator.h"
|
||||
#include "cgraph.h"
|
||||
#include "dumpfile.h"
|
||||
|
@ -109,17 +109,11 @@ static unsigned bbg_file_stamp;
|
|||
/* Name of the count data (gcda) file. */
|
||||
static char *da_file_name;
|
||||
|
||||
/* Hash table of count data. */
|
||||
static htab_t counts_hash = NULL;
|
||||
|
||||
/* The names of merge functions for counters. */
|
||||
static const char *const ctr_merge_functions[GCOV_COUNTERS] = GCOV_MERGE_FUNCTIONS;
|
||||
static const char *const ctr_names[GCOV_COUNTERS] = GCOV_COUNTER_NAMES;
|
||||
|
||||
/* Forward declarations. */
|
||||
static hashval_t htab_counts_entry_hash (const void *);
|
||||
static int htab_counts_entry_eq (const void *, const void *);
|
||||
static void htab_counts_entry_del (void *);
|
||||
static void read_counts_file (void);
|
||||
static tree build_var (tree, tree, int);
|
||||
static void build_fn_info_type (tree, unsigned, tree);
|
||||
|
@ -149,32 +143,31 @@ get_gcov_unsigned_t (void)
|
|||
return lang_hooks.types.type_for_mode (mode, true);
|
||||
}
|
||||
|
||||
static hashval_t
|
||||
htab_counts_entry_hash (const void *of)
|
||||
inline hashval_t
|
||||
coverage_counts_entry_hash (const counts_entry_t *entry)
|
||||
{
|
||||
const counts_entry_t *const entry = (const counts_entry_t *) of;
|
||||
|
||||
return entry->ident * GCOV_COUNTERS + entry->ctr;
|
||||
}
|
||||
|
||||
static int
|
||||
htab_counts_entry_eq (const void *of1, const void *of2)
|
||||
inline int
|
||||
coverage_counts_entry_eq (const counts_entry_t *entry1,
|
||||
const counts_entry_t *entry2)
|
||||
{
|
||||
const counts_entry_t *const entry1 = (const counts_entry_t *) of1;
|
||||
const counts_entry_t *const entry2 = (const counts_entry_t *) of2;
|
||||
|
||||
return entry1->ident == entry2->ident && entry1->ctr == entry2->ctr;
|
||||
}
|
||||
|
||||
static void
|
||||
htab_counts_entry_del (void *of)
|
||||
inline void
|
||||
coverage_counts_entry_del (counts_entry_t *entry)
|
||||
{
|
||||
counts_entry_t *const entry = (counts_entry_t *) of;
|
||||
|
||||
free (entry->counts);
|
||||
free (entry);
|
||||
}
|
||||
|
||||
/* Hash table of count data. */
|
||||
static hash_table <counts_entry_t, coverage_counts_entry_hash,
|
||||
coverage_counts_entry_eq, coverage_counts_entry_del>
|
||||
counts_hash;
|
||||
|
||||
/* Read in the counts file, if available. */
|
||||
|
||||
static void
|
||||
|
@ -214,9 +207,7 @@ read_counts_file (void)
|
|||
tag = gcov_read_unsigned ();
|
||||
bbg_file_stamp = crc32_unsigned (bbg_file_stamp, tag);
|
||||
|
||||
counts_hash = htab_create (10,
|
||||
htab_counts_entry_hash, htab_counts_entry_eq,
|
||||
htab_counts_entry_del);
|
||||
counts_hash.create (10);
|
||||
while ((tag = gcov_read_unsigned ()))
|
||||
{
|
||||
gcov_unsigned_t length;
|
||||
|
@ -264,8 +255,7 @@ read_counts_file (void)
|
|||
elt.ident = fn_ident;
|
||||
elt.ctr = GCOV_COUNTER_FOR_TAG (tag);
|
||||
|
||||
slot = (counts_entry_t **) htab_find_slot
|
||||
(counts_hash, &elt, INSERT);
|
||||
slot = counts_hash.find_slot (&elt, INSERT);
|
||||
entry = *slot;
|
||||
if (!entry)
|
||||
{
|
||||
|
@ -285,14 +275,14 @@ read_counts_file (void)
|
|||
error ("checksum is (%x,%x) instead of (%x,%x)",
|
||||
entry->lineno_checksum, entry->cfg_checksum,
|
||||
lineno_checksum, cfg_checksum);
|
||||
htab_delete (counts_hash);
|
||||
counts_hash.dispose ();
|
||||
break;
|
||||
}
|
||||
else if (entry->summary.num != n_counts)
|
||||
{
|
||||
error ("Profile data for function %u is corrupted", fn_ident);
|
||||
error ("number of counters is %d instead of %d", entry->summary.num, n_counts);
|
||||
htab_delete (counts_hash);
|
||||
counts_hash.dispose ();
|
||||
break;
|
||||
}
|
||||
else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE)
|
||||
|
@ -318,7 +308,7 @@ read_counts_file (void)
|
|||
{
|
||||
error (is_error < 0 ? "%qs has overflowed" : "%qs is corrupted",
|
||||
da_file_name);
|
||||
htab_delete (counts_hash);
|
||||
counts_hash.dispose ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +326,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
|
|||
counts_entry_t *entry, elt;
|
||||
|
||||
/* No hash table, no counts. */
|
||||
if (!counts_hash)
|
||||
if (!counts_hash.is_created ())
|
||||
{
|
||||
static int warned = 0;
|
||||
|
||||
|
@ -350,7 +340,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
|
|||
|
||||
elt.ident = current_function_funcdef_no + 1;
|
||||
elt.ctr = counter;
|
||||
entry = (counts_entry_t *) htab_find (counts_hash, &elt);
|
||||
entry = counts_hash.find (&elt);
|
||||
if (!entry || !entry->summary.num)
|
||||
/* The function was not emitted, or is weak and not chosen in the
|
||||
final executable. Silently fail, because there's nothing we
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. Re-write VEC in C++.
|
||||
|
||||
* call.c (add_function_candidate): Remove const qualifier
|
||||
from call to VEC_index.
|
||||
|
||||
2012-08-10 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* error.c (dump_expr): Handle anonymous SSA names.
|
||||
|
|
|
@ -1924,7 +1924,8 @@ add_function_candidate (struct z_candidate **candidates,
|
|||
|
||||
for (i = 0; i < len; ++i)
|
||||
{
|
||||
tree arg, argtype, to_type;
|
||||
tree argtype, to_type;
|
||||
tree arg;
|
||||
conversion *t;
|
||||
int is_this;
|
||||
|
||||
|
@ -1934,8 +1935,9 @@ add_function_candidate (struct z_candidate **candidates,
|
|||
if (i == 0 && first_arg != NULL_TREE)
|
||||
arg = first_arg;
|
||||
else
|
||||
arg = VEC_index (tree, args,
|
||||
i + skip - (first_arg != NULL_TREE ? 1 : 0));
|
||||
arg = CONST_CAST_TREE (
|
||||
VEC_index (tree, args,
|
||||
i + skip - (first_arg != NULL_TREE ? 1 : 0)));
|
||||
argtype = lvalue_type (arg);
|
||||
|
||||
is_this = (i == 0 && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
|
||||
|
|
|
@ -8403,12 +8403,12 @@ build_vtbl_initializer (tree binfo,
|
|||
int new_position = (TARGET_VTABLE_DATA_ENTRY_DISTANCE * ix
|
||||
+ (TARGET_VTABLE_DATA_ENTRY_DISTANCE - 1));
|
||||
|
||||
VEC_replace (constructor_elt, vid.inits, new_position, e);
|
||||
VEC_replace (constructor_elt, vid.inits, new_position, *e);
|
||||
|
||||
for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j)
|
||||
{
|
||||
constructor_elt *f = VEC_index (constructor_elt, vid.inits,
|
||||
new_position - j);
|
||||
constructor_elt *f = &VEC_index (constructor_elt, vid.inits,
|
||||
new_position - j);
|
||||
f->index = NULL_TREE;
|
||||
f->value = build1 (NOP_EXPR, vtable_entry_type,
|
||||
null_pointer_node);
|
||||
|
@ -8429,7 +8429,7 @@ build_vtbl_initializer (tree binfo,
|
|||
for (ix = VEC_length (constructor_elt, vid.inits) - 1;
|
||||
VEC_iterate (constructor_elt, vid.inits, ix, e);
|
||||
ix--, jx++)
|
||||
VEC_replace (constructor_elt, *inits, jx, e);
|
||||
VEC_replace (constructor_elt, *inits, jx, *e);
|
||||
|
||||
/* Go through all the ordinary virtual functions, building up
|
||||
initializers. */
|
||||
|
|
|
@ -5282,7 +5282,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
|
|||
&& VEC_length (constructor_elt, CONSTRUCTOR_ELTS (str_init)) == 1)
|
||||
{
|
||||
str_init = VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (str_init), 0)->value;
|
||||
CONSTRUCTOR_ELTS (str_init), 0).value;
|
||||
}
|
||||
|
||||
/* If it's a string literal, then it's the initializer for the array
|
||||
|
@ -5372,7 +5372,7 @@ reshape_init (tree type, tree init, tsubst_flags_t complain)
|
|||
return init;
|
||||
|
||||
/* Recurse on this CONSTRUCTOR. */
|
||||
d.cur = VEC_index (constructor_elt, v, 0);
|
||||
d.cur = &VEC_index (constructor_elt, v, 0);
|
||||
d.end = d.cur + VEC_length (constructor_elt, v);
|
||||
|
||||
new_init = reshape_init_r (type, &d, true, complain);
|
||||
|
@ -5917,7 +5917,7 @@ type_dependent_init_p (tree init)
|
|||
nelts = VEC_length (constructor_elt, elts);
|
||||
for (i = 0; i < nelts; ++i)
|
||||
if (type_dependent_init_p (VEC_index (constructor_elt,
|
||||
elts, i)->value))
|
||||
elts, i).value))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -5947,7 +5947,7 @@ value_dependent_init_p (tree init)
|
|||
nelts = VEC_length (constructor_elt, elts);
|
||||
for (i = 0; i < nelts; ++i)
|
||||
if (value_dependent_init_p (VEC_index (constructor_elt,
|
||||
elts, i)->value))
|
||||
elts, i).value))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -6896,7 +6896,7 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
|||
&& !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (initial_value)))
|
||||
{
|
||||
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
tree value = VEC_index (constructor_elt, v, 0)->value;
|
||||
tree value = VEC_index (constructor_elt, v, 0).value;
|
||||
|
||||
if (TREE_CODE (value) == STRING_CST
|
||||
&& VEC_length (constructor_elt, v) == 1)
|
||||
|
|
|
@ -273,7 +273,7 @@ cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
|||
|
||||
if (start_token > VEC_address (cp_token, buffer))
|
||||
{
|
||||
cp_lexer_print_token (file, VEC_index (cp_token, buffer, 0));
|
||||
cp_lexer_print_token (file, &VEC_index (cp_token, buffer, 0));
|
||||
fprintf (file, " ... ");
|
||||
}
|
||||
|
||||
|
@ -313,8 +313,7 @@ cp_lexer_dump_tokens (FILE *file, VEC(cp_token,gc) *buffer,
|
|||
if (i == num && i < VEC_length (cp_token, buffer))
|
||||
{
|
||||
fprintf (file, " ... ");
|
||||
cp_lexer_print_token (file, VEC_index (cp_token, buffer,
|
||||
VEC_length (cp_token, buffer) - 1));
|
||||
cp_lexer_print_token (file, &VEC_last (cp_token, buffer));
|
||||
}
|
||||
|
||||
fprintf (file, "\n");
|
||||
|
@ -1723,11 +1722,11 @@ cp_parser_context_new (cp_parser_context* next)
|
|||
/* Managing the unparsed function queues. */
|
||||
|
||||
#define unparsed_funs_with_default_args \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->funs_with_default_args
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).funs_with_default_args
|
||||
#define unparsed_funs_with_definitions \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->funs_with_definitions
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).funs_with_definitions
|
||||
#define unparsed_nsdmis \
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->nsdmis
|
||||
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues).nsdmis
|
||||
|
||||
static void
|
||||
push_unparsed_function_queues (cp_parser *parser)
|
||||
|
@ -8048,7 +8047,7 @@ record_lambda_scope (tree lambda)
|
|||
static void
|
||||
finish_lambda_scope (void)
|
||||
{
|
||||
tree_int *p = VEC_last (tree_int, lambda_scope_stack);
|
||||
tree_int *p = &VEC_last (tree_int, lambda_scope_stack);
|
||||
if (lambda_scope != p->t)
|
||||
{
|
||||
lambda_scope = p->t;
|
||||
|
|
|
@ -295,7 +295,7 @@ typeid_ok_p (void)
|
|||
}
|
||||
|
||||
pseudo_type_info
|
||||
= VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE)->type;
|
||||
= VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE).type;
|
||||
type_info_type = TYPE_MAIN_VARIANT (const_type_info_type_node);
|
||||
|
||||
/* Make sure abi::__type_info_pseudo has the same alias set
|
||||
|
@ -422,7 +422,7 @@ get_tinfo_decl (tree type)
|
|||
if (!d)
|
||||
{
|
||||
int ix = get_pseudo_ti_index (type);
|
||||
tinfo_s *ti = VEC_index (tinfo_s, tinfo_descs, ix);
|
||||
tinfo_s *ti = &VEC_index (tinfo_s, tinfo_descs, ix);
|
||||
|
||||
d = build_lang_decl (VAR_DECL, name, ti->type);
|
||||
SET_DECL_ASSEMBLER_NAME (d, name);
|
||||
|
@ -1079,7 +1079,7 @@ typeinfo_in_lib_p (tree type)
|
|||
static tree
|
||||
get_pseudo_ti_init (tree type, unsigned tk_index)
|
||||
{
|
||||
tinfo_s *ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
tinfo_s *ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
|
||||
gcc_assert (at_eof);
|
||||
switch (tk_index)
|
||||
|
@ -1105,7 +1105,7 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
||||
|
||||
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
|
||||
ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
return class_initializer (ti, type, 1, tinfo);
|
||||
}
|
||||
|
||||
|
@ -1160,14 +1160,14 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
|
|||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, tinfo);
|
||||
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, offset);
|
||||
base_init = build_constructor (init_list_type_node, v);
|
||||
e = VEC_index (constructor_elt, init_vec, ix);
|
||||
e = &VEC_index (constructor_elt, init_vec, ix);
|
||||
e->index = NULL_TREE;
|
||||
e->value = base_init;
|
||||
}
|
||||
base_inits = build_constructor (init_list_type_node, init_vec);
|
||||
|
||||
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
|
||||
ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk_index);
|
||||
return class_initializer (ti, type, 3,
|
||||
build_int_cst (NULL_TREE, hint),
|
||||
build_int_cst (NULL_TREE, nbases),
|
||||
|
@ -1214,7 +1214,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
|
|||
fields = build_decl (input_location,
|
||||
FIELD_DECL, NULL_TREE,
|
||||
VEC_index (tinfo_s, tinfo_descs,
|
||||
TK_TYPE_INFO_TYPE)->type);
|
||||
TK_TYPE_INFO_TYPE).type);
|
||||
|
||||
/* Now add the derived fields. */
|
||||
while ((field_decl = va_arg (ap, tree)))
|
||||
|
@ -1228,7 +1228,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
|
|||
finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
|
||||
CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
|
||||
|
||||
ti = VEC_index (tinfo_s, tinfo_descs, tk);
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, tk);
|
||||
ti->type = cp_build_qualified_type (pseudo_type, TYPE_QUAL_CONST);
|
||||
ti->name = get_identifier (real_name);
|
||||
ti->vtable = NULL_TREE;
|
||||
|
@ -1321,7 +1321,7 @@ get_pseudo_ti_index (tree type)
|
|||
while (VEC_iterate (tinfo_s, tinfo_descs, len++, ti))
|
||||
ti->type = ti->vtable = ti->name = NULL_TREE;
|
||||
}
|
||||
else if (VEC_index (tinfo_s, tinfo_descs, ix)->type)
|
||||
else if (VEC_index (tinfo_s, tinfo_descs, ix).type)
|
||||
/* already created. */
|
||||
break;
|
||||
|
||||
|
@ -1335,7 +1335,7 @@ get_pseudo_ti_index (tree type)
|
|||
array_domain = build_index_type (size_int (num_bases));
|
||||
base_array =
|
||||
build_array_type (VEC_index (tinfo_s, tinfo_descs,
|
||||
TK_BASE_TYPE)->type,
|
||||
TK_BASE_TYPE).type,
|
||||
array_domain);
|
||||
|
||||
push_abi_namespace ();
|
||||
|
@ -1387,7 +1387,7 @@ create_tinfo_types (void)
|
|||
DECL_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
ti = VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE);
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE);
|
||||
ti->type = make_class_type (RECORD_TYPE);
|
||||
ti->vtable = NULL_TREE;
|
||||
ti->name = NULL_TREE;
|
||||
|
@ -1427,7 +1427,7 @@ create_tinfo_types (void)
|
|||
DECL_CHAIN (field) = fields;
|
||||
fields = field;
|
||||
|
||||
ti = VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE);
|
||||
ti = &VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE);
|
||||
|
||||
ti->type = make_class_type (RECORD_TYPE);
|
||||
ti->vtable = NULL_TREE;
|
||||
|
|
|
@ -161,7 +161,7 @@ resume_deferring_access_checks (void)
|
|||
{
|
||||
if (!deferred_access_no_check)
|
||||
VEC_last (deferred_access, deferred_access_stack)
|
||||
->deferring_access_checks_kind = dk_deferred;
|
||||
.deferring_access_checks_kind = dk_deferred;
|
||||
}
|
||||
|
||||
/* Stop deferring access checks. */
|
||||
|
@ -171,7 +171,7 @@ stop_deferring_access_checks (void)
|
|||
{
|
||||
if (!deferred_access_no_check)
|
||||
VEC_last (deferred_access, deferred_access_stack)
|
||||
->deferring_access_checks_kind = dk_no_deferred;
|
||||
.deferring_access_checks_kind = dk_no_deferred;
|
||||
}
|
||||
|
||||
/* Discard the current deferred access checks and restore the
|
||||
|
@ -198,7 +198,7 @@ get_deferred_access_checks (void)
|
|||
return NULL;
|
||||
else
|
||||
return (VEC_last (deferred_access, deferred_access_stack)
|
||||
->deferred_access_checks);
|
||||
.deferred_access_checks);
|
||||
}
|
||||
|
||||
/* Take current deferred checks and combine with the
|
||||
|
@ -216,10 +216,10 @@ pop_to_parent_deferring_access_checks (void)
|
|||
deferred_access *ptr;
|
||||
|
||||
checks = (VEC_last (deferred_access, deferred_access_stack)
|
||||
->deferred_access_checks);
|
||||
.deferred_access_checks);
|
||||
|
||||
VEC_pop (deferred_access, deferred_access_stack);
|
||||
ptr = VEC_last (deferred_access, deferred_access_stack);
|
||||
ptr = &VEC_last (deferred_access, deferred_access_stack);
|
||||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
{
|
||||
/* Check access. */
|
||||
|
@ -321,7 +321,7 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
|
|||
|
||||
gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
|
||||
|
||||
ptr = VEC_last (deferred_access, deferred_access_stack);
|
||||
ptr = &VEC_last (deferred_access, deferred_access_stack);
|
||||
|
||||
/* If we are not supposed to defer access checks, just check now. */
|
||||
if (ptr->deferring_access_checks_kind == dk_no_deferred)
|
||||
|
@ -5948,7 +5948,7 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
|
|||
if (VEC_length (constructor_elt, vec) > 0)
|
||||
{
|
||||
/* In a delegating constructor, return the target. */
|
||||
constructor_elt *ce = VEC_index (constructor_elt, vec, 0);
|
||||
constructor_elt *ce = &VEC_index (constructor_elt, vec, 0);
|
||||
if (ce->index == current_class_ptr)
|
||||
{
|
||||
body = ce->value;
|
||||
|
@ -6820,7 +6820,7 @@ cxx_eval_array_reference (const constexpr_call *call, tree t,
|
|||
}
|
||||
i = tree_low_cst (index, 0);
|
||||
if (TREE_CODE (ary) == CONSTRUCTOR)
|
||||
return VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ary), i)->value;
|
||||
return VEC_index (constructor_elt, CONSTRUCTOR_ELTS (ary), i).value;
|
||||
else if (elem_nchars == 1)
|
||||
return build_int_cst (cv_unqualified (TREE_TYPE (TREE_TYPE (ary))),
|
||||
TREE_STRING_POINTER (ary)[i]);
|
||||
|
|
|
@ -1337,7 +1337,7 @@ strip_typedefs_expr (tree t)
|
|||
type = strip_typedefs (TREE_TYPE (t));
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
constructor_elt *e = VEC_index (constructor_elt, vec, i);
|
||||
constructor_elt *e = &VEC_index (constructor_elt, vec, i);
|
||||
tree op = strip_typedefs_expr (e->value);
|
||||
if (op != e->value)
|
||||
{
|
||||
|
|
|
@ -1178,7 +1178,7 @@ process_init_constructor_record (tree type, tree init,
|
|||
|
||||
if (idx < VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)))
|
||||
{
|
||||
constructor_elt *ce = VEC_index (constructor_elt,
|
||||
constructor_elt *ce = &VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (init), idx);
|
||||
if (ce->index)
|
||||
{
|
||||
|
@ -1305,7 +1305,7 @@ process_init_constructor_union (tree type, tree init,
|
|||
VEC_block_remove (constructor_elt, CONSTRUCTOR_ELTS (init), 1, len-1);
|
||||
}
|
||||
|
||||
ce = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), 0);
|
||||
ce = &VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), 0);
|
||||
|
||||
/* If this element specifies a field, initialize via that field. */
|
||||
if (ce->index)
|
||||
|
|
|
@ -4448,7 +4448,6 @@ df_bb_verify (basic_block bb)
|
|||
if (!INSN_P (insn))
|
||||
continue;
|
||||
df_insn_refs_verify (&collection_rec, bb, insn, true);
|
||||
df_free_collection_rec (&collection_rec);
|
||||
}
|
||||
|
||||
/* Do the artificial defs and uses. */
|
||||
|
|
143
gcc/doc/gty.texi
143
gcc/doc/gty.texi
|
@ -13,17 +13,17 @@ involve determining information about GCC's data structures from GCC's
|
|||
source code and using this information to perform garbage collection and
|
||||
implement precompiled headers.
|
||||
|
||||
A full C parser would be too complicated for this task, so a limited
|
||||
subset of C is interpreted and special markers are used to determine
|
||||
what parts of the source to look at. All @code{struct} and
|
||||
@code{union} declarations that define data structures that are
|
||||
allocated under control of the garbage collector must be marked. All
|
||||
global variables that hold pointers to garbage-collected memory must
|
||||
also be marked. Finally, all global variables that need to be saved
|
||||
and restored by a precompiled header must be marked. (The precompiled
|
||||
header mechanism can only save static variables if they're scalar.
|
||||
Complex data structures must be allocated in garbage-collected memory
|
||||
to be saved in a precompiled header.)
|
||||
A full C++ parser would be too complicated for this task, so a limited
|
||||
subset of C++ is interpreted and special markers are used to determine
|
||||
what parts of the source to look at. All @code{struct}, @code{union}
|
||||
and @code{template} structure declarations that define data structures
|
||||
that are allocated under control of the garbage collector must be
|
||||
marked. All global variables that hold pointers to garbage-collected
|
||||
memory must also be marked. Finally, all global variables that need
|
||||
to be saved and restored by a precompiled header must be marked. (The
|
||||
precompiled header mechanism can only save static variables if they're
|
||||
scalar. Complex data structures must be allocated in garbage-collected
|
||||
memory to be saved in a precompiled header.)
|
||||
|
||||
The full format of a marker is
|
||||
@smallexample
|
||||
|
@ -68,6 +68,7 @@ These don't need to be marked.
|
|||
@menu
|
||||
* GTY Options:: What goes inside a @code{GTY(())}.
|
||||
* GGC Roots:: Making global variables GGC roots.
|
||||
* User GC:: Adding user-provided GC marking routines.
|
||||
* Files:: How the generated files work.
|
||||
* Invoking the garbage collector:: How to invoke the garbage collector.
|
||||
* Troubleshooting:: When something does not work as expected.
|
||||
|
@ -440,8 +441,128 @@ The @code{special} option is used to mark types that have to be dealt
|
|||
with by special case machinery. The parameter is the name of the
|
||||
special case. See @file{gengtype.c} for further details. Avoid
|
||||
adding new special cases unless there is no other alternative.
|
||||
|
||||
@findex user
|
||||
@item user
|
||||
|
||||
The @code{user} option indicates that the code to mark structure
|
||||
fields is completely handled by user-provided routines. See section
|
||||
@ref{User GC} for details on what functions need to be provided.
|
||||
@end table
|
||||
|
||||
@node User GC
|
||||
@section Support for user-provided GC marking routines
|
||||
@cindex user gc
|
||||
The garbage collector supports types for which no automatic marking
|
||||
code is generated. For these types, the user is required to provide
|
||||
three functions: one to act as a marker for garbage collection, and
|
||||
two functions to act as marker and pointer walker for pre-compiled
|
||||
headers.
|
||||
|
||||
Given a structure @code{struct GTY((user)) my_struct}, the following functions
|
||||
should be defined to mark @code{my_struct}:
|
||||
|
||||
@smallexample
|
||||
void gt_ggc_mx (my_struct *p)
|
||||
@{
|
||||
/* This marks field 'fld'. */
|
||||
gt_ggc_mx (p->fld);
|
||||
@}
|
||||
|
||||
void gt_pch_nx (my_struct *p)
|
||||
@{
|
||||
/* This marks field 'fld'. */
|
||||
gt_pch_nx (tp->fld);
|
||||
@}
|
||||
|
||||
void gt_pch_nx (my_struct *p, gt_pointer_operator op, void *cookie)
|
||||
@{
|
||||
/* For every field 'fld', call the given pointer operator. */
|
||||
op (&(tp->fld), cookie);
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
In general, each marker @code{M} should call @code{M} for every
|
||||
pointer field in the structure. Fields that are not allocated in GC
|
||||
or are not pointers must be ignored.
|
||||
|
||||
For embedded lists (e.g., structures with a @code{next} or @code{prev}
|
||||
pointer), the marker must follow the chain and mark every element in
|
||||
it.
|
||||
|
||||
Note that the rules for the pointer walker @code{gt_pch_nx (my_struct
|
||||
*, gt_pointer_operator, void *)} are slightly different. In this
|
||||
case, the operation @code{op} must be applied to the @emph{address} of
|
||||
every pointer field.
|
||||
|
||||
@section User-provided marking routines for template types
|
||||
When a template type @code{TP} is marked with @code{GTY}, all
|
||||
instances of that type are considered user-provided types. This means
|
||||
that the individual instances of @code{TP} do not need to be marked
|
||||
with @code{GTY}. The user needs to provide template functions to mark
|
||||
all the fields of the type.
|
||||
|
||||
The following code snippets represent all the functions that need to
|
||||
be provided. Note that type @code{TP} may reference to more than one
|
||||
type. In these snippets, there is only one type @code{T}, but there
|
||||
could be more.
|
||||
|
||||
@smallexample
|
||||
template<typename T>
|
||||
void gt_ggc_mx (TP<T> *tp)
|
||||
@{
|
||||
extern void gt_ggc_mx (T&);
|
||||
|
||||
/* This marks field 'fld' of type 'T'. */
|
||||
gt_ggc_mx (tp->fld);
|
||||
@}
|
||||
|
||||
template<typename T>
|
||||
void gt_pch_nx (TP<T> *tp)
|
||||
@{
|
||||
extern void gt_pch_nx (T&);
|
||||
|
||||
/* This marks field 'fld' of type 'T'. */
|
||||
gt_pch_nx (tp->fld);
|
||||
@}
|
||||
|
||||
template<typename T>
|
||||
void gt_pch_nx (TP<T *> *tp, gt_pointer_operator op, void *cookie)
|
||||
@{
|
||||
/* For every field 'fld' of 'tp' with type 'T *', call the given
|
||||
pointer operator. */
|
||||
op (&(tp->fld), cookie);
|
||||
@}
|
||||
|
||||
template<typename T>
|
||||
void gt_pch_nx (TP<T> *tp, gt_pointer_operator, void *cookie)
|
||||
@{
|
||||
extern void gt_pch_nx (T *, gt_pointer_operator, void *);
|
||||
|
||||
/* For every field 'fld' of 'tp' with type 'T', call the pointer
|
||||
walker for all the fields of T. */
|
||||
gt_pch_nx (&(tp->fld), op, cookie);
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
Support for user-defined types is currently limited. The following
|
||||
restrictions apply:
|
||||
|
||||
@enumerate
|
||||
@item Type @code{TP} and all the argument types @code{T} must be
|
||||
marked with @code{GTY}.
|
||||
|
||||
@item Type @code{TP} can only have type names in its argument list.
|
||||
|
||||
@item The pointer walker functions are different for @code{TP<T>} and
|
||||
@code{TP<T *>}. In the case of @code{TP<T>}, references to
|
||||
@code{T} must be handled by calling @code{gt_pch_nx} (which
|
||||
will, in turn, walk all the pointers inside fields of @code{T}).
|
||||
In the case of @code{TP<T *>}, references to @code{T *} must be
|
||||
handled by calling the @code{op} function on the address of the
|
||||
pointer (see the code snippets above).
|
||||
@end enumerate
|
||||
|
||||
@node GGC Roots
|
||||
@section Marking Roots for the Garbage Collector
|
||||
@cindex roots, marking
|
||||
|
|
|
@ -1288,16 +1288,6 @@ opposite effect. If neither option is specified, the configure script
|
|||
will try to guess whether the @code{.init_array} and
|
||||
@code{.fini_array} sections are supported and, if they are, use them.
|
||||
|
||||
@item --enable-build-with-cxx
|
||||
Build GCC using a C++ compiler rather than a C compiler. This is an
|
||||
experimental option which may become the default in a later release.
|
||||
|
||||
@item --enable-build-poststage1-with-cxx
|
||||
When bootstrapping, build stages 2 and 3 of GCC using a C++ compiler
|
||||
rather than a C compiler. Stage 1 is still built with a C compiler.
|
||||
This is enabled by default and may be disabled using
|
||||
@option{--disable-build-poststage1-with-cxx}.
|
||||
|
||||
@item --enable-maintainer-mode
|
||||
The build rules that regenerate the Autoconf and Automake output files as
|
||||
well as the GCC master message catalog @file{gcc.pot} are normally
|
||||
|
|
300
gcc/double-int.c
300
gcc/double-int.c
|
@ -610,7 +610,7 @@ div_and_round_double (unsigned code, int uns,
|
|||
/* Returns mask for PREC bits. */
|
||||
|
||||
double_int
|
||||
double_int_mask (unsigned prec)
|
||||
double_int::mask (unsigned prec)
|
||||
{
|
||||
unsigned HOST_WIDE_INT m;
|
||||
double_int mask;
|
||||
|
@ -635,20 +635,20 @@ double_int_mask (unsigned prec)
|
|||
of precision PREC. */
|
||||
|
||||
double_int
|
||||
double_int_max_value (unsigned int prec, bool uns)
|
||||
double_int::max_value (unsigned int prec, bool uns)
|
||||
{
|
||||
return double_int_mask (prec - (uns ? 0 : 1));
|
||||
return double_int::mask (prec - (uns ? 0 : 1));
|
||||
}
|
||||
|
||||
/* Returns a minimum value for signed or unsigned integer
|
||||
of precision PREC. */
|
||||
|
||||
double_int
|
||||
double_int_min_value (unsigned int prec, bool uns)
|
||||
double_int::min_value (unsigned int prec, bool uns)
|
||||
{
|
||||
if (uns)
|
||||
return double_int_zero;
|
||||
return double_int_lshift (double_int_one, prec - 1, prec, false);
|
||||
return double_int_one.lshift (prec - 1, prec, false);
|
||||
}
|
||||
|
||||
/* Clears the bits of CST over the precision PREC. If UNS is false, the bits
|
||||
|
@ -659,20 +659,21 @@ double_int_min_value (unsigned int prec, bool uns)
|
|||
of CST, with the given signedness. */
|
||||
|
||||
double_int
|
||||
double_int_ext (double_int cst, unsigned prec, bool uns)
|
||||
double_int::ext (unsigned prec, bool uns) const
|
||||
{
|
||||
if (uns)
|
||||
return double_int_zext (cst, prec);
|
||||
return this->zext (prec);
|
||||
else
|
||||
return double_int_sext (cst, prec);
|
||||
return this->sext (prec);
|
||||
}
|
||||
|
||||
/* The same as double_int_ext with UNS = true. */
|
||||
/* The same as double_int::ext with UNS = true. */
|
||||
|
||||
double_int
|
||||
double_int_zext (double_int cst, unsigned prec)
|
||||
double_int::zext (unsigned prec) const
|
||||
{
|
||||
double_int mask = double_int_mask (prec);
|
||||
const double_int &cst = *this;
|
||||
double_int mask = double_int::mask (prec);
|
||||
double_int r;
|
||||
|
||||
r.low = cst.low & mask.low;
|
||||
|
@ -681,12 +682,13 @@ double_int_zext (double_int cst, unsigned prec)
|
|||
return r;
|
||||
}
|
||||
|
||||
/* The same as double_int_ext with UNS = false. */
|
||||
/* The same as double_int::ext with UNS = false. */
|
||||
|
||||
double_int
|
||||
double_int_sext (double_int cst, unsigned prec)
|
||||
double_int::sext (unsigned prec) const
|
||||
{
|
||||
double_int mask = double_int_mask (prec);
|
||||
const double_int &cst = *this;
|
||||
double_int mask = double_int::mask (prec);
|
||||
double_int r;
|
||||
unsigned HOST_WIDE_INT snum;
|
||||
|
||||
|
@ -714,8 +716,9 @@ double_int_sext (double_int cst, unsigned prec)
|
|||
/* Returns true if CST fits in signed HOST_WIDE_INT. */
|
||||
|
||||
bool
|
||||
double_int_fits_in_shwi_p (double_int cst)
|
||||
double_int::fits_signed () const
|
||||
{
|
||||
const double_int &cst = *this;
|
||||
if (cst.high == 0)
|
||||
return (HOST_WIDE_INT) cst.low >= 0;
|
||||
else if (cst.high == -1)
|
||||
|
@ -728,19 +731,20 @@ double_int_fits_in_shwi_p (double_int cst)
|
|||
unsigned HOST_WIDE_INT if UNS is true. */
|
||||
|
||||
bool
|
||||
double_int_fits_in_hwi_p (double_int cst, bool uns)
|
||||
double_int::fits (bool uns) const
|
||||
{
|
||||
if (uns)
|
||||
return double_int_fits_in_uhwi_p (cst);
|
||||
return this->fits_unsigned ();
|
||||
else
|
||||
return double_int_fits_in_shwi_p (cst);
|
||||
return this->fits_signed ();
|
||||
}
|
||||
|
||||
/* Returns A * B. */
|
||||
|
||||
double_int
|
||||
double_int_mul (double_int a, double_int b)
|
||||
double_int::operator * (double_int b) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
mul_double (a.low, a.high, b.low, b.high, &ret.low, &ret.high);
|
||||
return ret;
|
||||
|
@ -750,9 +754,9 @@ double_int_mul (double_int a, double_int b)
|
|||
*OVERFLOW is set to nonzero. */
|
||||
|
||||
double_int
|
||||
double_int_mul_with_sign (double_int a, double_int b,
|
||||
bool unsigned_p, int *overflow)
|
||||
double_int::mul_with_sign (double_int b, bool unsigned_p, int *overflow) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
*overflow = mul_double_with_sign (a.low, a.high, b.low, b.high,
|
||||
&ret.low, &ret.high, unsigned_p);
|
||||
|
@ -762,8 +766,9 @@ double_int_mul_with_sign (double_int a, double_int b,
|
|||
/* Returns A + B. */
|
||||
|
||||
double_int
|
||||
double_int_add (double_int a, double_int b)
|
||||
double_int::operator + (double_int b) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
add_double (a.low, a.high, b.low, b.high, &ret.low, &ret.high);
|
||||
return ret;
|
||||
|
@ -772,8 +777,9 @@ double_int_add (double_int a, double_int b)
|
|||
/* Returns A - B. */
|
||||
|
||||
double_int
|
||||
double_int_sub (double_int a, double_int b)
|
||||
double_int::operator - (double_int b) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
neg_double (b.low, b.high, &b.low, &b.high);
|
||||
add_double (a.low, a.high, b.low, b.high, &ret.low, &ret.high);
|
||||
|
@ -783,8 +789,9 @@ double_int_sub (double_int a, double_int b)
|
|||
/* Returns -A. */
|
||||
|
||||
double_int
|
||||
double_int_neg (double_int a)
|
||||
double_int::operator - () const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
neg_double (a.low, a.high, &ret.low, &ret.high);
|
||||
return ret;
|
||||
|
@ -796,9 +803,10 @@ double_int_neg (double_int a)
|
|||
stored to MOD. */
|
||||
|
||||
double_int
|
||||
double_int_divmod (double_int a, double_int b, bool uns, unsigned code,
|
||||
double_int *mod)
|
||||
double_int::divmod (double_int b, bool uns, unsigned code,
|
||||
double_int *mod) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
|
||||
div_and_round_double (code, uns, a.low, a.high,
|
||||
|
@ -807,20 +815,20 @@ double_int_divmod (double_int a, double_int b, bool uns, unsigned code,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* The same as double_int_divmod with UNS = false. */
|
||||
/* The same as double_int::divmod with UNS = false. */
|
||||
|
||||
double_int
|
||||
double_int_sdivmod (double_int a, double_int b, unsigned code, double_int *mod)
|
||||
double_int::sdivmod (double_int b, unsigned code, double_int *mod) const
|
||||
{
|
||||
return double_int_divmod (a, b, false, code, mod);
|
||||
return this->divmod (b, false, code, mod);
|
||||
}
|
||||
|
||||
/* The same as double_int_divmod with UNS = true. */
|
||||
/* The same as double_int::divmod with UNS = true. */
|
||||
|
||||
double_int
|
||||
double_int_udivmod (double_int a, double_int b, unsigned code, double_int *mod)
|
||||
double_int::udivmod (double_int b, unsigned code, double_int *mod) const
|
||||
{
|
||||
return double_int_divmod (a, b, true, code, mod);
|
||||
return this->divmod (b, true, code, mod);
|
||||
}
|
||||
|
||||
/* Returns A / B (computed as unsigned depending on UNS, and rounded as
|
||||
|
@ -828,27 +836,27 @@ double_int_udivmod (double_int a, double_int b, unsigned code, double_int *mod)
|
|||
must be included before tree.h. */
|
||||
|
||||
double_int
|
||||
double_int_div (double_int a, double_int b, bool uns, unsigned code)
|
||||
double_int::div (double_int b, bool uns, unsigned code) const
|
||||
{
|
||||
double_int mod;
|
||||
|
||||
return double_int_divmod (a, b, uns, code, &mod);
|
||||
return this->divmod (b, uns, code, &mod);
|
||||
}
|
||||
|
||||
/* The same as double_int_div with UNS = false. */
|
||||
/* The same as double_int::div with UNS = false. */
|
||||
|
||||
double_int
|
||||
double_int_sdiv (double_int a, double_int b, unsigned code)
|
||||
double_int::sdiv (double_int b, unsigned code) const
|
||||
{
|
||||
return double_int_div (a, b, false, code);
|
||||
return this->div (b, false, code);
|
||||
}
|
||||
|
||||
/* The same as double_int_div with UNS = true. */
|
||||
/* The same as double_int::div with UNS = true. */
|
||||
|
||||
double_int
|
||||
double_int_udiv (double_int a, double_int b, unsigned code)
|
||||
double_int::udiv (double_int b, unsigned code) const
|
||||
{
|
||||
return double_int_div (a, b, true, code);
|
||||
return this->div (b, true, code);
|
||||
}
|
||||
|
||||
/* Returns A % B (computed as unsigned depending on UNS, and rounded as
|
||||
|
@ -856,28 +864,28 @@ double_int_udiv (double_int a, double_int b, unsigned code)
|
|||
must be included before tree.h. */
|
||||
|
||||
double_int
|
||||
double_int_mod (double_int a, double_int b, bool uns, unsigned code)
|
||||
double_int::mod (double_int b, bool uns, unsigned code) const
|
||||
{
|
||||
double_int mod;
|
||||
|
||||
double_int_divmod (a, b, uns, code, &mod);
|
||||
this->divmod (b, uns, code, &mod);
|
||||
return mod;
|
||||
}
|
||||
|
||||
/* The same as double_int_mod with UNS = false. */
|
||||
/* The same as double_int::mod with UNS = false. */
|
||||
|
||||
double_int
|
||||
double_int_smod (double_int a, double_int b, unsigned code)
|
||||
double_int::smod (double_int b, unsigned code) const
|
||||
{
|
||||
return double_int_mod (a, b, false, code);
|
||||
return this->mod (b, false, code);
|
||||
}
|
||||
|
||||
/* The same as double_int_mod with UNS = true. */
|
||||
/* The same as double_int::mod with UNS = true. */
|
||||
|
||||
double_int
|
||||
double_int_umod (double_int a, double_int b, unsigned code)
|
||||
double_int::umod (double_int b, unsigned code) const
|
||||
{
|
||||
return double_int_mod (a, b, true, code);
|
||||
return this->mod (b, true, code);
|
||||
}
|
||||
|
||||
/* Return TRUE iff PRODUCT is an integral multiple of FACTOR, and return
|
||||
|
@ -885,13 +893,13 @@ double_int_umod (double_int a, double_int b, unsigned code)
|
|||
unchanged. */
|
||||
|
||||
bool
|
||||
double_int_multiple_of (double_int product, double_int factor,
|
||||
bool unsigned_p, double_int *multiple)
|
||||
double_int::multiple_of (double_int factor,
|
||||
bool unsigned_p, double_int *multiple) const
|
||||
{
|
||||
double_int remainder;
|
||||
double_int quotient = double_int_divmod (product, factor, unsigned_p,
|
||||
double_int quotient = this->divmod (factor, unsigned_p,
|
||||
TRUNC_DIV_EXPR, &remainder);
|
||||
if (double_int_zero_p (remainder))
|
||||
if (remainder.is_zero ())
|
||||
{
|
||||
*multiple = quotient;
|
||||
return true;
|
||||
|
@ -902,8 +910,9 @@ double_int_multiple_of (double_int product, double_int factor,
|
|||
|
||||
/* Set BITPOS bit in A. */
|
||||
double_int
|
||||
double_int_setbit (double_int a, unsigned bitpos)
|
||||
double_int::set_bit (unsigned bitpos) const
|
||||
{
|
||||
double_int a = *this;
|
||||
if (bitpos < HOST_BITS_PER_WIDE_INT)
|
||||
a.low |= (unsigned HOST_WIDE_INT) 1 << bitpos;
|
||||
else
|
||||
|
@ -914,8 +923,9 @@ double_int_setbit (double_int a, unsigned bitpos)
|
|||
|
||||
/* Count trailing zeros in A. */
|
||||
int
|
||||
double_int_ctz (double_int a)
|
||||
double_int::trailing_zeros () const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
unsigned HOST_WIDE_INT w = a.low ? a.low : (unsigned HOST_WIDE_INT) a.high;
|
||||
unsigned bits = a.low ? 0 : HOST_BITS_PER_WIDE_INT;
|
||||
if (!w)
|
||||
|
@ -929,30 +939,76 @@ double_int_ctz (double_int a)
|
|||
otherwise use logical shift. */
|
||||
|
||||
double_int
|
||||
double_int_lshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith)
|
||||
double_int::lshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
lshift_double (a.low, a.high, count, prec, &ret.low, &ret.high, arith);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Shift A rigth by COUNT places keeping only PREC bits of result. Shift
|
||||
/* Shift A right by COUNT places keeping only PREC bits of result. Shift
|
||||
left if COUNT is negative. ARITH true specifies arithmetic shifting;
|
||||
otherwise use logical shift. */
|
||||
|
||||
double_int
|
||||
double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith)
|
||||
double_int::rshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
double_int ret;
|
||||
lshift_double (a.low, a.high, -count, prec, &ret.low, &ret.high, arith);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Arithmetic shift A left by COUNT places keeping only PREC bits of result.
|
||||
Shift right if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int::alshift (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int r;
|
||||
lshift_double (low, high, count, prec, &r.low, &r.high, true);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Arithmetic shift A right by COUNT places keeping only PREC bits of result.
|
||||
Shift left if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int::arshift (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int r;
|
||||
lshift_double (low, high, -count, prec, &r.low, &r.high, true);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Logical shift A left by COUNT places keeping only PREC bits of result.
|
||||
Shift right if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int::llshift (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int r;
|
||||
lshift_double (low, high, count, prec, &r.low, &r.high, false);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Logical shift A right by COUNT places keeping only PREC bits of result.
|
||||
Shift left if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int::lrshift (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int r;
|
||||
lshift_double (low, high, -count, prec, &r.low, &r.high, false);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Rotate A left by COUNT places keeping only PREC bits of result.
|
||||
Rotate right if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int_lrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
||||
double_int::lrotate (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int t1, t2;
|
||||
|
||||
|
@ -960,17 +1016,17 @@ double_int_lrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
|||
if (count < 0)
|
||||
count += prec;
|
||||
|
||||
t1 = double_int_lshift (a, count, prec, false);
|
||||
t2 = double_int_rshift (a, prec - count, prec, false);
|
||||
t1 = this->lshift (count, prec, false);
|
||||
t2 = this->rshift (prec - count, prec, false);
|
||||
|
||||
return double_int_ior (t1, t2);
|
||||
return t1 | t2;
|
||||
}
|
||||
|
||||
/* Rotate A rigth by COUNT places keeping only PREC bits of result.
|
||||
Rotate right if COUNT is negative. */
|
||||
|
||||
double_int
|
||||
double_int_rrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
||||
double_int::rrotate (HOST_WIDE_INT count, unsigned int prec) const
|
||||
{
|
||||
double_int t1, t2;
|
||||
|
||||
|
@ -978,30 +1034,31 @@ double_int_rrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
|||
if (count < 0)
|
||||
count += prec;
|
||||
|
||||
t1 = double_int_rshift (a, count, prec, false);
|
||||
t2 = double_int_lshift (a, prec - count, prec, false);
|
||||
t1 = this->rshift (count, prec, false);
|
||||
t2 = this->lshift (prec - count, prec, false);
|
||||
|
||||
return double_int_ior (t1, t2);
|
||||
return t1 | t2;
|
||||
}
|
||||
|
||||
/* Returns -1 if A < B, 0 if A == B and 1 if A > B. Signedness of the
|
||||
comparison is given by UNS. */
|
||||
|
||||
int
|
||||
double_int_cmp (double_int a, double_int b, bool uns)
|
||||
double_int::cmp (double_int b, bool uns) const
|
||||
{
|
||||
if (uns)
|
||||
return double_int_ucmp (a, b);
|
||||
return this->ucmp (b);
|
||||
else
|
||||
return double_int_scmp (a, b);
|
||||
return this->scmp (b);
|
||||
}
|
||||
|
||||
/* Compares two unsigned values A and B. Returns -1 if A < B, 0 if A == B,
|
||||
and 1 if A > B. */
|
||||
|
||||
int
|
||||
double_int_ucmp (double_int a, double_int b)
|
||||
double_int::ucmp (double_int b) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
if ((unsigned HOST_WIDE_INT) a.high < (unsigned HOST_WIDE_INT) b.high)
|
||||
return -1;
|
||||
if ((unsigned HOST_WIDE_INT) a.high > (unsigned HOST_WIDE_INT) b.high)
|
||||
|
@ -1018,8 +1075,9 @@ double_int_ucmp (double_int a, double_int b)
|
|||
and 1 if A > B. */
|
||||
|
||||
int
|
||||
double_int_scmp (double_int a, double_int b)
|
||||
double_int::scmp (double_int b) const
|
||||
{
|
||||
const double_int &a = *this;
|
||||
if (a.high < b.high)
|
||||
return -1;
|
||||
if (a.high > b.high)
|
||||
|
@ -1032,49 +1090,111 @@ double_int_scmp (double_int a, double_int b)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Compares two unsigned values A and B for less-than. */
|
||||
|
||||
bool
|
||||
double_int::ult (double_int b) const
|
||||
{
|
||||
if ((unsigned HOST_WIDE_INT) high < (unsigned HOST_WIDE_INT) b.high)
|
||||
return true;
|
||||
if ((unsigned HOST_WIDE_INT) high > (unsigned HOST_WIDE_INT) b.high)
|
||||
return false;
|
||||
if (low < b.low)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Compares two unsigned values A and B for greater-than. */
|
||||
|
||||
bool
|
||||
double_int::ugt (double_int b) const
|
||||
{
|
||||
if ((unsigned HOST_WIDE_INT) high > (unsigned HOST_WIDE_INT) b.high)
|
||||
return true;
|
||||
if ((unsigned HOST_WIDE_INT) high < (unsigned HOST_WIDE_INT) b.high)
|
||||
return false;
|
||||
if (low > b.low)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Compares two signed values A and B for less-than. */
|
||||
|
||||
bool
|
||||
double_int::slt (double_int b) const
|
||||
{
|
||||
if (high < b.high)
|
||||
return true;
|
||||
if (high > b.high)
|
||||
return false;
|
||||
if (low < b.low)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Compares two signed values A and B for greater-than. */
|
||||
|
||||
bool
|
||||
double_int::sgt (double_int b) const
|
||||
{
|
||||
if (high > b.high)
|
||||
return true;
|
||||
if (high < b.high)
|
||||
return false;
|
||||
if (low > b.low)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Compares two values A and B. Returns max value. Signedness of the
|
||||
comparison is given by UNS. */
|
||||
|
||||
double_int
|
||||
double_int_max (double_int a, double_int b, bool uns)
|
||||
double_int::max (double_int b, bool uns)
|
||||
{
|
||||
return (double_int_cmp (a, b, uns) == 1) ? a : b;
|
||||
return (this->cmp (b, uns) == 1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Compares two signed values A and B. Returns max value. */
|
||||
|
||||
double_int double_int_smax (double_int a, double_int b)
|
||||
double_int
|
||||
double_int::smax (double_int b)
|
||||
{
|
||||
return (double_int_scmp (a, b) == 1) ? a : b;
|
||||
return (this->scmp (b) == 1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Compares two unsigned values A and B. Returns max value. */
|
||||
|
||||
double_int double_int_umax (double_int a, double_int b)
|
||||
double_int
|
||||
double_int::umax (double_int b)
|
||||
{
|
||||
return (double_int_ucmp (a, b) == 1) ? a : b;
|
||||
return (this->ucmp (b) == 1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Compares two values A and B. Returns mix value. Signedness of the
|
||||
comparison is given by UNS. */
|
||||
|
||||
double_int double_int_min (double_int a, double_int b, bool uns)
|
||||
double_int
|
||||
double_int::min (double_int b, bool uns)
|
||||
{
|
||||
return (double_int_cmp (a, b, uns) == -1) ? a : b;
|
||||
return (this->cmp (b, uns) == -1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Compares two signed values A and B. Returns min value. */
|
||||
|
||||
double_int double_int_smin (double_int a, double_int b)
|
||||
double_int
|
||||
double_int::smin (double_int b)
|
||||
{
|
||||
return (double_int_scmp (a, b) == -1) ? a : b;
|
||||
return (this->scmp (b) == -1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Compares two unsigned values A and B. Returns min value. */
|
||||
|
||||
double_int double_int_umin (double_int a, double_int b)
|
||||
double_int
|
||||
double_int::umin (double_int b)
|
||||
{
|
||||
return (double_int_ucmp (a, b) == -1) ? a : b;
|
||||
return (this->ucmp (b) == -1) ? *this : b;
|
||||
}
|
||||
|
||||
/* Splits last digit of *CST (taken as unsigned) in BASE and returns it. */
|
||||
|
@ -1102,19 +1222,19 @@ dump_double_int (FILE *file, double_int cst, bool uns)
|
|||
unsigned digits[100], n;
|
||||
int i;
|
||||
|
||||
if (double_int_zero_p (cst))
|
||||
if (cst.is_zero ())
|
||||
{
|
||||
fprintf (file, "0");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!uns && double_int_negative_p (cst))
|
||||
if (!uns && cst.is_negative ())
|
||||
{
|
||||
fprintf (file, "-");
|
||||
cst = double_int_neg (cst);
|
||||
cst = -cst;
|
||||
}
|
||||
|
||||
for (n = 0; !double_int_zero_p (cst); n++)
|
||||
for (n = 0; !cst.is_zero (); n++)
|
||||
digits[n] = double_int_split_digit (&cst, 10);
|
||||
for (i = n - 1; i >= 0; i--)
|
||||
fprintf (file, "%u", digits[i]);
|
||||
|
@ -1130,10 +1250,10 @@ mpz_set_double_int (mpz_t result, double_int val, bool uns)
|
|||
bool negate = false;
|
||||
unsigned HOST_WIDE_INT vp[2];
|
||||
|
||||
if (!uns && double_int_negative_p (val))
|
||||
if (!uns && val.is_negative ())
|
||||
{
|
||||
negate = true;
|
||||
val = double_int_neg (val);
|
||||
val = -val;
|
||||
}
|
||||
|
||||
vp[0] = val.low;
|
||||
|
@ -1191,9 +1311,9 @@ mpz_get_double_int (const_tree type, mpz_t val, bool wrap)
|
|||
res.low = vp[0];
|
||||
res.high = (HOST_WIDE_INT) vp[1];
|
||||
|
||||
res = double_int_ext (res, TYPE_PRECISION (type), TYPE_UNSIGNED (type));
|
||||
res = res.ext (TYPE_PRECISION (type), TYPE_UNSIGNED (type));
|
||||
if (mpz_sgn (val) < 0)
|
||||
res = double_int_neg (res);
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
679
gcc/double-int.h
679
gcc/double-int.h
|
@ -50,10 +50,132 @@ along with GCC; see the file COPYING3. If not see
|
|||
numbers with precision higher than HOST_WIDE_INT). It might be less
|
||||
confusing to have them both signed or both unsigned. */
|
||||
|
||||
typedef struct
|
||||
typedef struct double_int
|
||||
{
|
||||
public:
|
||||
/* Normally, we would define constructors to create instances.
|
||||
Two things prevent us from doing so.
|
||||
First, defining a constructor makes the class non-POD in C++03,
|
||||
and we certainly want double_int to be a POD.
|
||||
Second, the GCC conding conventions prefer explicit conversion,
|
||||
and explicit conversion operators are not available until C++11. */
|
||||
|
||||
static double_int from_unsigned (unsigned HOST_WIDE_INT cst);
|
||||
static double_int from_signed (HOST_WIDE_INT cst);
|
||||
|
||||
/* No copy assignment operator or destructor to keep the type a POD. */
|
||||
|
||||
/* There are some special value-creation static member functions. */
|
||||
|
||||
static double_int mask (unsigned prec);
|
||||
static double_int max_value (unsigned int prec, bool uns);
|
||||
static double_int min_value (unsigned int prec, bool uns);
|
||||
|
||||
/* The following functions are mutating operations. */
|
||||
|
||||
double_int &operator ++ (); // prefix
|
||||
double_int &operator -- (); // prefix
|
||||
double_int &operator *= (double_int);
|
||||
double_int &operator += (double_int);
|
||||
double_int &operator -= (double_int);
|
||||
|
||||
/* The following functions are non-mutating operations. */
|
||||
|
||||
/* Conversion functions. */
|
||||
|
||||
HOST_WIDE_INT to_signed () const;
|
||||
unsigned HOST_WIDE_INT to_unsigned () const;
|
||||
|
||||
/* Conversion query functions. */
|
||||
|
||||
bool fits_unsigned () const;
|
||||
bool fits_signed () const;
|
||||
bool fits (bool uns) const;
|
||||
|
||||
/* Attribute query functions. */
|
||||
|
||||
int trailing_zeros () const;
|
||||
int popcount () const;
|
||||
|
||||
/* Arithmetic query operations. */
|
||||
|
||||
bool multiple_of (double_int, bool, double_int *) const;
|
||||
|
||||
/* Arithmetic operation functions. */
|
||||
|
||||
double_int set_bit (unsigned) const;
|
||||
double_int mul_with_sign (double_int, bool, int *) const;
|
||||
|
||||
double_int operator * (double_int b) const;
|
||||
double_int operator + (double_int b) const;
|
||||
double_int operator - (double_int b) const;
|
||||
double_int operator - () const;
|
||||
double_int operator ~ () const;
|
||||
double_int operator & (double_int b) const;
|
||||
double_int operator | (double_int b) const;
|
||||
double_int operator ^ (double_int b) const;
|
||||
double_int and_not (double_int b) const;
|
||||
|
||||
double_int lshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
|
||||
double_int rshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
|
||||
double_int alshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int arshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int llshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int lrshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int lrotate (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int rrotate (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
|
||||
/* You must ensure that double_int::ext is called on the operands
|
||||
of the following operations, if the precision of the numbers
|
||||
is less than HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
double_int div (double_int, bool, unsigned) const;
|
||||
double_int sdiv (double_int, unsigned) const;
|
||||
double_int udiv (double_int, unsigned) const;
|
||||
double_int mod (double_int, bool, unsigned) const;
|
||||
double_int smod (double_int, unsigned) const;
|
||||
double_int umod (double_int, unsigned) const;
|
||||
double_int divmod (double_int, bool, unsigned, double_int *) const;
|
||||
double_int sdivmod (double_int, unsigned, double_int *) const;
|
||||
double_int udivmod (double_int, unsigned, double_int *) const;
|
||||
|
||||
/* Precision control functions. */
|
||||
|
||||
double_int ext (unsigned prec, bool uns) const;
|
||||
double_int zext (unsigned prec) const;
|
||||
double_int sext (unsigned prec) const;
|
||||
|
||||
/* Comparative functions. */
|
||||
|
||||
bool is_zero () const;
|
||||
bool is_one () const;
|
||||
bool is_minus_one () const;
|
||||
bool is_negative () const;
|
||||
|
||||
int cmp (double_int b, bool uns) const;
|
||||
int ucmp (double_int b) const;
|
||||
int scmp (double_int b) const;
|
||||
|
||||
bool ult (double_int b) const;
|
||||
bool ugt (double_int b) const;
|
||||
bool slt (double_int b) const;
|
||||
bool sgt (double_int b) const;
|
||||
|
||||
double_int max (double_int b, bool uns);
|
||||
double_int smax (double_int b);
|
||||
double_int umax (double_int b);
|
||||
|
||||
double_int min (double_int b, bool uns);
|
||||
double_int smin (double_int b);
|
||||
double_int umin (double_int b);
|
||||
|
||||
bool operator == (double_int cst2) const;
|
||||
bool operator != (double_int cst2) const;
|
||||
|
||||
/* Please migrate away from using these member variables publically. */
|
||||
|
||||
unsigned HOST_WIDE_INT low;
|
||||
HOST_WIDE_INT high;
|
||||
|
||||
} double_int;
|
||||
|
||||
#define HOST_BITS_PER_DOUBLE_INT (2 * HOST_BITS_PER_WIDE_INT)
|
||||
|
@ -63,66 +185,148 @@ typedef struct
|
|||
/* Constructs double_int from integer CST. The bits over the precision of
|
||||
HOST_WIDE_INT are filled with the sign bit. */
|
||||
|
||||
static inline double_int
|
||||
shwi_to_double_int (HOST_WIDE_INT cst)
|
||||
inline
|
||||
double_int double_int::from_signed (HOST_WIDE_INT cst)
|
||||
{
|
||||
double_int r;
|
||||
|
||||
r.low = (unsigned HOST_WIDE_INT) cst;
|
||||
r.high = cst < 0 ? -1 : 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Some useful constants. */
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
shwi_to_double_int (HOST_WIDE_INT cst)
|
||||
{
|
||||
return double_int::from_signed (cst);
|
||||
}
|
||||
|
||||
#define double_int_minus_one (shwi_to_double_int (-1))
|
||||
#define double_int_zero (shwi_to_double_int (0))
|
||||
#define double_int_one (shwi_to_double_int (1))
|
||||
#define double_int_two (shwi_to_double_int (2))
|
||||
#define double_int_ten (shwi_to_double_int (10))
|
||||
/* Some useful constants. */
|
||||
/* FIXME(crowl): Maybe remove after converting callers?
|
||||
The problem is that a named constant would not be as optimizable,
|
||||
while the functional syntax is more verbose. */
|
||||
|
||||
#define double_int_minus_one (double_int::from_signed (-1))
|
||||
#define double_int_zero (double_int::from_signed (0))
|
||||
#define double_int_one (double_int::from_signed (1))
|
||||
#define double_int_two (double_int::from_signed (2))
|
||||
#define double_int_ten (double_int::from_signed (10))
|
||||
|
||||
/* Constructs double_int from unsigned integer CST. The bits over the
|
||||
precision of HOST_WIDE_INT are filled with zeros. */
|
||||
|
||||
static inline double_int
|
||||
uhwi_to_double_int (unsigned HOST_WIDE_INT cst)
|
||||
inline
|
||||
double_int double_int::from_unsigned (unsigned HOST_WIDE_INT cst)
|
||||
{
|
||||
double_int r;
|
||||
|
||||
r.low = cst;
|
||||
r.high = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Returns value of CST as a signed number. CST must satisfy
|
||||
double_int_fits_in_shwi_p. */
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
uhwi_to_double_int (unsigned HOST_WIDE_INT cst)
|
||||
{
|
||||
return double_int::from_unsigned (cst);
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator ++ ()
|
||||
{
|
||||
*this += double_int_one;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator -- ()
|
||||
{
|
||||
*this -= double_int_one;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator *= (double_int b)
|
||||
{
|
||||
*this = *this * b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator += (double_int b)
|
||||
{
|
||||
*this = *this + b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator -= (double_int b)
|
||||
{
|
||||
*this = *this - b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* Returns value of CST as a signed number. CST must satisfy
|
||||
double_int::fits_signed. */
|
||||
|
||||
inline HOST_WIDE_INT
|
||||
double_int::to_signed () const
|
||||
{
|
||||
return (HOST_WIDE_INT) low;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline HOST_WIDE_INT
|
||||
double_int_to_shwi (double_int cst)
|
||||
{
|
||||
return (HOST_WIDE_INT) cst.low;
|
||||
return cst.to_signed ();
|
||||
}
|
||||
|
||||
/* Returns value of CST as an unsigned number. CST must satisfy
|
||||
double_int_fits_in_uhwi_p. */
|
||||
double_int::fits_unsigned. */
|
||||
|
||||
inline unsigned HOST_WIDE_INT
|
||||
double_int::to_unsigned () const
|
||||
{
|
||||
return low;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline unsigned HOST_WIDE_INT
|
||||
double_int_to_uhwi (double_int cst)
|
||||
{
|
||||
return cst.low;
|
||||
return cst.to_unsigned ();
|
||||
}
|
||||
|
||||
bool double_int_fits_in_hwi_p (double_int, bool);
|
||||
bool double_int_fits_in_shwi_p (double_int);
|
||||
|
||||
/* Returns true if CST fits in unsigned HOST_WIDE_INT. */
|
||||
|
||||
inline bool
|
||||
double_int::fits_unsigned () const
|
||||
{
|
||||
return high == 0;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline bool
|
||||
double_int_fits_in_uhwi_p (double_int cst)
|
||||
{
|
||||
return cst.high == 0;
|
||||
return cst.fits_unsigned ();
|
||||
}
|
||||
|
||||
/* Returns true if CST fits in signed HOST_WIDE_INT. */
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline bool
|
||||
double_int_fits_in_shwi_p (double_int cst)
|
||||
{
|
||||
return cst.fits_signed ();
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline bool
|
||||
double_int_fits_in_hwi_p (double_int cst, bool uns)
|
||||
{
|
||||
return cst.fits (uns);
|
||||
}
|
||||
|
||||
/* The following operations perform arithmetics modulo 2^precision,
|
||||
|
@ -130,88 +334,258 @@ double_int_fits_in_uhwi_p (double_int cst)
|
|||
you are representing numbers with precision less than
|
||||
HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
|
||||
double_int double_int_mul (double_int, double_int);
|
||||
double_int double_int_mul_with_sign (double_int, double_int, bool, int *);
|
||||
double_int double_int_add (double_int, double_int);
|
||||
double_int double_int_sub (double_int, double_int);
|
||||
double_int double_int_neg (double_int);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_mul (double_int a, double_int b)
|
||||
{
|
||||
return a * b;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_mul_with_sign (double_int a, double_int b,
|
||||
bool unsigned_p, int *overflow)
|
||||
{
|
||||
return a.mul_with_sign (b, unsigned_p, overflow);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_add (double_int a, double_int b)
|
||||
{
|
||||
return a + b;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_sub (double_int a, double_int b)
|
||||
{
|
||||
return a - b;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_neg (double_int a)
|
||||
{
|
||||
return -a;
|
||||
}
|
||||
|
||||
/* You must ensure that double_int_ext is called on the operands
|
||||
of the following operations, if the precision of the numbers
|
||||
is less than HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
double_int double_int_div (double_int, double_int, bool, unsigned);
|
||||
double_int double_int_sdiv (double_int, double_int, unsigned);
|
||||
double_int double_int_udiv (double_int, double_int, unsigned);
|
||||
double_int double_int_mod (double_int, double_int, bool, unsigned);
|
||||
double_int double_int_smod (double_int, double_int, unsigned);
|
||||
double_int double_int_umod (double_int, double_int, unsigned);
|
||||
double_int double_int_divmod (double_int, double_int, bool, unsigned, double_int *);
|
||||
double_int double_int_sdivmod (double_int, double_int, unsigned, double_int *);
|
||||
double_int double_int_udivmod (double_int, double_int, unsigned, double_int *);
|
||||
|
||||
bool double_int_multiple_of (double_int, double_int, bool, double_int *);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_div (double_int a, double_int b, bool uns, unsigned code)
|
||||
{
|
||||
return a.div (b, uns, code);
|
||||
}
|
||||
|
||||
double_int double_int_setbit (double_int, unsigned);
|
||||
int double_int_ctz (double_int);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_sdiv (double_int a, double_int b, unsigned code)
|
||||
{
|
||||
return a.sdiv (b, code);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_udiv (double_int a, double_int b, unsigned code)
|
||||
{
|
||||
return a.udiv (b, code);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_mod (double_int a, double_int b, bool uns, unsigned code)
|
||||
{
|
||||
return a.mod (b, uns, code);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_smod (double_int a, double_int b, unsigned code)
|
||||
{
|
||||
return a.smod (b, code);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_umod (double_int a, double_int b, unsigned code)
|
||||
{
|
||||
return a.umod (b, code);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_divmod (double_int a, double_int b, bool uns,
|
||||
unsigned code, double_int *mod)
|
||||
{
|
||||
return a.divmod (b, uns, code, mod);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_sdivmod (double_int a, double_int b, unsigned code, double_int *mod)
|
||||
{
|
||||
return a.sdivmod (b, code, mod);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_udivmod (double_int a, double_int b, unsigned code, double_int *mod)
|
||||
{
|
||||
return a.udivmod (b, code, mod);
|
||||
}
|
||||
|
||||
/***/
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline bool
|
||||
double_int_multiple_of (double_int product, double_int factor,
|
||||
bool unsigned_p, double_int *multiple)
|
||||
{
|
||||
return product.multiple_of (factor, unsigned_p, multiple);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_setbit (double_int a, unsigned bitpos)
|
||||
{
|
||||
return a.set_bit (bitpos);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline int
|
||||
double_int_ctz (double_int a)
|
||||
{
|
||||
return a.trailing_zeros ();
|
||||
}
|
||||
|
||||
/* Logical operations. */
|
||||
|
||||
/* Returns ~A. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator ~ () const
|
||||
{
|
||||
double_int result;
|
||||
result.low = ~low;
|
||||
result.high = ~high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
double_int_not (double_int a)
|
||||
{
|
||||
a.low = ~a.low;
|
||||
a.high = ~a.high;
|
||||
return a;
|
||||
return ~a;
|
||||
}
|
||||
|
||||
/* Returns A | B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator | (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low | b.low;
|
||||
result.high = high | b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
double_int_ior (double_int a, double_int b)
|
||||
{
|
||||
a.low |= b.low;
|
||||
a.high |= b.high;
|
||||
return a;
|
||||
return a | b;
|
||||
}
|
||||
|
||||
/* Returns A & B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator & (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low & b.low;
|
||||
result.high = high & b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
double_int_and (double_int a, double_int b)
|
||||
{
|
||||
a.low &= b.low;
|
||||
a.high &= b.high;
|
||||
return a;
|
||||
return a & b;
|
||||
}
|
||||
|
||||
/* Returns A & ~B. */
|
||||
|
||||
inline double_int
|
||||
double_int::and_not (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low & ~b.low;
|
||||
result.high = high & ~b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
double_int_and_not (double_int a, double_int b)
|
||||
{
|
||||
a.low &= ~b.low;
|
||||
a.high &= ~b.high;
|
||||
return a;
|
||||
return a.and_not (b);
|
||||
}
|
||||
|
||||
/* Returns A ^ B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator ^ (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low ^ b.low;
|
||||
result.high = high ^ b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline double_int
|
||||
double_int_xor (double_int a, double_int b)
|
||||
{
|
||||
a.low ^= b.low;
|
||||
a.high ^= b.high;
|
||||
return a;
|
||||
return a ^ b;
|
||||
}
|
||||
|
||||
|
||||
/* Shift operations. */
|
||||
double_int double_int_lshift (double_int, HOST_WIDE_INT, unsigned int, bool);
|
||||
double_int double_int_rshift (double_int, HOST_WIDE_INT, unsigned int, bool);
|
||||
double_int double_int_lrotate (double_int, HOST_WIDE_INT, unsigned int);
|
||||
double_int double_int_rrotate (double_int, HOST_WIDE_INT, unsigned int);
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_lshift (double_int a, HOST_WIDE_INT count, unsigned int prec,
|
||||
bool arith)
|
||||
{
|
||||
return a.lshift (count, prec, arith);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec,
|
||||
bool arith)
|
||||
{
|
||||
return a.rshift (count, prec, arith);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_lrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
||||
{
|
||||
return a.lrotate (count, prec);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_rrotate (double_int a, HOST_WIDE_INT count, unsigned int prec)
|
||||
{
|
||||
return a.rrotate (count, prec);
|
||||
}
|
||||
|
||||
/* Returns true if CST is negative. Of course, CST is considered to
|
||||
be signed. */
|
||||
|
@ -222,29 +596,115 @@ double_int_negative_p (double_int cst)
|
|||
return cst.high < 0;
|
||||
}
|
||||
|
||||
int double_int_cmp (double_int, double_int, bool);
|
||||
int double_int_scmp (double_int, double_int);
|
||||
int double_int_ucmp (double_int, double_int);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline int
|
||||
double_int_cmp (double_int a, double_int b, bool uns)
|
||||
{
|
||||
return a.cmp (b, uns);
|
||||
}
|
||||
|
||||
double_int double_int_max (double_int, double_int, bool);
|
||||
double_int double_int_smax (double_int, double_int);
|
||||
double_int double_int_umax (double_int, double_int);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline int
|
||||
double_int_scmp (double_int a, double_int b)
|
||||
{
|
||||
return a.scmp (b);
|
||||
}
|
||||
|
||||
double_int double_int_min (double_int, double_int, bool);
|
||||
double_int double_int_smin (double_int, double_int);
|
||||
double_int double_int_umin (double_int, double_int);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline int
|
||||
double_int_ucmp (double_int a, double_int b)
|
||||
{
|
||||
return a.ucmp (b);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_max (double_int a, double_int b, bool uns)
|
||||
{
|
||||
return a.max (b, uns);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_smax (double_int a, double_int b)
|
||||
{
|
||||
return a.smax (b);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_umax (double_int a, double_int b)
|
||||
{
|
||||
return a.umax (b);
|
||||
}
|
||||
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_min (double_int a, double_int b, bool uns)
|
||||
{
|
||||
return a.min (b, uns);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_smin (double_int a, double_int b)
|
||||
{
|
||||
return a.smin (b);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_umin (double_int a, double_int b)
|
||||
{
|
||||
return a.umin (b);
|
||||
}
|
||||
|
||||
void dump_double_int (FILE *, double_int, bool);
|
||||
|
||||
/* Zero and sign extension of numbers in smaller precisions. */
|
||||
|
||||
double_int double_int_ext (double_int, unsigned, bool);
|
||||
double_int double_int_sext (double_int, unsigned);
|
||||
double_int double_int_zext (double_int, unsigned);
|
||||
double_int double_int_mask (unsigned);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_ext (double_int a, unsigned prec, bool uns)
|
||||
{
|
||||
return a.ext (prec, uns);
|
||||
}
|
||||
|
||||
double_int double_int_max_value (unsigned int, bool);
|
||||
double_int double_int_min_value (unsigned int, bool);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_sext (double_int a, unsigned prec)
|
||||
{
|
||||
return a.sext (prec);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_zext (double_int a, unsigned prec)
|
||||
{
|
||||
return a.zext (prec);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_mask (unsigned prec)
|
||||
{
|
||||
return double_int::mask (prec);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_max_value (unsigned int prec, bool uns)
|
||||
{
|
||||
return double_int::max_value (prec, uns);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
inline double_int
|
||||
double_int_min_value (unsigned int prec, bool uns)
|
||||
{
|
||||
return double_int::min_value (prec, uns);
|
||||
}
|
||||
|
||||
#define ALL_ONES (~((unsigned HOST_WIDE_INT) 0))
|
||||
|
||||
|
@ -254,69 +714,128 @@ double_int double_int_min_value (unsigned int, bool);
|
|||
|
||||
/* Returns true if CST is zero. */
|
||||
|
||||
inline bool
|
||||
double_int::is_zero () const
|
||||
{
|
||||
return low == 0 && high == 0;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline bool
|
||||
double_int_zero_p (double_int cst)
|
||||
{
|
||||
return cst.low == 0 && cst.high == 0;
|
||||
return cst.is_zero ();
|
||||
}
|
||||
|
||||
/* Returns true if CST is one. */
|
||||
|
||||
inline bool
|
||||
double_int::is_one () const
|
||||
{
|
||||
return low == 1 && high == 0;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline bool
|
||||
double_int_one_p (double_int cst)
|
||||
{
|
||||
return cst.low == 1 && cst.high == 0;
|
||||
return cst.is_one ();
|
||||
}
|
||||
|
||||
/* Returns true if CST is minus one. */
|
||||
|
||||
inline bool
|
||||
double_int::is_minus_one () const
|
||||
{
|
||||
return low == ALL_ONES && high == -1;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline bool
|
||||
double_int_minus_one_p (double_int cst)
|
||||
{
|
||||
return (cst.low == ALL_ONES && cst.high == -1);
|
||||
return cst.is_minus_one ();
|
||||
}
|
||||
|
||||
/* Returns true if CST is negative. */
|
||||
|
||||
inline bool
|
||||
double_int::is_negative () const
|
||||
{
|
||||
return high < 0;
|
||||
}
|
||||
|
||||
/* Returns true if CST1 == CST2. */
|
||||
|
||||
inline bool
|
||||
double_int::operator == (double_int cst2) const
|
||||
{
|
||||
return low == cst2.low && high == cst2.high;
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline bool
|
||||
double_int_equal_p (double_int cst1, double_int cst2)
|
||||
{
|
||||
return cst1.low == cst2.low && cst1.high == cst2.high;
|
||||
return cst1 == cst2;
|
||||
}
|
||||
|
||||
/* Returns true if CST1 != CST2. */
|
||||
|
||||
inline bool
|
||||
double_int::operator != (double_int cst2) const
|
||||
{
|
||||
return low != cst2.low || high != cst2.high;
|
||||
}
|
||||
|
||||
/* Return number of set bits of CST. */
|
||||
|
||||
inline int
|
||||
double_int::popcount () const
|
||||
{
|
||||
return popcount_hwi (high) + popcount_hwi (low);
|
||||
}
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
static inline int
|
||||
double_int_popcount (double_int cst)
|
||||
{
|
||||
return popcount_hwi (cst.high) + popcount_hwi (cst.low);
|
||||
return cst.popcount ();
|
||||
}
|
||||
|
||||
|
||||
/* Legacy interface with decomposed high/low parts. */
|
||||
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
bool);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
#define add_double(l1,h1,l2,h2,lv,hv) \
|
||||
add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
bool);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern int mul_double_wide_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
bool);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
#define mul_double(l1,h1,l2,h2,lv,hv) \
|
||||
mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
|
||||
HOST_WIDE_INT, unsigned int,
|
||||
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, bool);
|
||||
/* FIXME(crowl): Remove after converting callers. */
|
||||
extern int div_and_round_double (unsigned, int, unsigned HOST_WIDE_INT,
|
||||
HOST_WIDE_INT, unsigned HOST_WIDE_INT,
|
||||
HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
|
||||
|
|
|
@ -2550,7 +2550,7 @@ create_cfi_notes (void)
|
|||
gcc_checking_assert (trace_work_list == NULL);
|
||||
|
||||
/* Always begin at the entry trace. */
|
||||
ti = VEC_index (dw_trace_info, trace_info, 0);
|
||||
ti = &VEC_index (dw_trace_info, trace_info, 0);
|
||||
scan_trace (ti);
|
||||
|
||||
while (!VEC_empty (dw_trace_info_ref, trace_work_list))
|
||||
|
@ -2597,7 +2597,7 @@ connect_traces (void)
|
|||
/* Remove all unprocessed traces from the list. */
|
||||
for (i = n - 1; i > 0; --i)
|
||||
{
|
||||
ti = VEC_index (dw_trace_info, trace_info, i);
|
||||
ti = &VEC_index (dw_trace_info, trace_info, i);
|
||||
if (ti->beg_row == NULL)
|
||||
{
|
||||
VEC_ordered_remove (dw_trace_info, trace_info, i);
|
||||
|
@ -2609,13 +2609,13 @@ connect_traces (void)
|
|||
|
||||
/* Work from the end back to the beginning. This lets us easily insert
|
||||
remember/restore_state notes in the correct order wrt other notes. */
|
||||
prev_ti = VEC_index (dw_trace_info, trace_info, n - 1);
|
||||
prev_ti = &VEC_index (dw_trace_info, trace_info, n - 1);
|
||||
for (i = n - 1; i > 0; --i)
|
||||
{
|
||||
dw_cfi_row *old_row;
|
||||
|
||||
ti = prev_ti;
|
||||
prev_ti = VEC_index (dw_trace_info, trace_info, i - 1);
|
||||
prev_ti = &VEC_index (dw_trace_info, trace_info, i - 1);
|
||||
|
||||
add_cfi_insn = ti->head;
|
||||
|
||||
|
@ -2686,7 +2686,7 @@ connect_traces (void)
|
|||
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
ti = VEC_index (dw_trace_info, trace_info, i);
|
||||
ti = &VEC_index (dw_trace_info, trace_info, i);
|
||||
|
||||
if (ti->switch_sections)
|
||||
prev_args_size = 0;
|
||||
|
@ -2884,8 +2884,8 @@ create_cie_data (void)
|
|||
break;
|
||||
case 1:
|
||||
cie_return_save = ggc_alloc_reg_saved_in_data ();
|
||||
*cie_return_save = *VEC_index (reg_saved_in_data,
|
||||
cie_trace.regs_saved_in_regs, 0);
|
||||
*cie_return_save = VEC_index (reg_saved_in_data,
|
||||
cie_trace.regs_saved_in_regs, 0);
|
||||
VEC_free (reg_saved_in_data, heap, cie_trace.regs_saved_in_regs);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -5821,7 +5821,7 @@ same_die_p (dw_die_ref die1, dw_die_ref die2, int *mark)
|
|||
return 0;
|
||||
|
||||
FOR_EACH_VEC_ELT (dw_attr_node, die1->die_attr, ix, a1)
|
||||
if (!same_attr_p (a1, VEC_index (dw_attr_node, die2->die_attr, ix), mark))
|
||||
if (!same_attr_p (a1, &VEC_index (dw_attr_node, die2->die_attr, ix), mark))
|
||||
return 0;
|
||||
|
||||
c1 = die1->die_child;
|
||||
|
@ -7072,7 +7072,7 @@ build_abbrev_table (dw_die_ref die, htab_t extern_map)
|
|||
|
||||
FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, die_a)
|
||||
{
|
||||
abbrev_a = VEC_index (dw_attr_node, abbrev->die_attr, ix);
|
||||
abbrev_a = &VEC_index (dw_attr_node, abbrev->die_attr, ix);
|
||||
if ((abbrev_a->dw_attr != die_a->dw_attr)
|
||||
|| (value_format (abbrev_a) != value_format (die_a)))
|
||||
{
|
||||
|
@ -20532,8 +20532,8 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
|
|||
unsigned int i, count, encoded_filename_len, linebuf_len;
|
||||
void **slot;
|
||||
|
||||
first = VEC_index (macinfo_entry, macinfo_table, idx);
|
||||
second = VEC_index (macinfo_entry, macinfo_table, idx + 1);
|
||||
first = &VEC_index (macinfo_entry, macinfo_table, idx);
|
||||
second = &VEC_index (macinfo_entry, macinfo_table, idx + 1);
|
||||
|
||||
/* Optimize only if there are at least two consecutive define/undef ops,
|
||||
and either all of them are before first DW_MACINFO_start_file
|
||||
|
@ -20573,7 +20573,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
|
|||
if (VEC_empty (macinfo_entry, files))
|
||||
base = "";
|
||||
else
|
||||
base = lbasename (VEC_last (macinfo_entry, files)->info);
|
||||
base = lbasename (VEC_last (macinfo_entry, files).info);
|
||||
for (encoded_filename_len = 0, i = 0; base[i]; i++)
|
||||
if (ISIDNUM (base[i]) || base[i] == '.')
|
||||
encoded_filename_len++;
|
||||
|
@ -20604,7 +20604,7 @@ optimize_macinfo_range (unsigned int idx, VEC (macinfo_entry, gc) *files,
|
|||
|
||||
/* Construct a macinfo_entry for DW_MACRO_GNU_transparent_include
|
||||
in the empty vector entry before the first define/undef. */
|
||||
inc = VEC_index (macinfo_entry, macinfo_table, idx - 1);
|
||||
inc = &VEC_index (macinfo_entry, macinfo_table, idx - 1);
|
||||
inc->code = DW_MACRO_GNU_transparent_include;
|
||||
inc->lineno = 0;
|
||||
inc->info = ggc_strdup (grp_name);
|
||||
|
@ -20697,7 +20697,7 @@ output_macinfo (void)
|
|||
&& VEC_length (macinfo_entry, files) != 1
|
||||
&& i > 0
|
||||
&& i + 1 < length
|
||||
&& VEC_index (macinfo_entry, macinfo_table, i - 1)->code == 0)
|
||||
&& VEC_index (macinfo_entry, macinfo_table, i - 1).code == 0)
|
||||
{
|
||||
unsigned count = optimize_macinfo_range (i, files, &macinfo_htab);
|
||||
if (count)
|
||||
|
@ -21307,14 +21307,14 @@ static inline void
|
|||
move_linkage_attr (dw_die_ref die)
|
||||
{
|
||||
unsigned ix = VEC_length (dw_attr_node, die->die_attr);
|
||||
dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
|
||||
dw_attr_node linkage = VEC_index (dw_attr_node, die->die_attr, ix - 1);
|
||||
|
||||
gcc_assert (linkage.dw_attr == DW_AT_linkage_name
|
||||
|| linkage.dw_attr == DW_AT_MIPS_linkage_name);
|
||||
|
||||
while (--ix > 0)
|
||||
{
|
||||
dw_attr_node *prev = VEC_index (dw_attr_node, die->die_attr, ix - 1);
|
||||
dw_attr_node *prev = &VEC_index (dw_attr_node, die->die_attr, ix - 1);
|
||||
|
||||
if (prev->dw_attr == DW_AT_decl_line || prev->dw_attr == DW_AT_name)
|
||||
break;
|
||||
|
@ -22226,8 +22226,8 @@ dwarf2out_finish (const char *filename)
|
|||
for (i = 0; i < VEC_length (deferred_locations, deferred_locations_list); i++)
|
||||
{
|
||||
add_location_or_const_value_attribute (
|
||||
VEC_index (deferred_locations, deferred_locations_list, i)->die,
|
||||
VEC_index (deferred_locations, deferred_locations_list, i)->variable,
|
||||
VEC_index (deferred_locations, deferred_locations_list, i).die,
|
||||
VEC_index (deferred_locations, deferred_locations_list, i).variable,
|
||||
false,
|
||||
DW_AT_location);
|
||||
}
|
||||
|
|
|
@ -6091,7 +6091,7 @@ locator_location (int loc)
|
|||
break;
|
||||
}
|
||||
}
|
||||
return *VEC_index (location_t, locations_locators_vals, min);
|
||||
return VEC_index (location_t, locations_locators_vals, min);
|
||||
}
|
||||
|
||||
/* Return source line of the statement that produced this insn. */
|
||||
|
|
34
gcc/except.c
34
gcc/except.c
|
@ -304,8 +304,8 @@ init_eh_for_function (void)
|
|||
cfun->eh = ggc_alloc_cleared_eh_status ();
|
||||
|
||||
/* Make sure zero'th entries are used. */
|
||||
VEC_safe_push (eh_region, gc, cfun->eh->region_array, NULL);
|
||||
VEC_safe_push (eh_landing_pad, gc, cfun->eh->lp_array, NULL);
|
||||
VEC_safe_push (eh_region, gc, cfun->eh->region_array, (eh_region) NULL);
|
||||
VEC_safe_push (eh_landing_pad, gc, cfun->eh->lp_array, (eh_landing_pad) NULL);
|
||||
}
|
||||
|
||||
/* Routines to generate the exception tree somewhat directly.
|
||||
|
@ -806,7 +806,7 @@ add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
|
|||
if (targetm.arm_eabi_unwinder)
|
||||
VEC_safe_push (tree, gc, cfun->eh->ehspec_data.arm_eabi, NULL_TREE);
|
||||
else
|
||||
VEC_safe_push (uchar, gc, cfun->eh->ehspec_data.other, 0);
|
||||
VEC_safe_push (uchar, gc, cfun->eh->ehspec_data.other, (uchar) 0);
|
||||
}
|
||||
|
||||
return n->filter;
|
||||
|
@ -2395,10 +2395,10 @@ add_call_site (rtx landing_pad, int action, int section)
|
|||
record->action = action;
|
||||
|
||||
VEC_safe_push (call_site_record, gc,
|
||||
crtl->eh.call_site_record[section], record);
|
||||
crtl->eh.call_site_record_v[section], record);
|
||||
|
||||
return call_site_base + VEC_length (call_site_record,
|
||||
crtl->eh.call_site_record[section]) - 1;
|
||||
crtl->eh.call_site_record_v[section]) - 1;
|
||||
}
|
||||
|
||||
/* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
|
||||
|
@ -2546,10 +2546,10 @@ convert_to_eh_region_ranges (void)
|
|||
else if (last_action != -3)
|
||||
last_landing_pad = pc_rtx;
|
||||
call_site_base += VEC_length (call_site_record,
|
||||
crtl->eh.call_site_record[cur_sec]);
|
||||
crtl->eh.call_site_record_v[cur_sec]);
|
||||
cur_sec++;
|
||||
gcc_assert (crtl->eh.call_site_record[cur_sec] == NULL);
|
||||
crtl->eh.call_site_record[cur_sec]
|
||||
gcc_assert (crtl->eh.call_site_record_v[cur_sec] == NULL);
|
||||
crtl->eh.call_site_record_v[cur_sec]
|
||||
= VEC_alloc (call_site_record, gc, 10);
|
||||
}
|
||||
|
||||
|
@ -2633,14 +2633,14 @@ push_sleb128 (VEC (uchar, gc) **data_area, int value)
|
|||
static int
|
||||
dw2_size_of_call_site_table (int section)
|
||||
{
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record[section]);
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record_v[section]);
|
||||
int size = n * (4 + 4 + 4);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
struct call_site_record_d *cs =
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record[section], i);
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record_v[section], i);
|
||||
size += size_of_uleb128 (cs->action);
|
||||
}
|
||||
|
||||
|
@ -2650,14 +2650,14 @@ dw2_size_of_call_site_table (int section)
|
|||
static int
|
||||
sjlj_size_of_call_site_table (void)
|
||||
{
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record[0]);
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record_v[0]);
|
||||
int size = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
struct call_site_record_d *cs =
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record[0], i);
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record_v[0], i);
|
||||
size += size_of_uleb128 (INTVAL (cs->landing_pad));
|
||||
size += size_of_uleb128 (cs->action);
|
||||
}
|
||||
|
@ -2669,7 +2669,7 @@ sjlj_size_of_call_site_table (void)
|
|||
static void
|
||||
dw2_output_call_site_table (int cs_format, int section)
|
||||
{
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record[section]);
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record_v[section]);
|
||||
int i;
|
||||
const char *begin;
|
||||
|
||||
|
@ -2683,7 +2683,7 @@ dw2_output_call_site_table (int cs_format, int section)
|
|||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
struct call_site_record_d *cs =
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record[section], i);
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record_v[section], i);
|
||||
char reg_start_lab[32];
|
||||
char reg_end_lab[32];
|
||||
char landing_pad_lab[32];
|
||||
|
@ -2731,13 +2731,13 @@ dw2_output_call_site_table (int cs_format, int section)
|
|||
static void
|
||||
sjlj_output_call_site_table (void)
|
||||
{
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record[0]);
|
||||
int n = VEC_length (call_site_record, crtl->eh.call_site_record_v[0]);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
struct call_site_record_d *cs =
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record[0], i);
|
||||
VEC_index (call_site_record, crtl->eh.call_site_record_v[0], i);
|
||||
|
||||
dw2_asm_output_data_uleb128 (INTVAL (cs->landing_pad),
|
||||
"region %d landing pad", i);
|
||||
|
@ -3051,7 +3051,7 @@ output_function_exception_table (const char *fnname)
|
|||
targetm.asm_out.emit_except_table_label (asm_out_file);
|
||||
|
||||
output_one_function_exception_table (0);
|
||||
if (crtl->eh.call_site_record[1] != NULL)
|
||||
if (crtl->eh.call_site_record_v[1] != NULL)
|
||||
output_one_function_exception_table (1);
|
||||
|
||||
switch_to_section (current_function_section ());
|
||||
|
|
|
@ -111,13 +111,11 @@ fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, enum machine_mode mode)
|
|||
/* From the spec, we need to evaluate 1 to the maximal value. */
|
||||
f->data.low = -1;
|
||||
f->data.high = -1;
|
||||
f->data = double_int_ext (f->data,
|
||||
GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode), 1);
|
||||
f->data = f->data.zext (GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode));
|
||||
}
|
||||
else
|
||||
f->data = double_int_ext (f->data,
|
||||
SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
+ GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
UNSIGNED_FIXED_POINT_MODE_P (f->mode));
|
||||
|
@ -159,8 +157,8 @@ fixed_saturate1 (enum machine_mode mode, double_int a, double_int *f,
|
|||
double_int max;
|
||||
max.low = -1;
|
||||
max.high = -1;
|
||||
max = double_int_ext (max, i_f_bits, 1);
|
||||
if (double_int_cmp (a, max, 1) == 1)
|
||||
max = max.zext (i_f_bits);
|
||||
if (a.ugt (max))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = max;
|
||||
|
@ -173,21 +171,19 @@ fixed_saturate1 (enum machine_mode mode, double_int a, double_int *f,
|
|||
double_int max, min;
|
||||
max.high = -1;
|
||||
max.low = -1;
|
||||
max = double_int_ext (max, i_f_bits, 1);
|
||||
max = max.zext (i_f_bits);
|
||||
min.high = 0;
|
||||
min.low = 1;
|
||||
lshift_double (min.low, min.high, i_f_bits,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&min.low, &min.high, 1);
|
||||
min = double_int_ext (min, 1 + i_f_bits, 0);
|
||||
if (double_int_cmp (a, max, 0) == 1)
|
||||
min = min.alshift (i_f_bits, HOST_BITS_PER_DOUBLE_INT);
|
||||
min = min.sext (1 + i_f_bits);
|
||||
if (a.sgt (max))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = max;
|
||||
else
|
||||
overflow_p = true;
|
||||
}
|
||||
else if (double_int_cmp (a, min, 0) == -1)
|
||||
else if (a.slt (min))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = min;
|
||||
|
@ -221,10 +217,10 @@ fixed_saturate2 (enum machine_mode mode, double_int a_high, double_int a_low,
|
|||
max_r.low = 0;
|
||||
max_s.high = -1;
|
||||
max_s.low = -1;
|
||||
max_s = double_int_ext (max_s, i_f_bits, 1);
|
||||
if (double_int_cmp (a_high, max_r, 1) == 1
|
||||
|| (double_int_equal_p (a_high, max_r) &&
|
||||
double_int_cmp (a_low, max_s, 1) == 1))
|
||||
max_s = max_s.zext (i_f_bits);
|
||||
if (a_high.ugt (max_r)
|
||||
|| (a_high == max_r &&
|
||||
a_low.ugt (max_s)))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = max_s;
|
||||
|
@ -239,27 +235,25 @@ fixed_saturate2 (enum machine_mode mode, double_int a_high, double_int a_low,
|
|||
max_r.low = 0;
|
||||
max_s.high = -1;
|
||||
max_s.low = -1;
|
||||
max_s = double_int_ext (max_s, i_f_bits, 1);
|
||||
max_s = max_s.zext (i_f_bits);
|
||||
min_r.high = -1;
|
||||
min_r.low = -1;
|
||||
min_s.high = 0;
|
||||
min_s.low = 1;
|
||||
lshift_double (min_s.low, min_s.high, i_f_bits,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&min_s.low, &min_s.high, 1);
|
||||
min_s = double_int_ext (min_s, 1 + i_f_bits, 0);
|
||||
if (double_int_cmp (a_high, max_r, 0) == 1
|
||||
|| (double_int_equal_p (a_high, max_r) &&
|
||||
double_int_cmp (a_low, max_s, 1) == 1))
|
||||
min_s = min_s.alshift (i_f_bits, HOST_BITS_PER_DOUBLE_INT);
|
||||
min_s = min_s.sext (1 + i_f_bits);
|
||||
if (a_high.sgt (max_r)
|
||||
|| (a_high == max_r &&
|
||||
a_low.ugt (max_s)))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = max_s;
|
||||
else
|
||||
overflow_p = true;
|
||||
}
|
||||
else if (double_int_cmp (a_high, min_r, 0) == -1
|
||||
|| (double_int_equal_p (a_high, min_r) &&
|
||||
double_int_cmp (a_low, min_s, 1) == -1))
|
||||
else if (a_high.slt (min_r)
|
||||
|| (a_high == min_r &&
|
||||
a_low.ult (min_s)))
|
||||
{
|
||||
if (sat_p)
|
||||
*f = min_s;
|
||||
|
@ -297,19 +291,19 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
/* This was a conditional expression but it triggered a bug in
|
||||
Sun C 5.5. */
|
||||
if (subtract_p)
|
||||
temp = double_int_neg (b->data);
|
||||
temp = -b->data;
|
||||
else
|
||||
temp = b->data;
|
||||
|
||||
unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode);
|
||||
i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode);
|
||||
f->mode = a->mode;
|
||||
f->data = double_int_add (a->data, temp);
|
||||
f->data = a->data + temp;
|
||||
if (unsigned_p) /* Unsigned type. */
|
||||
{
|
||||
if (subtract_p) /* Unsigned subtraction. */
|
||||
{
|
||||
if (double_int_cmp (a->data, b->data, 1) == -1)
|
||||
if (a->data.ult (b->data))
|
||||
{
|
||||
if (sat_p)
|
||||
{
|
||||
|
@ -322,9 +316,9 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
}
|
||||
else /* Unsigned addition. */
|
||||
{
|
||||
f->data = double_int_ext (f->data, i_f_bits, 1);
|
||||
if (double_int_cmp (f->data, a->data, 1) == -1
|
||||
|| double_int_cmp (f->data, b->data, 1) == -1)
|
||||
f->data = f->data.zext (i_f_bits);
|
||||
if (f->data.ult (a->data)
|
||||
|| f->data.ult (b->data))
|
||||
{
|
||||
if (sat_p)
|
||||
{
|
||||
|
@ -353,22 +347,17 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
{
|
||||
f->data.low = 1;
|
||||
f->data.high = 0;
|
||||
lshift_double (f->data.low, f->data.high, i_f_bits,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, 1);
|
||||
f->data = f->data.alshift (i_f_bits, HOST_BITS_PER_DOUBLE_INT);
|
||||
if (get_fixed_sign_bit (a->data, i_f_bits) == 0)
|
||||
{
|
||||
double_int one;
|
||||
one.low = 1;
|
||||
one.high = 0;
|
||||
f->data = double_int_sub (f->data, one);
|
||||
--f->data;
|
||||
}
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
}
|
||||
}
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
return overflow_p;
|
||||
}
|
||||
|
||||
|
@ -386,11 +375,10 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
f->mode = a->mode;
|
||||
if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT)
|
||||
{
|
||||
f->data = double_int_mul (a->data, b->data);
|
||||
lshift_double (f->data.low, f->data.high,
|
||||
(-GET_MODE_FBIT (f->mode)),
|
||||
f->data = a->data * b->data;
|
||||
f->data = f->data.lshift ((-GET_MODE_FBIT (f->mode)),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, !unsigned_p);
|
||||
!unsigned_p);
|
||||
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
|
||||
}
|
||||
else
|
||||
|
@ -412,43 +400,43 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
b_low.high = 0;
|
||||
|
||||
/* Perform four multiplications. */
|
||||
low_low = double_int_mul (a_low, b_low);
|
||||
low_high = double_int_mul (a_low, b_high);
|
||||
high_low = double_int_mul (a_high, b_low);
|
||||
high_high = double_int_mul (a_high, b_high);
|
||||
low_low = a_low * b_low;
|
||||
low_high = a_low * b_high;
|
||||
high_low = a_high * b_low;
|
||||
high_high = a_high * b_high;
|
||||
|
||||
/* Accumulate four results to {r, s}. */
|
||||
temp1.high = high_low.low;
|
||||
temp1.low = 0;
|
||||
s = double_int_add (low_low, temp1);
|
||||
if (double_int_cmp (s, low_low, 1) == -1
|
||||
|| double_int_cmp (s, temp1, 1) == -1)
|
||||
s = low_low + temp1;
|
||||
if (s.ult (low_low)
|
||||
|| s.ult (temp1))
|
||||
carry ++; /* Carry */
|
||||
temp1.high = s.high;
|
||||
temp1.low = s.low;
|
||||
temp2.high = low_high.low;
|
||||
temp2.low = 0;
|
||||
s = double_int_add (temp1, temp2);
|
||||
if (double_int_cmp (s, temp1, 1) == -1
|
||||
|| double_int_cmp (s, temp2, 1) == -1)
|
||||
s = temp1 + temp2;
|
||||
if (s.ult (temp1)
|
||||
|| s.ult (temp2))
|
||||
carry ++; /* Carry */
|
||||
|
||||
temp1.low = high_low.high;
|
||||
temp1.high = 0;
|
||||
r = double_int_add (high_high, temp1);
|
||||
r = high_high + temp1;
|
||||
temp1.low = low_high.high;
|
||||
temp1.high = 0;
|
||||
r = double_int_add (r, temp1);
|
||||
r += temp1;
|
||||
temp1.low = carry;
|
||||
temp1.high = 0;
|
||||
r = double_int_add (r, temp1);
|
||||
r += temp1;
|
||||
|
||||
/* We need to subtract b from r, if a < 0. */
|
||||
if (!unsigned_p && a->data.high < 0)
|
||||
r = double_int_sub (r, b->data);
|
||||
r -= b->data;
|
||||
/* We need to subtract a from r, if b < 0. */
|
||||
if (!unsigned_p && b->data.high < 0)
|
||||
r = double_int_sub (r, a->data);
|
||||
r -= a->data;
|
||||
|
||||
/* Shift right the result by FBIT. */
|
||||
if (GET_MODE_FBIT (f->mode) == HOST_BITS_PER_DOUBLE_INT)
|
||||
|
@ -470,29 +458,23 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
}
|
||||
else
|
||||
{
|
||||
lshift_double (s.low, s.high,
|
||||
(-GET_MODE_FBIT (f->mode)),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&s.low, &s.high, 0);
|
||||
lshift_double (r.low, r.high,
|
||||
(HOST_BITS_PER_DOUBLE_INT
|
||||
s = s.llshift ((-GET_MODE_FBIT (f->mode)), HOST_BITS_PER_DOUBLE_INT);
|
||||
f->data = r.llshift ((HOST_BITS_PER_DOUBLE_INT
|
||||
- GET_MODE_FBIT (f->mode)),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, 0);
|
||||
HOST_BITS_PER_DOUBLE_INT);
|
||||
f->data.low = f->data.low | s.low;
|
||||
f->data.high = f->data.high | s.high;
|
||||
s.low = f->data.low;
|
||||
s.high = f->data.high;
|
||||
lshift_double (r.low, r.high,
|
||||
(-GET_MODE_FBIT (f->mode)),
|
||||
r = r.lshift ((-GET_MODE_FBIT (f->mode)),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&r.low, &r.high, !unsigned_p);
|
||||
!unsigned_p);
|
||||
}
|
||||
|
||||
overflow_p = fixed_saturate2 (f->mode, r, s, &f->data, sat_p);
|
||||
}
|
||||
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
return overflow_p;
|
||||
}
|
||||
|
||||
|
@ -510,11 +492,10 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
f->mode = a->mode;
|
||||
if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT)
|
||||
{
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
GET_MODE_FBIT (f->mode),
|
||||
f->data = a->data.lshift (GET_MODE_FBIT (f->mode),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, !unsigned_p);
|
||||
f->data = double_int_div (f->data, b->data, unsigned_p, TRUNC_DIV_EXPR);
|
||||
!unsigned_p);
|
||||
f->data = f->data.div (b->data, unsigned_p, TRUNC_DIV_EXPR);
|
||||
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
|
||||
}
|
||||
else
|
||||
|
@ -527,7 +508,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
/* If a < 0, negate a. */
|
||||
if (!unsigned_p && a->data.high < 0)
|
||||
{
|
||||
pos_a = double_int_neg (a->data);
|
||||
pos_a = -a->data;
|
||||
num_of_neg ++;
|
||||
}
|
||||
else
|
||||
|
@ -536,7 +517,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
/* If b < 0, negate b. */
|
||||
if (!unsigned_p && b->data.high < 0)
|
||||
{
|
||||
pos_b = double_int_neg (b->data);
|
||||
pos_b = -b->data;
|
||||
num_of_neg ++;
|
||||
}
|
||||
else
|
||||
|
@ -551,24 +532,15 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
}
|
||||
else
|
||||
{
|
||||
lshift_double (pos_a.low, pos_a.high,
|
||||
GET_MODE_FBIT (f->mode),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&s.low, &s.high, 0);
|
||||
lshift_double (pos_a.low, pos_a.high,
|
||||
- (HOST_BITS_PER_DOUBLE_INT
|
||||
s = pos_a.llshift (GET_MODE_FBIT (f->mode), HOST_BITS_PER_DOUBLE_INT);
|
||||
r = pos_a.llshift (- (HOST_BITS_PER_DOUBLE_INT
|
||||
- GET_MODE_FBIT (f->mode)),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&r.low, &r.high, 0);
|
||||
HOST_BITS_PER_DOUBLE_INT);
|
||||
}
|
||||
|
||||
/* Divide r by pos_b to quo_r. The remainder is in mod. */
|
||||
div_and_round_double (TRUNC_DIV_EXPR, 1, r.low, r.high, pos_b.low,
|
||||
pos_b.high, &quo_r.low, &quo_r.high, &mod.low,
|
||||
&mod.high);
|
||||
|
||||
quo_s.high = 0;
|
||||
quo_s.low = 0;
|
||||
quo_r = r.divmod (pos_b, 1, TRUNC_DIV_EXPR, &mod);
|
||||
quo_s = double_int_zero;
|
||||
|
||||
for (i = 0; i < HOST_BITS_PER_DOUBLE_INT; i++)
|
||||
{
|
||||
|
@ -576,37 +548,34 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
int leftmost_mod = (mod.high < 0);
|
||||
|
||||
/* Shift left mod by 1 bit. */
|
||||
lshift_double (mod.low, mod.high, 1, HOST_BITS_PER_DOUBLE_INT,
|
||||
&mod.low, &mod.high, 0);
|
||||
mod = mod.llshift (1, HOST_BITS_PER_DOUBLE_INT);
|
||||
|
||||
/* Test the leftmost bit of s to add to mod. */
|
||||
if (s.high < 0)
|
||||
mod.low += 1;
|
||||
|
||||
/* Shift left quo_s by 1 bit. */
|
||||
lshift_double (quo_s.low, quo_s.high, 1, HOST_BITS_PER_DOUBLE_INT,
|
||||
&quo_s.low, &quo_s.high, 0);
|
||||
quo_s = quo_s.llshift (1, HOST_BITS_PER_DOUBLE_INT);
|
||||
|
||||
/* Try to calculate (mod - pos_b). */
|
||||
temp = double_int_sub (mod, pos_b);
|
||||
temp = mod - pos_b;
|
||||
|
||||
if (leftmost_mod == 1 || double_int_cmp (mod, pos_b, 1) != -1)
|
||||
if (leftmost_mod == 1 || mod.ucmp (pos_b) != -1)
|
||||
{
|
||||
quo_s.low += 1;
|
||||
mod = temp;
|
||||
}
|
||||
|
||||
/* Shift left s by 1 bit. */
|
||||
lshift_double (s.low, s.high, 1, HOST_BITS_PER_DOUBLE_INT,
|
||||
&s.low, &s.high, 0);
|
||||
s = s.llshift (1, HOST_BITS_PER_DOUBLE_INT);
|
||||
|
||||
}
|
||||
|
||||
if (num_of_neg == 1)
|
||||
{
|
||||
quo_s = double_int_neg (quo_s);
|
||||
quo_s = -quo_s;
|
||||
if (quo_s.high == 0 && quo_s.low == 0)
|
||||
quo_r = double_int_neg (quo_r);
|
||||
quo_r = -quo_r;
|
||||
else
|
||||
{
|
||||
quo_r.low = ~quo_r.low;
|
||||
|
@ -618,7 +587,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
overflow_p = fixed_saturate2 (f->mode, quo_r, quo_s, &f->data, sat_p);
|
||||
}
|
||||
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
return overflow_p;
|
||||
}
|
||||
|
||||
|
@ -643,10 +612,9 @@ do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
|
||||
if (GET_MODE_PRECISION (f->mode) <= HOST_BITS_PER_WIDE_INT || (!left_p))
|
||||
{
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
left_p ? b->data.low : (-b->data.low),
|
||||
f->data = a->data.lshift (left_p ? b->data.low : (-b->data.low),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, !unsigned_p);
|
||||
!unsigned_p);
|
||||
if (left_p) /* Only left shift saturates. */
|
||||
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
|
||||
}
|
||||
|
@ -661,23 +629,20 @@ do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
|
|||
}
|
||||
else
|
||||
{
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
b->data.low,
|
||||
temp_low = a->data.lshift (b->data.low,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_low.low, &temp_low.high, !unsigned_p);
|
||||
!unsigned_p);
|
||||
/* Logical shift right to temp_high. */
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
b->data.low - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_high.low, &temp_high.high, 0);
|
||||
temp_high = a->data.llshift (b->data.low - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT);
|
||||
}
|
||||
if (!unsigned_p && a->data.high < 0) /* Signed-extend temp_high. */
|
||||
temp_high = double_int_ext (temp_high, b->data.low, unsigned_p);
|
||||
temp_high = temp_high.ext (b->data.low, unsigned_p);
|
||||
f->data = temp_low;
|
||||
overflow_p = fixed_saturate2 (f->mode, temp_high, temp_low, &f->data,
|
||||
sat_p);
|
||||
}
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
return overflow_p;
|
||||
}
|
||||
|
||||
|
@ -692,8 +657,8 @@ do_fixed_neg (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, bool sat_p)
|
|||
bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode);
|
||||
int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode);
|
||||
f->mode = a->mode;
|
||||
f->data = double_int_neg (a->data);
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = -a->data;
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
|
||||
if (unsigned_p) /* Unsigned type. */
|
||||
{
|
||||
|
@ -718,7 +683,7 @@ do_fixed_neg (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, bool sat_p)
|
|||
/* Saturate to the maximum by subtracting f->data by one. */
|
||||
f->data.low = -1;
|
||||
f->data.high = -1;
|
||||
f->data = double_int_ext (f->data, i_f_bits, 1);
|
||||
f->data = f->data.zext (i_f_bits);
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
|
@ -789,25 +754,25 @@ fixed_compare (int icode, const FIXED_VALUE_TYPE *op0,
|
|||
switch (code)
|
||||
{
|
||||
case NE_EXPR:
|
||||
return !double_int_equal_p (op0->data, op1->data);
|
||||
return op0->data != op1->data;
|
||||
|
||||
case EQ_EXPR:
|
||||
return double_int_equal_p (op0->data, op1->data);
|
||||
return op0->data == op1->data;
|
||||
|
||||
case LT_EXPR:
|
||||
return double_int_cmp (op0->data, op1->data,
|
||||
return op0->data.cmp (op1->data,
|
||||
UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) == -1;
|
||||
|
||||
case LE_EXPR:
|
||||
return double_int_cmp (op0->data, op1->data,
|
||||
return op0->data.cmp (op1->data,
|
||||
UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) != 1;
|
||||
|
||||
case GT_EXPR:
|
||||
return double_int_cmp (op0->data, op1->data,
|
||||
return op0->data.cmp (op1->data,
|
||||
UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) == 1;
|
||||
|
||||
case GE_EXPR:
|
||||
return double_int_cmp (op0->data, op1->data,
|
||||
return op0->data.cmp (op1->data,
|
||||
UNSIGNED_FIXED_POINT_MODE_P (op0->mode)) != -1;
|
||||
|
||||
default:
|
||||
|
@ -835,19 +800,15 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
/* Left shift a to temp_high, temp_low based on a->mode. */
|
||||
double_int temp_high, temp_low;
|
||||
int amount = GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode);
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
amount,
|
||||
temp_low = a->data.lshift (amount,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_low.low, &temp_low.high,
|
||||
SIGNED_FIXED_POINT_MODE_P (a->mode));
|
||||
/* Logical shift right to temp_high. */
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
amount - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_high.low, &temp_high.high, 0);
|
||||
temp_high = a->data.llshift (amount - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT);
|
||||
if (SIGNED_FIXED_POINT_MODE_P (a->mode)
|
||||
&& a->data.high < 0) /* Signed-extend temp_high. */
|
||||
temp_high = double_int_ext (temp_high, amount, 0);
|
||||
temp_high = temp_high.sext (amount);
|
||||
f->mode = mode;
|
||||
f->data = temp_low;
|
||||
if (SIGNED_FIXED_POINT_MODE_P (a->mode) ==
|
||||
|
@ -885,10 +846,9 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
/* Set to maximum. */
|
||||
f->data.low = -1; /* Set to all ones. */
|
||||
f->data.high = -1; /* Set to all ones. */
|
||||
f->data = double_int_ext (f->data,
|
||||
GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
1); /* Clear the sign. */
|
||||
f->data = f->data.zext (GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode));
|
||||
/* Clear the sign. */
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
|
@ -903,10 +863,8 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
{
|
||||
/* Right shift a to temp based on a->mode. */
|
||||
double_int temp;
|
||||
lshift_double (a->data.low, a->data.high,
|
||||
GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode),
|
||||
temp = a->data.lshift (GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode),
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp.low, &temp.high,
|
||||
SIGNED_FIXED_POINT_MODE_P (a->mode));
|
||||
f->mode = mode;
|
||||
f->data = temp;
|
||||
|
@ -944,10 +902,9 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
/* Set to maximum. */
|
||||
f->data.low = -1; /* Set to all ones. */
|
||||
f->data.high = -1; /* Set to all ones. */
|
||||
f->data = double_int_ext (f->data,
|
||||
GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
1); /* Clear the sign. */
|
||||
f->data = f->data.zext (GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode));
|
||||
/* Clear the sign. */
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
|
@ -959,8 +916,7 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
}
|
||||
}
|
||||
|
||||
f->data = double_int_ext (f->data,
|
||||
SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
+ GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
UNSIGNED_FIXED_POINT_MODE_P (f->mode));
|
||||
|
@ -988,19 +944,14 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
}
|
||||
else
|
||||
{
|
||||
lshift_double (a.low, a.high,
|
||||
amount,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_low.low, &temp_low.high, 0);
|
||||
temp_low = a.llshift (amount, HOST_BITS_PER_DOUBLE_INT);
|
||||
|
||||
/* Logical shift right to temp_high. */
|
||||
lshift_double (a.low, a.high,
|
||||
amount - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&temp_high.low, &temp_high.high, 0);
|
||||
temp_high = a.llshift (amount - HOST_BITS_PER_DOUBLE_INT,
|
||||
HOST_BITS_PER_DOUBLE_INT);
|
||||
}
|
||||
if (!unsigned_p && a.high < 0) /* Signed-extend temp_high. */
|
||||
temp_high = double_int_ext (temp_high, amount, 0);
|
||||
temp_high = temp_high.sext (amount);
|
||||
|
||||
f->mode = mode;
|
||||
f->data = temp_low;
|
||||
|
@ -1038,10 +989,9 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
/* Set to maximum. */
|
||||
f->data.low = -1; /* Set to all ones. */
|
||||
f->data.high = -1; /* Set to all ones. */
|
||||
f->data = double_int_ext (f->data,
|
||||
GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
1); /* Clear the sign. */
|
||||
f->data = f->data.zext (GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode));
|
||||
/* Clear the sign. */
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
|
@ -1051,8 +1001,7 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
&f->data, sat_p);
|
||||
}
|
||||
}
|
||||
f->data = double_int_ext (f->data,
|
||||
SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
f->data = f->data.ext (SIGNED_FIXED_POINT_MODE_P (f->mode)
|
||||
+ GET_MODE_FBIT (f->mode)
|
||||
+ GET_MODE_IBIT (f->mode),
|
||||
UNSIGNED_FIXED_POINT_MODE_P (f->mode));
|
||||
|
@ -1093,10 +1042,8 @@ fixed_convert_from_real (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
{
|
||||
f->data.low = 1;
|
||||
f->data.high = 0;
|
||||
lshift_double (f->data.low, f->data.high, i_f_bits,
|
||||
HOST_BITS_PER_DOUBLE_INT,
|
||||
&f->data.low, &f->data.high, 1);
|
||||
f->data = double_int_ext (f->data, 1 + i_f_bits, 0);
|
||||
f->data = f->data.alshift (i_f_bits, HOST_BITS_PER_DOUBLE_INT);
|
||||
f->data = f->data.sext (1 + i_f_bits);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1108,12 +1055,12 @@ fixed_convert_from_real (FIXED_VALUE_TYPE *f, enum machine_mode mode,
|
|||
{
|
||||
f->data.low = -1;
|
||||
f->data.high = -1;
|
||||
f->data = double_int_ext (f->data, i_f_bits, 1);
|
||||
f->data = f->data.zext (i_f_bits);
|
||||
}
|
||||
else
|
||||
overflow_p = true;
|
||||
}
|
||||
f->data = double_int_ext (f->data, (!unsigned_p) + i_f_bits, unsigned_p);
|
||||
f->data = f->data.ext ((!unsigned_p) + i_f_bits, unsigned_p);
|
||||
return overflow_p;
|
||||
}
|
||||
|
||||
|
|
|
@ -14285,7 +14285,7 @@ fold (tree expr)
|
|||
while (begin != end)
|
||||
{
|
||||
unsigned HOST_WIDE_INT middle = (begin + end) / 2;
|
||||
tree index = VEC_index (constructor_elt, elts, middle)->index;
|
||||
tree index = VEC_index (constructor_elt, elts, middle).index;
|
||||
|
||||
if (TREE_CODE (index) == INTEGER_CST
|
||||
&& tree_int_cst_lt (index, op1))
|
||||
|
@ -14300,7 +14300,7 @@ fold (tree expr)
|
|||
&& tree_int_cst_lt (op1, TREE_OPERAND (index, 0)))
|
||||
end = middle;
|
||||
else
|
||||
return VEC_index (constructor_elt, elts, middle)->value;
|
||||
return VEC_index (constructor_elt, elts, middle).value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ struct GTY(()) rtl_eh {
|
|||
|
||||
VEC(uchar,gc) *action_record_data;
|
||||
|
||||
VEC(call_site_record,gc) *call_site_record[2];
|
||||
VEC(call_site_record,gc) *call_site_record_v[2];
|
||||
};
|
||||
|
||||
#define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
|
||||
|
|
|
@ -223,7 +223,7 @@ single_def_use_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
|||
bitmap_copy (local_lr, &lr_bb_info->in);
|
||||
|
||||
/* Push a marker for the leave_block callback. */
|
||||
VEC_safe_push (df_ref, heap, reg_defs_stack, NULL);
|
||||
VEC_safe_push (df_ref, heap, reg_defs_stack, (df_ref) NULL);
|
||||
|
||||
process_uses (df_get_artificial_uses (bb_index), DF_REF_AT_TOP);
|
||||
process_defs (df_get_artificial_defs (bb_index), DF_REF_AT_TOP);
|
||||
|
|
|
@ -2520,7 +2520,7 @@ execute (void)
|
|||
and record info about each one.
|
||||
Also search for the programs that are to be run. */
|
||||
|
||||
VEC_safe_push (const_char_p, heap, argbuf, 0);
|
||||
VEC_safe_push (const_char_p, heap, argbuf, (const_char_p)0);
|
||||
|
||||
commands[0].prog = VEC_index (const_char_p, argbuf, 0); /* first command. */
|
||||
commands[0].argv = VEC_address (const_char_p, argbuf);
|
||||
|
|
|
@ -182,6 +182,13 @@ document pbm
|
|||
Dump the bitmap that is in $ as a comma-separated list of numbers.
|
||||
end
|
||||
|
||||
# Define some macros helpful to gdb when it is expanding macros.
|
||||
macro define __FILE__ "gdb"
|
||||
macro define __LINE__ 1
|
||||
|
||||
# Gracefully handle aborts in functions used from gdb.
|
||||
set unwindonsignal on
|
||||
|
||||
# Put breakpoints at exit and fancy_abort in case abort is mapped
|
||||
# to either fprintf/exit or fancy_abort.
|
||||
b fancy_abort
|
||||
|
@ -196,3 +203,9 @@ set complaints 0
|
|||
# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
|
||||
b exit
|
||||
b abort
|
||||
|
||||
# Skip all inline functions in tree.h.
|
||||
# These are used in accessor macros.
|
||||
# Note that this is added at the end because older gdb versions
|
||||
# do not understand the 'skip' command.
|
||||
skip "tree.h"
|
||||
|
|
|
@ -5076,7 +5076,8 @@ store_alt_unit_usage (regexp_t regexp, regexp_t unit, int cycle,
|
|||
|
||||
length = (cycle + 1) * REGEXP_ONEOF (regexp)->regexps_num;
|
||||
while (VEC_length (unit_usage_t, cycle_alt_unit_usages) < length)
|
||||
VEC_safe_push (unit_usage_t, heap, cycle_alt_unit_usages, 0);
|
||||
VEC_safe_push (unit_usage_t, heap, cycle_alt_unit_usages,
|
||||
(unit_usage_t) NULL);
|
||||
|
||||
index = cycle * REGEXP_ONEOF (regexp)->regexps_num + alt_num;
|
||||
prev = NULL;
|
||||
|
@ -7673,7 +7674,8 @@ output_min_issue_delay_table (automaton_t automaton)
|
|||
|
||||
if (VEC_index (vect_el_t, min_issue_delay_vect, asn))
|
||||
{
|
||||
VEC_replace (vect_el_t, min_issue_delay_vect, asn, 0);
|
||||
VEC_replace (vect_el_t, min_issue_delay_vect, asn,
|
||||
(vect_el_t) 0);
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
|
@ -7723,7 +7725,8 @@ output_min_issue_delay_table (automaton_t automaton)
|
|||
if (automaton->max_min_delay < x)
|
||||
automaton->max_min_delay = x;
|
||||
if (x == -1)
|
||||
VEC_replace (vect_el_t, min_issue_delay_vect, np, 0);
|
||||
VEC_replace (vect_el_t, min_issue_delay_vect, np,
|
||||
(vect_el_t) 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7749,7 +7752,8 @@ output_min_issue_delay_table (automaton_t automaton)
|
|||
= VEC_alloc (vect_el_t, heap, compressed_min_issue_delay_len);
|
||||
|
||||
for (i = 0; i < compressed_min_issue_delay_len; i++)
|
||||
VEC_quick_push (vect_el_t, compressed_min_issue_delay_vect, 0);
|
||||
VEC_quick_push (vect_el_t, compressed_min_issue_delay_vect,
|
||||
(vect_el_t) 0);
|
||||
|
||||
for (i = 0; i < min_issue_delay_len; i++)
|
||||
{
|
||||
|
@ -7798,7 +7802,8 @@ output_dead_lock_vect (automaton_t automaton)
|
|||
automaton->locked_states++;
|
||||
}
|
||||
else
|
||||
VEC_replace (vect_el_t, dead_lock_vect, s->order_state_num, 0);
|
||||
VEC_replace (vect_el_t, dead_lock_vect, s->order_state_num,
|
||||
(vect_el_t) 0);
|
||||
}
|
||||
if (automaton->locked_states == 0)
|
||||
return;
|
||||
|
@ -7840,7 +7845,7 @@ output_reserved_units_table (automaton_t automaton)
|
|||
reserved_units_table = VEC_alloc (vect_el_t, heap, reserved_units_size);
|
||||
|
||||
for (i = 0; i < reserved_units_size; i++)
|
||||
VEC_quick_push (vect_el_t, reserved_units_table, 0);
|
||||
VEC_quick_push (vect_el_t, reserved_units_table, (vect_el_t) 0);
|
||||
for (n = 0; n < VEC_length (state_t, output_states_vect); n++)
|
||||
{
|
||||
state_t s = VEC_index (state_t, output_states_vect, n);
|
||||
|
|
|
@ -201,7 +201,7 @@ VEC_safe_set_locstr (VEC(locstr,heap) **vp, unsigned int ix, char *str)
|
|||
else
|
||||
{
|
||||
while (ix > VEC_length (locstr, *vp))
|
||||
VEC_safe_push (locstr, heap, *vp, 0);
|
||||
VEC_safe_push (locstr, heap, *vp, (locstr) NULL);
|
||||
VEC_safe_push (locstr, heap, *vp, str);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*- indented-text -*- */
|
||||
/* Process source files and output type information.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2012
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -91,19 +91,6 @@ EOID [^[:alnum:]_]
|
|||
BEGIN(in_struct);
|
||||
return STATIC;
|
||||
}
|
||||
|
||||
^{HWS}DEF_VEC_[OP]/{EOID} {
|
||||
BEGIN(in_struct);
|
||||
return DEFVEC_OP;
|
||||
}
|
||||
^{HWS}DEF_VEC_I/{EOID} {
|
||||
BEGIN(in_struct);
|
||||
return DEFVEC_I;
|
||||
}
|
||||
^{HWS}DEF_VEC_ALLOC_[IOP]/{EOID} {
|
||||
BEGIN(in_struct);
|
||||
return DEFVEC_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
<in_struct>{
|
||||
|
@ -121,6 +108,7 @@ EOID [^[:alnum:]_]
|
|||
"enum"/{EOID} { return ENUM; }
|
||||
"ptr_alias"/{EOID} { return PTR_ALIAS; }
|
||||
"nested_ptr"/{EOID} { return NESTED_PTR; }
|
||||
"user"/{EOID} { return USER_GTY; }
|
||||
[0-9]+ { return NUM; }
|
||||
"param"[0-9]*"_is"/{EOID} {
|
||||
*yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Process source files and output type information.
|
||||
Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2007, 2010, 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -77,9 +77,6 @@ static const char *const token_names[] = {
|
|||
"struct",
|
||||
"enum",
|
||||
"VEC",
|
||||
"DEF_VEC_[OP]",
|
||||
"DEF_VEC_I",
|
||||
"DEF_VEC_ALLOC_[IOP]",
|
||||
"...",
|
||||
"ptr_alias",
|
||||
"nested_ptr",
|
||||
|
@ -212,28 +209,70 @@ string_seq (void)
|
|||
return s1;
|
||||
}
|
||||
|
||||
/* typedef_name: either an ID, or VEC(x,y) which is translated to VEC_x_y.
|
||||
Use only where VEC(x,y) is legitimate, i.e. in positions where a
|
||||
typedef name may appear. */
|
||||
|
||||
/* The caller has detected a template declaration that starts
|
||||
with TMPL_NAME. Parse up to the closing '>'. This recognizes
|
||||
simple template declarations of the form ID<ID1,ID2,...,IDn>.
|
||||
It does not try to parse anything more sophisticated than that.
|
||||
|
||||
Returns the template declaration string "ID<ID1,ID2,...,IDn>". */
|
||||
|
||||
static const char *
|
||||
require_template_declaration (const char *tmpl_name)
|
||||
{
|
||||
char *str;
|
||||
|
||||
/* Recognize the opening '<'. */
|
||||
require ('<');
|
||||
str = concat (tmpl_name, "<", (char *) 0);
|
||||
|
||||
/* Read the comma-separated list of identifiers. */
|
||||
while (token () != '>')
|
||||
{
|
||||
const char *id = require2 (ID, ',');
|
||||
if (id == NULL)
|
||||
id = ",";
|
||||
str = concat (str, id, (char *) 0);
|
||||
}
|
||||
|
||||
/* Recognize the closing '>'. */
|
||||
require ('>');
|
||||
str = concat (str, ">", (char *) 0);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/* typedef_name: either an ID, or VEC(x,y), or a template type
|
||||
specification of the form ID<t1,t2,...,tn>.
|
||||
|
||||
FIXME cxx-conversion. VEC(x,y) is currently translated to the
|
||||
template 'vec_t<x>'. This is to support the transition to C++ and
|
||||
avoid re-writing all the 'VEC(x,y)' declarations in the code. This
|
||||
needs to be fixed when the branch is merged into trunk. */
|
||||
|
||||
static const char *
|
||||
typedef_name (void)
|
||||
{
|
||||
if (token () == VEC_TOKEN)
|
||||
{
|
||||
const char *c1, *c2, *r;
|
||||
const char *c1, *r;
|
||||
advance ();
|
||||
require ('(');
|
||||
c1 = require2 (ID, SCALAR);
|
||||
require (',');
|
||||
c2 = require (ID);
|
||||
require (ID);
|
||||
require (')');
|
||||
r = concat ("VEC_", c1, "_", c2, (char *) 0);
|
||||
r = concat ("vec_t<", c1, ">", (char *) 0);
|
||||
free (CONST_CAST (char *, c1));
|
||||
free (CONST_CAST (char *, c2));
|
||||
return r;
|
||||
}
|
||||
|
||||
const char *id = require (ID);
|
||||
if (token () == '<')
|
||||
return require_template_declaration (id);
|
||||
else
|
||||
return require (ID);
|
||||
return id;
|
||||
}
|
||||
|
||||
/* Absorb a sequence of tokens delimited by balanced ()[]{}. */
|
||||
|
@ -460,6 +499,10 @@ option (options_p prev)
|
|||
advance ();
|
||||
return nestedptr_optvalue (prev);
|
||||
|
||||
case USER_GTY:
|
||||
advance ();
|
||||
return create_string_option (prev, "user", "");
|
||||
|
||||
default:
|
||||
parse_error ("expected an option keyword, have %s", print_cur_token ());
|
||||
advance ();
|
||||
|
@ -694,6 +737,18 @@ struct_field_seq (void)
|
|||
return nreverse_pairs (f);
|
||||
}
|
||||
|
||||
/* Return true if OPTS contain the option named STR. */
|
||||
|
||||
static bool
|
||||
opts_have (options_p opts, const char *str)
|
||||
{
|
||||
for (options_p opt = opts; opt; opt = opt->next)
|
||||
if (strcmp (opt->name, str) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* This is called type(), but what it parses (sort of) is what C calls
|
||||
declaration-specifiers and specifier-qualifier-list:
|
||||
|
||||
|
@ -735,7 +790,7 @@ type (options_p *optsp, bool nested)
|
|||
GTY_BEFORE_ID,
|
||||
GTY_AFTER_ID
|
||||
} is_gty = NO_GTY;
|
||||
bool is_union = (token () == UNION);
|
||||
enum typekind kind = (token () == UNION) ? TYPE_UNION : TYPE_STRUCT;
|
||||
advance ();
|
||||
|
||||
/* Top-level structures that are not explicitly tagged GTY(())
|
||||
|
@ -766,6 +821,7 @@ type (options_p *optsp, bool nested)
|
|||
|
||||
if (is_gty)
|
||||
{
|
||||
bool is_user_gty = opts_have (opts, "user");
|
||||
if (token () == '{')
|
||||
{
|
||||
pair_p fields;
|
||||
|
@ -773,17 +829,28 @@ type (options_p *optsp, bool nested)
|
|||
if (is_gty == GTY_AFTER_ID)
|
||||
parse_error ("GTY must be specified before identifier");
|
||||
|
||||
advance ();
|
||||
fields = struct_field_seq ();
|
||||
require ('}');
|
||||
return new_structure (s, is_union, &lexer_line, fields, opts);
|
||||
if (!is_user_gty)
|
||||
{
|
||||
advance ();
|
||||
fields = struct_field_seq ();
|
||||
require ('}');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Do not look inside user defined structures. */
|
||||
fields = NULL;
|
||||
kind = TYPE_USER_STRUCT;
|
||||
consume_balanced ('{', '}');
|
||||
}
|
||||
|
||||
return new_structure (s, kind, &lexer_line, fields, opts);
|
||||
}
|
||||
}
|
||||
else if (token () == '{')
|
||||
consume_balanced ('{', '}');
|
||||
if (opts)
|
||||
*optsp = opts;
|
||||
return find_structure (s, is_union);
|
||||
return find_structure (s, kind);
|
||||
}
|
||||
|
||||
case ENUM:
|
||||
|
@ -891,55 +958,6 @@ extern_or_static (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* Definition of a generic VEC structure:
|
||||
|
||||
'DEF_VEC_[IPO]' '(' id ')' ';'
|
||||
|
||||
Scalar VECs require slightly different treatment than otherwise -
|
||||
that's handled in note_def_vec, we just pass it along.*/
|
||||
static void
|
||||
def_vec (void)
|
||||
{
|
||||
bool is_scalar = (token () == DEFVEC_I);
|
||||
const char *type;
|
||||
|
||||
require2 (DEFVEC_OP, DEFVEC_I);
|
||||
require ('(');
|
||||
type = require2 (ID, SCALAR);
|
||||
require (')');
|
||||
require (';');
|
||||
|
||||
if (!type)
|
||||
return;
|
||||
|
||||
note_def_vec (type, is_scalar, &lexer_line);
|
||||
note_def_vec_alloc (type, "none", &lexer_line);
|
||||
}
|
||||
|
||||
/* Definition of an allocation strategy for a VEC structure:
|
||||
|
||||
'DEF_VEC_ALLOC_[IPO]' '(' id ',' id ')' ';'
|
||||
|
||||
For purposes of gengtype, this just declares a wrapper structure. */
|
||||
static void
|
||||
def_vec_alloc (void)
|
||||
{
|
||||
const char *type, *astrat;
|
||||
|
||||
require (DEFVEC_ALLOC);
|
||||
require ('(');
|
||||
type = require2 (ID, SCALAR);
|
||||
require (',');
|
||||
astrat = require (ID);
|
||||
require (')');
|
||||
require (';');
|
||||
|
||||
if (!type || !astrat)
|
||||
return;
|
||||
|
||||
note_def_vec_alloc (type, astrat, &lexer_line);
|
||||
}
|
||||
|
||||
/* Parse the file FNAME for GC-relevant declarations and definitions.
|
||||
This is the only entry point to this file. */
|
||||
void
|
||||
|
@ -964,15 +982,6 @@ parse_file (const char *fname)
|
|||
typedef_decl ();
|
||||
break;
|
||||
|
||||
case DEFVEC_OP:
|
||||
case DEFVEC_I:
|
||||
def_vec ();
|
||||
break;
|
||||
|
||||
case DEFVEC_ALLOC:
|
||||
def_vec_alloc ();
|
||||
break;
|
||||
|
||||
case EOF_TOKEN:
|
||||
goto eof;
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ type_lineloc (const_type_p ty)
|
|||
case TYPE_STRUCT:
|
||||
case TYPE_UNION:
|
||||
case TYPE_LANG_STRUCT:
|
||||
case TYPE_USER_STRUCT:
|
||||
return CONST_CAST (struct fileloc*, &ty->u.s.line);
|
||||
case TYPE_PARAM_STRUCT:
|
||||
return CONST_CAST (struct fileloc*, &ty->u.param_struct.line);
|
||||
|
@ -798,6 +799,22 @@ write_state_struct_type (type_p current)
|
|||
write_state_type (current->u.s.lang_struct);
|
||||
}
|
||||
|
||||
/* Write a GTY user-defined struct type. */
|
||||
static void
|
||||
write_state_user_struct_type (type_p current)
|
||||
{
|
||||
DBGPRINTF ("user_struct type @ %p #%d '%s'", (void *) current,
|
||||
current->state_number, current->u.s.tag);
|
||||
fprintf (state_file, "user_struct ");
|
||||
write_state_common_type_content (current);
|
||||
if (current->u.s.tag != NULL)
|
||||
write_state_a_string (current->u.s.tag);
|
||||
else
|
||||
fprintf (state_file, "nil");
|
||||
write_state_fileloc (type_lineloc (current));
|
||||
write_state_fields (current->u.s.fields);
|
||||
}
|
||||
|
||||
/* write a GTY union type. */
|
||||
static void
|
||||
write_state_union_type (type_p current)
|
||||
|
@ -828,7 +845,7 @@ write_state_lang_struct_type (type_p current)
|
|||
DBGPRINTF ("homonymous #%d hty @ %p #%d '%s'", nbhomontype,
|
||||
(void *) hty, hty->state_number, hty->u.s.tag);
|
||||
/* Every member of the homonymous list should have the same tag. */
|
||||
gcc_assert (UNION_OR_STRUCT_P (hty));
|
||||
gcc_assert (union_or_struct_p (hty));
|
||||
gcc_assert (hty->u.s.lang_struct == current);
|
||||
if (!homoname)
|
||||
homoname = hty->u.s.tag;
|
||||
|
@ -947,6 +964,9 @@ write_state_type (type_p current)
|
|||
case TYPE_STRUCT:
|
||||
write_state_struct_type (current);
|
||||
break;
|
||||
case TYPE_USER_STRUCT:
|
||||
write_state_user_struct_type (current);
|
||||
break;
|
||||
case TYPE_UNION:
|
||||
write_state_union_type (current);
|
||||
break;
|
||||
|
@ -1365,6 +1385,42 @@ read_state_struct_type (type_p type)
|
|||
}
|
||||
|
||||
|
||||
/* Read a GTY-ed user-provided struct TYPE. */
|
||||
|
||||
static void
|
||||
read_state_user_struct_type (type_p type)
|
||||
{
|
||||
struct state_token_st *t0;
|
||||
|
||||
type->kind = TYPE_USER_STRUCT;
|
||||
read_state_common_type_content (type);
|
||||
t0 = peek_state_token (0);
|
||||
if (state_token_kind (t0) == STOK_STRING)
|
||||
{
|
||||
if (state_token_is_name (t0, "nil"))
|
||||
{
|
||||
type->u.s.tag = NULL;
|
||||
DBGPRINTF ("read anonymous struct type @%p #%d",
|
||||
(void *) type, type->state_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
type->u.s.tag = xstrdup (t0->stok_un.stok_string);
|
||||
DBGPRINTF ("read struct type @%p #%d '%s'",
|
||||
(void *) type, type->state_number, type->u.s.tag);
|
||||
}
|
||||
|
||||
next_state_tokens (1);
|
||||
read_state_fileloc (&(type->u.s.line));
|
||||
read_state_fields (&(type->u.s.fields));
|
||||
}
|
||||
else
|
||||
{
|
||||
fatal_reading_state (t0, "Bad tag in user-struct type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Read a GTY-ed union type. */
|
||||
static void
|
||||
read_state_union_type (type_p type)
|
||||
|
@ -1655,6 +1711,12 @@ read_state_type (type_p *current)
|
|||
next_state_tokens (1);
|
||||
read_state_array_type (*current);
|
||||
}
|
||||
else if (state_token_is_name (t0, "user_struct"))
|
||||
{
|
||||
*current = XCNEW (struct type);
|
||||
next_state_tokens (1);
|
||||
read_state_user_struct_type (*current);
|
||||
}
|
||||
else
|
||||
fatal_reading_state (t0, "bad type in (!type");
|
||||
}
|
||||
|
|
730
gcc/gengtype.c
730
gcc/gengtype.c
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
/* Process source files and output type information.
|
||||
Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010, 2011
|
||||
Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -143,11 +143,14 @@ enum typekind {
|
|||
TYPE_LANG_STRUCT, /* GCC front-end language specific structs.
|
||||
Various languages may have homonymous but
|
||||
different structs. */
|
||||
TYPE_PARAM_STRUCT /* Type for parametrized structs, e.g. hash_t
|
||||
TYPE_PARAM_STRUCT, /* Type for parametrized structs, e.g. hash_t
|
||||
hash-tables, ... See (param_is, use_param,
|
||||
param1_is, param2_is,... use_param1,
|
||||
use_param_2,... use_params) GTY
|
||||
options. */
|
||||
TYPE_USER_STRUCT /* User defined type. Walkers and markers for
|
||||
this type are assumed to be provided by the
|
||||
user. */
|
||||
};
|
||||
|
||||
/* Discriminating kind for options. */
|
||||
|
@ -319,19 +322,27 @@ extern struct type scalar_char;
|
|||
|
||||
/* Test if a type is a union, either a plain one or a language
|
||||
specific one. */
|
||||
#define UNION_P(x) \
|
||||
((x)->kind == TYPE_UNION || \
|
||||
((x)->kind == TYPE_LANG_STRUCT \
|
||||
&& (x)->u.s.lang_struct->kind == TYPE_UNION))
|
||||
#define UNION_P(x) \
|
||||
((x)->kind == TYPE_UNION \
|
||||
|| ((x)->kind == TYPE_LANG_STRUCT \
|
||||
&& (x)->u.s.lang_struct->kind == TYPE_UNION))
|
||||
|
||||
/* Test if a type is a union or a structure, perhaps a language
|
||||
specific one. */
|
||||
#define UNION_OR_STRUCT_P(x) \
|
||||
((x)->kind == TYPE_UNION \
|
||||
|| (x)->kind == TYPE_STRUCT \
|
||||
|| (x)->kind == TYPE_LANG_STRUCT)
|
||||
|
||||
static inline bool
|
||||
union_or_struct_p (enum typekind kind)
|
||||
{
|
||||
return (kind == TYPE_UNION
|
||||
|| kind == TYPE_STRUCT
|
||||
|| kind == TYPE_LANG_STRUCT
|
||||
|| kind == TYPE_USER_STRUCT);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
union_or_struct_p (const_type_p x)
|
||||
{
|
||||
return union_or_struct_p (x->kind);
|
||||
}
|
||||
|
||||
/* Give the file location of a type, if any. */
|
||||
static inline struct fileloc*
|
||||
|
@ -339,7 +350,7 @@ type_fileloc (type_p t)
|
|||
{
|
||||
if (!t)
|
||||
return NULL;
|
||||
if (UNION_OR_STRUCT_P(t))
|
||||
if (union_or_struct_p (t))
|
||||
return &t->u.s.line;
|
||||
if (t->kind == TYPE_PARAM_STRUCT)
|
||||
return &t->u.param_struct.line;
|
||||
|
@ -410,10 +421,10 @@ extern char *xasprintf (const char *, ...) ATTRIBUTE_PRINTF_1;
|
|||
extern void do_typedef (const char *s, type_p t, struct fileloc *pos);
|
||||
extern void do_scalar_typedef (const char *s, struct fileloc *pos);
|
||||
extern type_p resolve_typedef (const char *s, struct fileloc *pos);
|
||||
extern type_p new_structure (const char *name, int isunion,
|
||||
extern type_p new_structure (const char *name, enum typekind kind,
|
||||
struct fileloc *pos, pair_p fields,
|
||||
options_p o);
|
||||
extern type_p find_structure (const char *s, int isunion);
|
||||
extern type_p find_structure (const char *s, enum typekind kind);
|
||||
extern type_p create_scalar_type (const char *name);
|
||||
extern type_p create_pointer (type_p t);
|
||||
extern type_p create_array (type_p t, const char *len);
|
||||
|
@ -424,10 +435,6 @@ extern pair_p nreverse_pairs (pair_p list);
|
|||
extern type_p adjust_field_type (type_p, options_p);
|
||||
extern void note_variable (const char *s, type_p t, options_p o,
|
||||
struct fileloc *pos);
|
||||
extern void note_def_vec (const char *type_name, bool is_scalar,
|
||||
struct fileloc *pos);
|
||||
extern void note_def_vec_alloc (const char *type, const char *astrat,
|
||||
struct fileloc *pos);
|
||||
|
||||
/* Lexer and parser routines. */
|
||||
extern int yylex (const char **yylval);
|
||||
|
@ -453,12 +460,10 @@ enum
|
|||
STRUCT,
|
||||
ENUM,
|
||||
VEC_TOKEN,
|
||||
DEFVEC_OP,
|
||||
DEFVEC_I,
|
||||
DEFVEC_ALLOC,
|
||||
ELLIPSIS,
|
||||
PTR_ALIAS,
|
||||
NESTED_PTR,
|
||||
USER_GTY,
|
||||
PARAM_IS,
|
||||
NUM,
|
||||
SCALAR,
|
||||
|
|
|
@ -1441,6 +1441,26 @@ gt_ggc_m_S (const void *p)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
/* User-callable entry points for marking string X. */
|
||||
|
||||
void
|
||||
gt_ggc_mx (const char *& x)
|
||||
{
|
||||
gt_ggc_m_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_ggc_mx (unsigned char *& x)
|
||||
{
|
||||
gt_ggc_m_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_ggc_mx (unsigned char& x ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* If P is not marked, marks it and return false. Otherwise return true.
|
||||
P must have been allocated by the GC allocator; it mustn't point to
|
||||
static objects, stack variables, or memory allocated with malloc. */
|
||||
|
|
|
@ -1508,6 +1508,26 @@ gt_ggc_m_S (const void *p)
|
|||
ggc_set_mark (p);
|
||||
}
|
||||
|
||||
|
||||
/* User-callable entry points for marking string X. */
|
||||
|
||||
void
|
||||
gt_ggc_mx (const char *& x)
|
||||
{
|
||||
gt_ggc_m_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_ggc_mx (unsigned char *& x)
|
||||
{
|
||||
gt_ggc_m_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_ggc_mx (unsigned char& x ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* If P is not marked, mark it and return false. Otherwise return true.
|
||||
P must have been allocated by the GC allocator; it mustn't point to
|
||||
static objects, stack variables, or memory allocated with malloc. */
|
||||
|
|
|
@ -32,9 +32,6 @@ extern const char empty_string[]; /* empty string */
|
|||
/* Internal functions and data structures used by the GTY
|
||||
machinery, including the generated gt*.[hc] files. */
|
||||
|
||||
/* The first parameter is a pointer to a pointer, the second a cookie. */
|
||||
typedef void (*gt_pointer_operator) (void *, void *);
|
||||
|
||||
#include "gtype-desc.h"
|
||||
|
||||
/* One of these applies its third parameter (with cookie in the fourth
|
||||
|
|
|
@ -121,7 +121,7 @@ lower_function_body (void)
|
|||
if (gimple_seq_may_fallthru (lowered_body)
|
||||
&& (VEC_empty (return_statements_t, data.return_statements)
|
||||
|| gimple_return_retval (VEC_last (return_statements_t,
|
||||
data.return_statements)->stmt) != NULL))
|
||||
data.return_statements).stmt) != NULL))
|
||||
{
|
||||
x = gimple_build_return (NULL);
|
||||
gimple_set_location (x, cfun->function_end_locus);
|
||||
|
@ -137,7 +137,7 @@ lower_function_body (void)
|
|||
|
||||
/* Unfortunately, we can't use VEC_pop because it returns void for
|
||||
objects. */
|
||||
t = *VEC_last (return_statements_t, data.return_statements);
|
||||
t = VEC_last (return_statements_t, data.return_statements);
|
||||
VEC_truncate (return_statements_t,
|
||||
data.return_statements,
|
||||
VEC_length (return_statements_t,
|
||||
|
@ -835,7 +835,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
|
|||
for (i = VEC_length (return_statements_t, data->return_statements) - 1;
|
||||
i >= 0; i--)
|
||||
{
|
||||
tmp_rs = *VEC_index (return_statements_t, data->return_statements, i);
|
||||
tmp_rs = VEC_index (return_statements_t, data->return_statements, i);
|
||||
|
||||
if (gimple_return_retval (stmt) == gimple_return_retval (tmp_rs.stmt))
|
||||
{
|
||||
|
|
|
@ -2116,7 +2116,7 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
fallback_t fallback)
|
||||
{
|
||||
tree *p;
|
||||
VEC(tree,heap) *stack;
|
||||
VEC(tree,heap) *expr_stack;
|
||||
enum gimplify_status ret = GS_ALL_DONE, tret;
|
||||
int i;
|
||||
location_t loc = EXPR_LOCATION (*expr_p);
|
||||
|
@ -2124,7 +2124,7 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
|
||||
/* Create a stack of the subexpressions so later we can walk them in
|
||||
order from inner to outer. */
|
||||
stack = VEC_alloc (tree, heap, 10);
|
||||
expr_stack = VEC_alloc (tree, heap, 10);
|
||||
|
||||
/* We can handle anything that get_inner_reference can deal with. */
|
||||
for (p = expr_p; ; p = &TREE_OPERAND (*p, 0))
|
||||
|
@ -2144,13 +2144,13 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
else
|
||||
break;
|
||||
|
||||
VEC_safe_push (tree, heap, stack, *p);
|
||||
VEC_safe_push (tree, heap, expr_stack, *p);
|
||||
}
|
||||
|
||||
gcc_assert (VEC_length (tree, stack));
|
||||
gcc_assert (VEC_length (tree, expr_stack));
|
||||
|
||||
/* Now STACK is a stack of pointers to all the refs we've walked through
|
||||
and P points to the innermost expression.
|
||||
/* Now EXPR_STACK is a stack of pointers to all the refs we've
|
||||
walked through and P points to the innermost expression.
|
||||
|
||||
Java requires that we elaborated nodes in source order. That
|
||||
means we must gimplify the inner expression followed by each of
|
||||
|
@ -2161,9 +2161,9 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
So we do this in three steps. First we deal with the annotations
|
||||
for any variables in the components, then we gimplify the base,
|
||||
then we gimplify any indices, from left to right. */
|
||||
for (i = VEC_length (tree, stack) - 1; i >= 0; i--)
|
||||
for (i = VEC_length (tree, expr_stack) - 1; i >= 0; i--)
|
||||
{
|
||||
tree t = VEC_index (tree, stack, i);
|
||||
tree t = VEC_index (tree, expr_stack, i);
|
||||
|
||||
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
||||
{
|
||||
|
@ -2256,9 +2256,9 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
|
||||
/* And finally, the indices and operands of ARRAY_REF. During this
|
||||
loop we also remove any useless conversions. */
|
||||
for (; VEC_length (tree, stack) > 0; )
|
||||
for (; VEC_length (tree, expr_stack) > 0; )
|
||||
{
|
||||
tree t = VEC_pop (tree, stack);
|
||||
tree t = VEC_pop (tree, expr_stack);
|
||||
|
||||
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
||||
{
|
||||
|
@ -2286,7 +2286,7 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
canonicalize_component_ref (expr_p);
|
||||
}
|
||||
|
||||
VEC_free (tree, heap, stack);
|
||||
VEC_free (tree, heap, expr_stack);
|
||||
|
||||
gcc_assert (*expr_p == expr || ret != GS_ALL_DONE);
|
||||
|
||||
|
@ -3845,7 +3845,7 @@ optimize_compound_literals_in_ctor (tree orig_ctor)
|
|||
|
||||
for (idx = 0; idx < num; idx++)
|
||||
{
|
||||
tree value = VEC_index (constructor_elt, elts, idx)->value;
|
||||
tree value = VEC_index (constructor_elt, elts, idx).value;
|
||||
tree newval = value;
|
||||
if (TREE_CODE (value) == CONSTRUCTOR)
|
||||
newval = optimize_compound_literals_in_ctor (value);
|
||||
|
@ -3869,7 +3869,7 @@ optimize_compound_literals_in_ctor (tree orig_ctor)
|
|||
CONSTRUCTOR_ELTS (ctor) = VEC_copy (constructor_elt, gc, elts);
|
||||
elts = CONSTRUCTOR_ELTS (ctor);
|
||||
}
|
||||
VEC_index (constructor_elt, elts, idx)->value = newval;
|
||||
VEC_index (constructor_elt, elts, idx).value = newval;
|
||||
}
|
||||
return ctor;
|
||||
}
|
||||
|
@ -4120,8 +4120,8 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
|
||||
/* Extract the real and imaginary parts out of the ctor. */
|
||||
gcc_assert (VEC_length (constructor_elt, elts) == 2);
|
||||
r = VEC_index (constructor_elt, elts, 0)->value;
|
||||
i = VEC_index (constructor_elt, elts, 1)->value;
|
||||
r = VEC_index (constructor_elt, elts, 0).value;
|
||||
i = VEC_index (constructor_elt, elts, 1).value;
|
||||
if (r == NULL || i == NULL)
|
||||
{
|
||||
tree zero = build_zero_cst (TREE_TYPE (type));
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2012-08-14 Diego Novillo <dnovillo@google.com>
|
||||
|
||||
Merge from cxx-conversion branch. Configury.
|
||||
|
||||
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
|
||||
* go-gcc.cc: Likewise.
|
||||
* go-system.h: Likewise.
|
||||
|
||||
2012-07-24 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* go-lang.c (lang_decl): Add variable_size GTY option.
|
||||
|
|
|
@ -20,16 +20,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#ifndef GO_GO_C_H
|
||||
#define GO_GO_C_H
|
||||
|
||||
#ifdef ENABLE_BUILD_WITH_CXX
|
||||
#define GO_EXTERN_C
|
||||
#else
|
||||
#define GO_EXTERN_C extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(ENABLE_BUILD_WITH_CXX)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "machmode.h"
|
||||
|
||||
|
@ -71,8 +62,4 @@ extern const char *go_read_export_data (int, off_t, char **, size_t *, int *);
|
|||
|
||||
extern GTY(()) tree go_non_zero_struct;
|
||||
|
||||
#if defined(__cplusplus) && !defined(ENABLE_BUILD_WITH_CXX)
|
||||
} /* End extern "C". */
|
||||
#endif
|
||||
|
||||
#endif /* !defined(GO_GO_C_H) */
|
||||
|
|
|
@ -24,20 +24,11 @@
|
|||
// include it here before tree.h includes it later.
|
||||
#include <gmp.h>
|
||||
|
||||
#ifndef ENABLE_BUILD_WITH_CXX
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "tree.h"
|
||||
#include "tree-iterator.h"
|
||||
#include "gimple.h"
|
||||
#include "toplev.h"
|
||||
|
||||
#ifndef ENABLE_BUILD_WITH_CXX
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "go-c.h"
|
||||
|
||||
#include "gogo.h"
|
||||
|
|
|
@ -134,11 +134,6 @@ struct hash<T*>
|
|||
// later.
|
||||
#include <cstdio>
|
||||
|
||||
#ifndef ENABLE_BUILD_WITH_CXX
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include "ansidecl.h"
|
||||
#include "coretypes.h"
|
||||
|
@ -147,10 +142,6 @@ extern "C"
|
|||
#include "input.h" /* For source_location. */
|
||||
#include "intl.h" /* For _(). */
|
||||
|
||||
#ifndef ENABLE_BUILD_WITH_CXX
|
||||
} // End extern "C"
|
||||
#endif
|
||||
|
||||
// When using gcc, go_assert is just gcc_assert.
|
||||
#define go_assert(EXPR) gcc_assert(EXPR)
|
||||
|
||||
|
|
|
@ -1249,7 +1249,7 @@ build_sese_conditions_before (struct dom_walk_data *dw_data,
|
|||
if (e->flags & EDGE_TRUE_VALUE)
|
||||
VEC_safe_push (gimple, heap, *cases, stmt);
|
||||
else
|
||||
VEC_safe_push (gimple, heap, *cases, NULL);
|
||||
VEC_safe_push (gimple, heap, *cases, (gimple) NULL);
|
||||
}
|
||||
|
||||
gbb = gbb_from_bb (bb);
|
||||
|
|
190
gcc/hash-table.c
Normal file
190
gcc/hash-table.c
Normal file
|
@ -0,0 +1,190 @@
|
|||
/* A type-safe hash table template.
|
||||
Copyright (C) 2012
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Lawrence Crowl <crowl@google.com>
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* This file implements a typed hash table.
|
||||
The implementation borrows from libiberty's hashtab. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "hash-table.h"
|
||||
|
||||
|
||||
/* Table of primes and multiplicative inverses.
|
||||
|
||||
Note that these are not minimally reduced inverses. Unlike when generating
|
||||
code to divide by a constant, we want to be able to use the same algorithm
|
||||
all the time. All of these inverses (are implied to) have bit 32 set.
|
||||
|
||||
For the record, here's the function that computed the table; it's a
|
||||
vastly simplified version of the function of the same name from gcc. */
|
||||
|
||||
#if 0
|
||||
unsigned int
|
||||
ceil_log2 (unsigned int x)
|
||||
{
|
||||
int i;
|
||||
for (i = 31; i >= 0 ; --i)
|
||||
if (x > (1u << i))
|
||||
return i+1;
|
||||
abort ();
|
||||
}
|
||||
|
||||
unsigned int
|
||||
choose_multiplier (unsigned int d, unsigned int *mlp, unsigned char *shiftp)
|
||||
{
|
||||
unsigned long long mhigh;
|
||||
double nx;
|
||||
int lgup, post_shift;
|
||||
int pow, pow2;
|
||||
int n = 32, precision = 32;
|
||||
|
||||
lgup = ceil_log2 (d);
|
||||
pow = n + lgup;
|
||||
pow2 = n + lgup - precision;
|
||||
|
||||
nx = ldexp (1.0, pow) + ldexp (1.0, pow2);
|
||||
mhigh = nx / d;
|
||||
|
||||
*shiftp = lgup - 1;
|
||||
*mlp = mhigh;
|
||||
return mhigh >> 32;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct prime_ent const prime_tab[] = {
|
||||
{ 7, 0x24924925, 0x9999999b, 2 },
|
||||
{ 13, 0x3b13b13c, 0x745d1747, 3 },
|
||||
{ 31, 0x08421085, 0x1a7b9612, 4 },
|
||||
{ 61, 0x0c9714fc, 0x15b1e5f8, 5 },
|
||||
{ 127, 0x02040811, 0x0624dd30, 6 },
|
||||
{ 251, 0x05197f7e, 0x073260a5, 7 },
|
||||
{ 509, 0x01824366, 0x02864fc8, 8 },
|
||||
{ 1021, 0x00c0906d, 0x014191f7, 9 },
|
||||
{ 2039, 0x0121456f, 0x0161e69e, 10 },
|
||||
{ 4093, 0x00300902, 0x00501908, 11 },
|
||||
{ 8191, 0x00080041, 0x00180241, 12 },
|
||||
{ 16381, 0x000c0091, 0x00140191, 13 },
|
||||
{ 32749, 0x002605a5, 0x002a06e6, 14 },
|
||||
{ 65521, 0x000f00e2, 0x00110122, 15 },
|
||||
{ 131071, 0x00008001, 0x00018003, 16 },
|
||||
{ 262139, 0x00014002, 0x0001c004, 17 },
|
||||
{ 524287, 0x00002001, 0x00006001, 18 },
|
||||
{ 1048573, 0x00003001, 0x00005001, 19 },
|
||||
{ 2097143, 0x00004801, 0x00005801, 20 },
|
||||
{ 4194301, 0x00000c01, 0x00001401, 21 },
|
||||
{ 8388593, 0x00001e01, 0x00002201, 22 },
|
||||
{ 16777213, 0x00000301, 0x00000501, 23 },
|
||||
{ 33554393, 0x00001381, 0x00001481, 24 },
|
||||
{ 67108859, 0x00000141, 0x000001c1, 25 },
|
||||
{ 134217689, 0x000004e1, 0x00000521, 26 },
|
||||
{ 268435399, 0x00000391, 0x000003b1, 27 },
|
||||
{ 536870909, 0x00000019, 0x00000029, 28 },
|
||||
{ 1073741789, 0x0000008d, 0x00000095, 29 },
|
||||
{ 2147483647, 0x00000003, 0x00000007, 30 },
|
||||
/* Avoid "decimal constant so large it is unsigned" for 4294967291. */
|
||||
{ 0xfffffffb, 0x00000006, 0x00000008, 31 }
|
||||
};
|
||||
|
||||
/* The following function returns an index into the above table of the
|
||||
nearest prime number which is greater than N, and near a power of two. */
|
||||
|
||||
unsigned int
|
||||
hash_table_higher_prime_index (unsigned long n)
|
||||
{
|
||||
unsigned int low = 0;
|
||||
unsigned int high = sizeof(prime_tab) / sizeof(prime_tab[0]);
|
||||
|
||||
while (low != high)
|
||||
{
|
||||
unsigned int mid = low + (high - low) / 2;
|
||||
if (n > prime_tab[mid].prime)
|
||||
low = mid + 1;
|
||||
else
|
||||
high = mid;
|
||||
}
|
||||
|
||||
/* If we've run out of primes, abort. */
|
||||
if (n > prime_tab[low].prime)
|
||||
{
|
||||
fprintf (stderr, "Cannot find prime bigger than %lu\n", n);
|
||||
abort ();
|
||||
}
|
||||
|
||||
return low;
|
||||
}
|
||||
|
||||
/* Return X % Y using multiplicative inverse values INV and SHIFT.
|
||||
|
||||
The multiplicative inverses computed above are for 32-bit types,
|
||||
and requires that we be able to compute a highpart multiply.
|
||||
|
||||
FIX: I am not at all convinced that
|
||||
3 loads, 2 multiplications, 3 shifts, and 3 additions
|
||||
will be faster than
|
||||
1 load and 1 modulus
|
||||
on modern systems running a compiler. */
|
||||
|
||||
#ifdef UNSIGNED_64BIT_TYPE
|
||||
static inline hashval_t
|
||||
mul_mod (hashval_t x, hashval_t y, hashval_t inv, int shift)
|
||||
{
|
||||
__extension__ typedef UNSIGNED_64BIT_TYPE ull;
|
||||
hashval_t t1, t2, t3, t4, q, r;
|
||||
|
||||
t1 = ((ull)x * inv) >> 32;
|
||||
t2 = x - t1;
|
||||
t3 = t2 >> 1;
|
||||
t4 = t1 + t3;
|
||||
q = t4 >> shift;
|
||||
r = x - (q * y);
|
||||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute the primary table index for HASH given current prime index. */
|
||||
|
||||
hashval_t
|
||||
hash_table_mod1 (hashval_t hash, unsigned int index)
|
||||
{
|
||||
const struct prime_ent *p = &prime_tab[index];
|
||||
#ifdef UNSIGNED_64BIT_TYPE
|
||||
if (sizeof (hashval_t) * CHAR_BIT <= 32)
|
||||
return mul_mod (hash, p->prime, p->inv, p->shift);
|
||||
#endif
|
||||
return hash % p->prime;
|
||||
}
|
||||
|
||||
|
||||
/* Compute the secondary table index for HASH given current prime index. */
|
||||
|
||||
hashval_t
|
||||
hash_table_mod2 (hashval_t hash, unsigned int index)
|
||||
{
|
||||
const struct prime_ent *p = &prime_tab[index];
|
||||
#ifdef UNSIGNED_64BIT_TYPE
|
||||
if (sizeof (hashval_t) * CHAR_BIT <= 32)
|
||||
return 1 + mul_mod (hash, p->prime - 2, p->inv_m2, p->shift);
|
||||
#endif
|
||||
return 1 + hash % (p->prime - 2);
|
||||
}
|
783
gcc/hash-table.h
Normal file
783
gcc/hash-table.h
Normal file
|
@ -0,0 +1,783 @@
|
|||
/* A type-safe hash table template.
|
||||
Copyright (C) 2012
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Lawrence Crowl <crowl@google.com>
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* This file implements a typed hash table.
|
||||
The implementation borrows from libiberty's hashtab. */
|
||||
|
||||
|
||||
#ifndef TYPED_HASHTAB_H
|
||||
#define TYPED_HASHTAB_H
|
||||
|
||||
#include "hashtab.h"
|
||||
|
||||
|
||||
/* The ordinary memory allocator. */
|
||||
/* FIXME (crowl): This allocator may be extracted for wider sharing later. */
|
||||
|
||||
template <typename Type>
|
||||
struct xcallocator
|
||||
{
|
||||
static Type *control_alloc (size_t count);
|
||||
static Type *data_alloc (size_t count);
|
||||
static void control_free (Type *memory);
|
||||
static void data_free (Type *memory);
|
||||
};
|
||||
|
||||
|
||||
/* Allocate memory for COUNT control blocks. */
|
||||
|
||||
template <typename Type>
|
||||
inline Type *
|
||||
xcallocator <Type>::control_alloc (size_t count)
|
||||
{
|
||||
return static_cast <Type *> (xcalloc (count, sizeof (Type)));
|
||||
}
|
||||
|
||||
|
||||
/* Allocate memory for COUNT data blocks. */
|
||||
|
||||
template <typename Type>
|
||||
inline Type *
|
||||
xcallocator <Type>::data_alloc (size_t count)
|
||||
{
|
||||
return static_cast <Type *> (xcalloc (count, sizeof (Type)));
|
||||
}
|
||||
|
||||
|
||||
/* Free memory for control blocks. */
|
||||
|
||||
template <typename Type>
|
||||
inline void
|
||||
xcallocator <Type>::control_free (Type *memory)
|
||||
{
|
||||
return ::free (memory);
|
||||
}
|
||||
|
||||
|
||||
/* Free memory for data blocks. */
|
||||
|
||||
template <typename Type>
|
||||
inline void
|
||||
xcallocator <Type>::data_free (Type *memory)
|
||||
{
|
||||
return ::free (memory);
|
||||
}
|
||||
|
||||
|
||||
/* A common function for hashing a CANDIDATE typed pointer. */
|
||||
|
||||
template <typename Element>
|
||||
inline hashval_t
|
||||
typed_pointer_hash (const Element *candidate)
|
||||
{
|
||||
/* This is a really poor hash function, but it is what the current code uses,
|
||||
so I am reusing it to avoid an additional axis in testing. */
|
||||
return (hashval_t) ((intptr_t)candidate >> 3);
|
||||
}
|
||||
|
||||
|
||||
/* A common function for comparing an EXISTING and CANDIDATE typed pointers
|
||||
for equality. */
|
||||
|
||||
template <typename Element>
|
||||
inline int
|
||||
typed_pointer_equal (const Element *existing, const Element * candidate)
|
||||
{
|
||||
return existing == candidate;
|
||||
}
|
||||
|
||||
|
||||
/* A common function for doing nothing on removing a RETIRED slot. */
|
||||
|
||||
template <typename Element>
|
||||
inline void
|
||||
typed_null_remove (Element *retired ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* A common function for using free on removing a RETIRED slot. */
|
||||
|
||||
template <typename Element>
|
||||
inline void
|
||||
typed_free_remove (Element *retired)
|
||||
{
|
||||
free (retired);
|
||||
}
|
||||
|
||||
|
||||
/* Table of primes and their inversion information. */
|
||||
|
||||
struct prime_ent
|
||||
{
|
||||
hashval_t prime;
|
||||
hashval_t inv;
|
||||
hashval_t inv_m2; /* inverse of prime-2 */
|
||||
hashval_t shift;
|
||||
};
|
||||
|
||||
extern struct prime_ent const prime_tab[];
|
||||
|
||||
|
||||
/* Functions for computing hash table indexes. */
|
||||
|
||||
extern unsigned int hash_table_higher_prime_index (unsigned long n);
|
||||
extern hashval_t hash_table_mod1 (hashval_t hash, unsigned int index);
|
||||
extern hashval_t hash_table_mod2 (hashval_t hash, unsigned int index);
|
||||
|
||||
|
||||
/* Internal implementation type. */
|
||||
|
||||
template <typename Element>
|
||||
struct hash_table_control
|
||||
{
|
||||
/* Table itself. */
|
||||
Element **entries;
|
||||
|
||||
/* Current size (in entries) of the hash table. */
|
||||
size_t size;
|
||||
|
||||
/* Current number of elements including also deleted elements. */
|
||||
size_t n_elements;
|
||||
|
||||
/* Current number of deleted elements in the table. */
|
||||
size_t n_deleted;
|
||||
|
||||
/* The following member is used for debugging. Its value is number
|
||||
of all calls of `htab_find_slot' for the hash table. */
|
||||
unsigned int searches;
|
||||
|
||||
/* The following member is used for debugging. Its value is number
|
||||
of collisions fixed for time of work with the hash table. */
|
||||
unsigned int collisions;
|
||||
|
||||
/* Current size (in entries) of the hash table, as an index into the
|
||||
table of primes. */
|
||||
unsigned int size_prime_index;
|
||||
};
|
||||
|
||||
|
||||
/* User-facing hash table type.
|
||||
|
||||
The table stores elements of type Element.
|
||||
|
||||
It hashes elements with the Hash function.
|
||||
The table currently works with relatively weak hash functions.
|
||||
Use typed_pointer_hash <Element> when hashing pointers instead of objects.
|
||||
|
||||
It compares elements with the Equal function.
|
||||
Two elements with the same hash may not be equal.
|
||||
Use typed_pointer_equal <Element> when hashing pointers instead of objects.
|
||||
|
||||
It removes elements with the Remove function.
|
||||
This feature is useful for freeing memory.
|
||||
Use typed_null_remove <Element> when not freeing objects.
|
||||
Use typed_free_remove <Element> when doing a simple object free.
|
||||
|
||||
Use the Allocator template to allocate and free memory.
|
||||
The default is xcallocator.
|
||||
|
||||
*/
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator = xcallocator>
|
||||
class hash_table
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
hash_table_control <Element> *htab;
|
||||
|
||||
Element **find_empty_slot_for_expand (hashval_t hash);
|
||||
void expand ();
|
||||
|
||||
public:
|
||||
|
||||
hash_table ();
|
||||
void create (size_t initial_slots);
|
||||
bool is_created ();
|
||||
void dispose ();
|
||||
Element *find (Element *comparable);
|
||||
Element *find_with_hash (Element *comparable, hashval_t hash);
|
||||
Element **find_slot (Element *comparable, enum insert_option insert);
|
||||
Element **find_slot_with_hash (Element *comparable, hashval_t hash,
|
||||
enum insert_option insert);
|
||||
void empty ();
|
||||
void clear_slot (Element **slot);
|
||||
void remove_elt (Element *comparable);
|
||||
void remove_elt_with_hash (Element *comparable, hashval_t hash);
|
||||
size_t size();
|
||||
size_t elements();
|
||||
double collisions();
|
||||
|
||||
template <typename Argument,
|
||||
int (*Callback) (Element **slot, Argument argument)>
|
||||
void traverse_noresize (Argument argument);
|
||||
|
||||
template <typename Argument,
|
||||
int (*Callback) (Element **slot, Argument argument)>
|
||||
void traverse (Argument argument);
|
||||
};
|
||||
|
||||
|
||||
/* Construct the hash table. The only useful operation next is create. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::hash_table ()
|
||||
: htab (NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* See if the table has been created, as opposed to constructed. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline bool
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::is_created ()
|
||||
{
|
||||
return htab != NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Like find_with_hash, but compute the hash value from the element. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline Element *
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::find (Element *comparable)
|
||||
{
|
||||
return find_with_hash (comparable, Hash (comparable));
|
||||
}
|
||||
|
||||
|
||||
/* Like find_slot_with_hash, but compute the hash value from the element. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline Element **
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::find_slot (Element *comparable, enum insert_option insert)
|
||||
{
|
||||
return find_slot_with_hash (comparable, Hash (comparable), insert);
|
||||
}
|
||||
|
||||
|
||||
/* Like remove_elt_with_hash, but compute the hash value from the element. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::remove_elt (Element *comparable)
|
||||
{
|
||||
remove_elt_with_hash (comparable, Hash (comparable));
|
||||
}
|
||||
|
||||
|
||||
/* Return the current size of this hash table. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline size_t
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::size()
|
||||
{
|
||||
return htab->size;
|
||||
}
|
||||
|
||||
|
||||
/* Return the current number of elements in this hash table. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline size_t
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::elements()
|
||||
{
|
||||
return htab->n_elements - htab->n_deleted;
|
||||
}
|
||||
|
||||
|
||||
/* Return the fraction of fixed collisions during all work with given
|
||||
hash table. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
inline double
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::collisions()
|
||||
{
|
||||
if (htab->searches == 0)
|
||||
return 0.0;
|
||||
|
||||
return static_cast <double> (htab->collisions) / htab->searches;
|
||||
}
|
||||
|
||||
|
||||
/* Create a hash table with at least the given number of INITIAL_SLOTS. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::create (size_t size)
|
||||
{
|
||||
unsigned int size_prime_index;
|
||||
|
||||
size_prime_index = hash_table_higher_prime_index (size);
|
||||
size = prime_tab[size_prime_index].prime;
|
||||
|
||||
htab = Allocator <hash_table_control <Element> > ::control_alloc (1);
|
||||
gcc_assert (htab != NULL);
|
||||
htab->entries = Allocator <Element*> ::data_alloc (size);
|
||||
gcc_assert (htab->entries != NULL);
|
||||
htab->size = size;
|
||||
htab->size_prime_index = size_prime_index;
|
||||
}
|
||||
|
||||
|
||||
/* Dispose of a hash table. Free all memory and return this hash table to
|
||||
the non-created state. Naturally the hash table must already exist. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::dispose ()
|
||||
{
|
||||
size_t size = htab->size;
|
||||
Element **entries = htab->entries;
|
||||
|
||||
for (int i = size - 1; i >= 0; i--)
|
||||
if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY)
|
||||
Remove (entries[i]);
|
||||
|
||||
Allocator <Element *> ::data_free (entries);
|
||||
Allocator <hash_table_control <Element> > ::control_free (htab);
|
||||
htab = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Similar to find_slot, but without several unwanted side effects:
|
||||
- Does not call Equal when it finds an existing entry.
|
||||
- Does not change the count of elements/searches/collisions in the
|
||||
hash table.
|
||||
This function also assumes there are no deleted entries in the table.
|
||||
HASH is the hash value for the element to be inserted. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
Element **
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::find_empty_slot_for_expand (hashval_t hash)
|
||||
{
|
||||
hashval_t index = hash_table_mod1 (hash, htab->size_prime_index);
|
||||
size_t size = htab->size;
|
||||
Element **slot = htab->entries + index;
|
||||
hashval_t hash2;
|
||||
|
||||
if (*slot == HTAB_EMPTY_ENTRY)
|
||||
return slot;
|
||||
else if (*slot == HTAB_DELETED_ENTRY)
|
||||
abort ();
|
||||
|
||||
hash2 = hash_table_mod2 (hash, htab->size_prime_index);
|
||||
for (;;)
|
||||
{
|
||||
index += hash2;
|
||||
if (index >= size)
|
||||
index -= size;
|
||||
|
||||
slot = htab->entries + index;
|
||||
if (*slot == HTAB_EMPTY_ENTRY)
|
||||
return slot;
|
||||
else if (*slot == HTAB_DELETED_ENTRY)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The following function changes size of memory allocated for the
|
||||
entries and repeatedly inserts the table elements. The occupancy
|
||||
of the table after the call will be about 50%. Naturally the hash
|
||||
table must already exist. Remember also that the place of the
|
||||
table entries is changed. If memory allocation fails, this function
|
||||
will abort. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::expand ()
|
||||
{
|
||||
Element **oentries;
|
||||
Element **olimit;
|
||||
Element **p;
|
||||
Element **nentries;
|
||||
size_t nsize, osize, elts;
|
||||
unsigned int oindex, nindex;
|
||||
|
||||
oentries = htab->entries;
|
||||
oindex = htab->size_prime_index;
|
||||
osize = htab->size;
|
||||
olimit = oentries + osize;
|
||||
elts = elements ();
|
||||
|
||||
/* Resize only when table after removal of unused elements is either
|
||||
too full or too empty. */
|
||||
if (elts * 2 > osize || (elts * 8 < osize && osize > 32))
|
||||
{
|
||||
nindex = hash_table_higher_prime_index (elts * 2);
|
||||
nsize = prime_tab[nindex].prime;
|
||||
}
|
||||
else
|
||||
{
|
||||
nindex = oindex;
|
||||
nsize = osize;
|
||||
}
|
||||
|
||||
nentries = Allocator <Element *> ::data_alloc (nsize);
|
||||
gcc_assert (nentries != NULL);
|
||||
htab->entries = nentries;
|
||||
htab->size = nsize;
|
||||
htab->size_prime_index = nindex;
|
||||
htab->n_elements -= htab->n_deleted;
|
||||
htab->n_deleted = 0;
|
||||
|
||||
p = oentries;
|
||||
do
|
||||
{
|
||||
Element *x = *p;
|
||||
|
||||
if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
|
||||
{
|
||||
Element **q = find_empty_slot_for_expand (Hash (x));
|
||||
|
||||
*q = x;
|
||||
}
|
||||
|
||||
p++;
|
||||
}
|
||||
while (p < olimit);
|
||||
|
||||
Allocator <Element *> ::data_free (oentries);
|
||||
}
|
||||
|
||||
|
||||
/* This function searches for a hash table entry equal to the given
|
||||
COMPARABLE element starting with the given HASH value. It cannot
|
||||
be used to insert or delete an element. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
Element *
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::find_with_hash (Element *comparable, hashval_t hash)
|
||||
{
|
||||
hashval_t index, hash2;
|
||||
size_t size;
|
||||
Element *entry;
|
||||
|
||||
htab->searches++;
|
||||
size = htab->size;
|
||||
index = hash_table_mod1 (hash, htab->size_prime_index);
|
||||
|
||||
entry = htab->entries[index];
|
||||
if (entry == HTAB_EMPTY_ENTRY
|
||||
|| (entry != HTAB_DELETED_ENTRY && Equal (entry, comparable)))
|
||||
return entry;
|
||||
|
||||
hash2 = hash_table_mod2 (hash, htab->size_prime_index);
|
||||
for (;;)
|
||||
{
|
||||
htab->collisions++;
|
||||
index += hash2;
|
||||
if (index >= size)
|
||||
index -= size;
|
||||
|
||||
entry = htab->entries[index];
|
||||
if (entry == HTAB_EMPTY_ENTRY
|
||||
|| (entry != HTAB_DELETED_ENTRY && Equal (entry, comparable)))
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This function searches for a hash table slot containing an entry
|
||||
equal to the given COMPARABLE element and starting with the given
|
||||
HASH. To delete an entry, call this with insert=NO_INSERT, then
|
||||
call clear_slot on the slot returned (possibly after doing some
|
||||
checks). To insert an entry, call this with insert=INSERT, then
|
||||
write the value you want into the returned slot. When inserting an
|
||||
entry, NULL may be returned if memory allocation fails. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
Element **
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::find_slot_with_hash (Element *comparable, hashval_t hash,
|
||||
enum insert_option insert)
|
||||
{
|
||||
Element **first_deleted_slot;
|
||||
hashval_t index, hash2;
|
||||
size_t size;
|
||||
Element *entry;
|
||||
|
||||
size = htab->size;
|
||||
if (insert == INSERT && size * 3 <= htab->n_elements * 4)
|
||||
{
|
||||
expand ();
|
||||
size = htab->size;
|
||||
}
|
||||
|
||||
index = hash_table_mod1 (hash, htab->size_prime_index);
|
||||
|
||||
htab->searches++;
|
||||
first_deleted_slot = NULL;
|
||||
|
||||
entry = htab->entries[index];
|
||||
if (entry == HTAB_EMPTY_ENTRY)
|
||||
goto empty_entry;
|
||||
else if (entry == HTAB_DELETED_ENTRY)
|
||||
first_deleted_slot = &htab->entries[index];
|
||||
else if (Equal (entry, comparable))
|
||||
return &htab->entries[index];
|
||||
|
||||
hash2 = hash_table_mod2 (hash, htab->size_prime_index);
|
||||
for (;;)
|
||||
{
|
||||
htab->collisions++;
|
||||
index += hash2;
|
||||
if (index >= size)
|
||||
index -= size;
|
||||
|
||||
entry = htab->entries[index];
|
||||
if (entry == HTAB_EMPTY_ENTRY)
|
||||
goto empty_entry;
|
||||
else if (entry == HTAB_DELETED_ENTRY)
|
||||
{
|
||||
if (!first_deleted_slot)
|
||||
first_deleted_slot = &htab->entries[index];
|
||||
}
|
||||
else if (Equal (entry, comparable))
|
||||
return &htab->entries[index];
|
||||
}
|
||||
|
||||
empty_entry:
|
||||
if (insert == NO_INSERT)
|
||||
return NULL;
|
||||
|
||||
if (first_deleted_slot)
|
||||
{
|
||||
htab->n_deleted--;
|
||||
*first_deleted_slot = static_cast <Element *> (HTAB_EMPTY_ENTRY);
|
||||
return first_deleted_slot;
|
||||
}
|
||||
|
||||
htab->n_elements++;
|
||||
return &htab->entries[index];
|
||||
}
|
||||
|
||||
|
||||
/* This function clears all entries in the given hash table. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>::empty ()
|
||||
{
|
||||
size_t size = htab_size (htab);
|
||||
Element **entries = htab->entries;
|
||||
int i;
|
||||
|
||||
for (i = size - 1; i >= 0; i--)
|
||||
if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY)
|
||||
Remove (entries[i]);
|
||||
|
||||
/* Instead of clearing megabyte, downsize the table. */
|
||||
if (size > 1024*1024 / sizeof (PTR))
|
||||
{
|
||||
int nindex = hash_table_higher_prime_index (1024 / sizeof (PTR));
|
||||
int nsize = prime_tab[nindex].prime;
|
||||
|
||||
Allocator <Element *> ::data_free (htab->entries);
|
||||
htab->entries = Allocator <Element *> ::data_alloc (nsize);
|
||||
htab->size = nsize;
|
||||
htab->size_prime_index = nindex;
|
||||
}
|
||||
else
|
||||
memset (entries, 0, size * sizeof (Element *));
|
||||
htab->n_deleted = 0;
|
||||
htab->n_elements = 0;
|
||||
}
|
||||
|
||||
|
||||
/* This function clears a specified SLOT in a hash table. It is
|
||||
useful when you've already done the lookup and don't want to do it
|
||||
again. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::clear_slot (Element **slot)
|
||||
{
|
||||
if (slot < htab->entries || slot >= htab->entries + htab->size
|
||||
|| *slot == HTAB_EMPTY_ENTRY || *slot == HTAB_DELETED_ENTRY)
|
||||
abort ();
|
||||
|
||||
Remove (*slot);
|
||||
|
||||
*slot = HTAB_DELETED_ENTRY;
|
||||
htab->n_deleted++;
|
||||
}
|
||||
|
||||
|
||||
/* This function deletes an element with the given COMPARABLE value
|
||||
from hash table starting with the given HASH. If there is no
|
||||
matching element in the hash table, this function does nothing. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::remove_elt_with_hash (Element *comparable, hashval_t hash)
|
||||
{
|
||||
Element **slot;
|
||||
|
||||
slot = find_slot_with_hash (comparable, hash, NO_INSERT);
|
||||
if (*slot == HTAB_EMPTY_ENTRY)
|
||||
return;
|
||||
|
||||
Remove (*slot);
|
||||
|
||||
*slot = static_cast <Element *> (HTAB_DELETED_ENTRY);
|
||||
htab->n_deleted++;
|
||||
}
|
||||
|
||||
|
||||
/* This function scans over the entire hash table calling CALLBACK for
|
||||
each live entry. If CALLBACK returns false, the iteration stops.
|
||||
ARGUMENT is passed as CALLBACK's second argument. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
template <typename Argument,
|
||||
int (*Callback) (Element **slot, Argument argument)>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::traverse_noresize (Argument argument)
|
||||
{
|
||||
Element **slot;
|
||||
Element **limit;
|
||||
|
||||
slot = htab->entries;
|
||||
limit = slot + htab->size;
|
||||
|
||||
do
|
||||
{
|
||||
Element *x = *slot;
|
||||
|
||||
if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
|
||||
if (! Callback (slot, argument))
|
||||
break;
|
||||
}
|
||||
while (++slot < limit);
|
||||
}
|
||||
|
||||
|
||||
/* Like traverse_noresize, but does resize the table when it is too empty
|
||||
to improve effectivity of subsequent calls. */
|
||||
|
||||
template <typename Element,
|
||||
hashval_t (*Hash) (const Element *candidate),
|
||||
int (*Equal) (const Element *existing, const Element * candidate),
|
||||
void (*Remove) (Element *retired),
|
||||
template <typename Type> class Allocator>
|
||||
template <typename Argument,
|
||||
int (*Callback) (Element **slot, Argument argument)>
|
||||
void
|
||||
hash_table <Element, Hash, Equal, Remove, Allocator>
|
||||
::traverse (Argument argument)
|
||||
{
|
||||
size_t size = htab->size;
|
||||
if (elements () * 8 < size && size > 32)
|
||||
expand ();
|
||||
|
||||
traverse_noresize <Argument, Callback> (argument);
|
||||
}
|
||||
|
||||
#endif /* TYPED_HASHTAB_H */
|
|
@ -345,12 +345,12 @@ discover_loop (hwloop_info loop, basic_block tail_bb, rtx tail_insn, rtx reg)
|
|||
}
|
||||
|
||||
/* Analyze the structure of the loops in the current function. Use
|
||||
STACK for bitmap allocations. Returns all the valid candidates for
|
||||
LOOP_STACK for bitmap allocations. Returns all the valid candidates for
|
||||
hardware loops found in this function. HOOKS is the argument
|
||||
passed to reorg_loops, used here to find the iteration registers
|
||||
from a loop_end pattern. */
|
||||
static hwloop_info
|
||||
discover_loops (bitmap_obstack *stack, struct hw_doloop_hooks *hooks)
|
||||
discover_loops (bitmap_obstack *loop_stack, struct hw_doloop_hooks *hooks)
|
||||
{
|
||||
hwloop_info loops = NULL;
|
||||
hwloop_info loop;
|
||||
|
@ -406,7 +406,7 @@ discover_loops (bitmap_obstack *stack, struct hw_doloop_hooks *hooks)
|
|||
loops = loop;
|
||||
loop->loop_no = nloops++;
|
||||
loop->blocks = VEC_alloc (basic_block, heap, 20);
|
||||
loop->block_bitmap = BITMAP_ALLOC (stack);
|
||||
loop->block_bitmap = BITMAP_ALLOC (loop_stack);
|
||||
|
||||
if (dump_file)
|
||||
{
|
||||
|
@ -626,18 +626,18 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks)
|
|||
{
|
||||
hwloop_info loops = NULL;
|
||||
hwloop_info loop;
|
||||
bitmap_obstack stack;
|
||||
bitmap_obstack loop_stack;
|
||||
|
||||
df_live_add_problem ();
|
||||
df_live_set_all_dirty ();
|
||||
df_analyze ();
|
||||
|
||||
bitmap_obstack_initialize (&stack);
|
||||
bitmap_obstack_initialize (&loop_stack);
|
||||
|
||||
if (dump_file)
|
||||
fprintf (dump_file, ";; Find loops, first pass\n\n");
|
||||
|
||||
loops = discover_loops (&stack, hooks);
|
||||
loops = discover_loops (&loop_stack, hooks);
|
||||
|
||||
if (do_reorder)
|
||||
{
|
||||
|
@ -647,7 +647,7 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks)
|
|||
if (dump_file)
|
||||
fprintf (dump_file, ";; Find loops, second pass\n\n");
|
||||
|
||||
loops = discover_loops (&stack, hooks);
|
||||
loops = discover_loops (&loop_stack, hooks);
|
||||
}
|
||||
|
||||
for (loop = loops; loop; loop = loop->next)
|
||||
|
|
|
@ -331,9 +331,9 @@ add_clause (conditions conditions, struct predicate *p, clause_t clause)
|
|||
condition *cc1;
|
||||
if (!(clause & (1 << c1)))
|
||||
continue;
|
||||
cc1 = VEC_index (condition,
|
||||
conditions,
|
||||
c1 - predicate_first_dynamic_condition);
|
||||
cc1 = &VEC_index (condition,
|
||||
conditions,
|
||||
c1 - predicate_first_dynamic_condition);
|
||||
/* We have no way to represent !CHANGED and !IS_NOT_CONSTANT
|
||||
and thus there is no point for looking for them. */
|
||||
if (cc1->code == CHANGED
|
||||
|
@ -342,12 +342,12 @@ add_clause (conditions conditions, struct predicate *p, clause_t clause)
|
|||
for (c2 = c1 + 1; c2 <= NUM_CONDITIONS; c2++)
|
||||
if (clause & (1 << c2))
|
||||
{
|
||||
condition *cc1 = VEC_index (condition,
|
||||
conditions,
|
||||
c1 - predicate_first_dynamic_condition);
|
||||
condition *cc2 = VEC_index (condition,
|
||||
conditions,
|
||||
c2 - predicate_first_dynamic_condition);
|
||||
condition *cc1 = &VEC_index (condition,
|
||||
conditions,
|
||||
c1 - predicate_first_dynamic_condition);
|
||||
condition *cc2 = &VEC_index (condition,
|
||||
conditions,
|
||||
c2 - predicate_first_dynamic_condition);
|
||||
if (cc1->operand_num == cc2->operand_num
|
||||
&& cc1->val == cc2->val
|
||||
&& cc2->code != IS_NOT_CONSTANT
|
||||
|
@ -512,7 +512,7 @@ predicate_probability (conditions conds,
|
|||
{
|
||||
if (i2 >= predicate_first_dynamic_condition)
|
||||
{
|
||||
condition *c = VEC_index
|
||||
condition *c = &VEC_index
|
||||
(condition, conds,
|
||||
i2 - predicate_first_dynamic_condition);
|
||||
if (c->code == CHANGED
|
||||
|
@ -522,7 +522,7 @@ predicate_probability (conditions conds,
|
|||
{
|
||||
int iprob = VEC_index (inline_param_summary_t,
|
||||
inline_param_summary,
|
||||
c->operand_num)->change_prob;
|
||||
c->operand_num).change_prob;
|
||||
this_prob = MAX (this_prob, iprob);
|
||||
}
|
||||
else
|
||||
|
@ -552,8 +552,8 @@ dump_condition (FILE *f, conditions conditions, int cond)
|
|||
fprintf (f, "not inlined");
|
||||
else
|
||||
{
|
||||
c = VEC_index (condition, conditions,
|
||||
cond - predicate_first_dynamic_condition);
|
||||
c = &VEC_index (condition, conditions,
|
||||
cond - predicate_first_dynamic_condition);
|
||||
fprintf (f, "op%i", c->operand_num);
|
||||
if (c->agg_contents)
|
||||
fprintf (f, "[%soffset: " HOST_WIDE_INT_PRINT_DEC "]",
|
||||
|
@ -648,7 +648,7 @@ account_size_time (struct inline_summary *summary, int size, int time,
|
|||
{
|
||||
i = 0;
|
||||
found = true;
|
||||
e = VEC_index (size_time_entry, summary->entry, 0);
|
||||
e = &VEC_index (size_time_entry, summary->entry, 0);
|
||||
gcc_assert (!e->predicate.clause[0]);
|
||||
}
|
||||
if (dump_file && (dump_flags & TDF_DETAILS) && (time || size))
|
||||
|
@ -834,7 +834,7 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
|
|||
else if (inline_p
|
||||
&& !VEC_index (inline_param_summary_t,
|
||||
es->param,
|
||||
i)->change_prob)
|
||||
i).change_prob)
|
||||
VEC_replace (tree, known_vals, i, error_mark_node);
|
||||
/* TODO: When IPA-CP starts propagating and merging aggregate jump
|
||||
functions, use its knowledge of the caller too, just like the
|
||||
|
@ -1218,7 +1218,7 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
|
|||
i++)
|
||||
{
|
||||
int prob = VEC_index (inline_param_summary_t,
|
||||
es->param, i)->change_prob;
|
||||
es->param, i).change_prob;
|
||||
|
||||
if (!prob)
|
||||
fprintf (f, "%*s op%i is compile time invariant\n",
|
||||
|
@ -1822,8 +1822,8 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
|
|||
return p;
|
||||
/* If we know when operand is constant,
|
||||
we still can say something useful. */
|
||||
if (!true_predicate_p (VEC_index (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (use))))
|
||||
if (!true_predicate_p (&VEC_index (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (use))))
|
||||
continue;
|
||||
return p;
|
||||
}
|
||||
|
@ -1846,14 +1846,14 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
|
|||
continue;
|
||||
}
|
||||
else
|
||||
p = *VEC_index (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (use));
|
||||
p = VEC_index (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (use));
|
||||
op_non_const = or_predicates (summary->conds, &p, &op_non_const);
|
||||
}
|
||||
if (gimple_code (stmt) == GIMPLE_ASSIGN
|
||||
&& TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
|
||||
VEC_replace (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (gimple_assign_lhs (stmt)), &op_non_const);
|
||||
SSA_NAME_VERSION (gimple_assign_lhs (stmt)), op_non_const);
|
||||
return op_non_const;
|
||||
}
|
||||
|
||||
|
@ -2068,7 +2068,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
|
|||
struct predicate false_p = false_predicate ();
|
||||
VEC_replace (predicate_t, nonconstant_names,
|
||||
SSA_NAME_VERSION (gimple_call_lhs (stmt)),
|
||||
&false_p);
|
||||
false_p);
|
||||
}
|
||||
if (ipa_node_params_vector)
|
||||
{
|
||||
|
@ -2083,7 +2083,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
|
|||
int prob = param_change_prob (stmt, i);
|
||||
gcc_assert (prob >= 0 && prob <= REG_BR_PROB_BASE);
|
||||
VEC_index (inline_param_summary_t,
|
||||
es->param, i)->change_prob = prob;
|
||||
es->param, i).change_prob = prob;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2550,8 +2550,8 @@ remap_predicate (struct inline_summary *info,
|
|||
{
|
||||
struct condition *c;
|
||||
|
||||
c = VEC_index (condition, callee_info->conds,
|
||||
cond - predicate_first_dynamic_condition);
|
||||
c = &VEC_index (condition, callee_info->conds,
|
||||
cond - predicate_first_dynamic_condition);
|
||||
/* See if we can remap condition operand to caller's operand.
|
||||
Otherwise give up. */
|
||||
if (!operand_map
|
||||
|
@ -2660,10 +2660,10 @@ remap_edge_change_prob (struct cgraph_edge *inlined_edge,
|
|||
{
|
||||
int jf_formal_id = ipa_get_jf_pass_through_formal_id (jfunc);
|
||||
int prob1 = VEC_index (inline_param_summary_t,
|
||||
es->param, i)->change_prob;
|
||||
es->param, i).change_prob;
|
||||
int prob2 = VEC_index
|
||||
(inline_param_summary_t,
|
||||
inlined_es->param, jf_formal_id)->change_prob;
|
||||
inlined_es->param, jf_formal_id).change_prob;
|
||||
int prob = ((prob1 * prob2 + REG_BR_PROB_BASE / 2)
|
||||
/ REG_BR_PROB_BASE);
|
||||
|
||||
|
@ -2671,7 +2671,7 @@ remap_edge_change_prob (struct cgraph_edge *inlined_edge,
|
|||
prob = 1;
|
||||
|
||||
VEC_index (inline_param_summary_t,
|
||||
es->param, i)->change_prob = prob;
|
||||
es->param, i).change_prob = prob;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2922,12 +2922,12 @@ do_estimate_edge_time (struct cgraph_edge *edge)
|
|||
<= edge->uid)
|
||||
VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
|
||||
cgraph_edge_max_uid);
|
||||
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid)->time
|
||||
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).time
|
||||
= ret + (ret >= 0);
|
||||
|
||||
ret_size = size - es->call_stmt_size;
|
||||
gcc_checking_assert (es->call_stmt_size);
|
||||
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid)->size
|
||||
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).size
|
||||
= ret_size + (ret_size >= 0);
|
||||
}
|
||||
return ret;
|
||||
|
@ -2954,7 +2954,7 @@ do_estimate_edge_growth (struct cgraph_edge *edge)
|
|||
do_estimate_edge_time (edge);
|
||||
size = VEC_index (edge_growth_cache_entry,
|
||||
edge_growth_cache,
|
||||
edge->uid)->size;
|
||||
edge->uid).size;
|
||||
gcc_checking_assert (size);
|
||||
return size - (size > 0);
|
||||
}
|
||||
|
@ -3191,7 +3191,7 @@ read_inline_edge_summary (struct lto_input_block *ib, struct cgraph_edge *e)
|
|||
{
|
||||
VEC_safe_grow_cleared (inline_param_summary_t, heap, es->param, length);
|
||||
for (i = 0; i < length; i++)
|
||||
VEC_index (inline_param_summary_t, es->param, i)->change_prob
|
||||
VEC_index (inline_param_summary_t, es->param, i).change_prob
|
||||
= streamer_read_uhwi (ib);
|
||||
}
|
||||
}
|
||||
|
@ -3350,7 +3350,7 @@ write_inline_edge_summary (struct output_block *ob, struct cgraph_edge *e)
|
|||
streamer_write_uhwi (ob, VEC_length (inline_param_summary_t, es->param));
|
||||
for (i = 0; i < (int)VEC_length (inline_param_summary_t, es->param); i++)
|
||||
streamer_write_uhwi (ob, VEC_index (inline_param_summary_t,
|
||||
es->param, i)->change_prob);
|
||||
es->param, i).change_prob);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1287,7 +1287,7 @@ inline_small_functions (void)
|
|||
{
|
||||
struct cgraph_node *node;
|
||||
struct cgraph_edge *edge;
|
||||
fibheap_t heap = fibheap_new ();
|
||||
fibheap_t edge_heap = fibheap_new ();
|
||||
bitmap updated_nodes = BITMAP_ALLOC (NULL);
|
||||
int min_size, max_size;
|
||||
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
|
||||
|
@ -1344,7 +1344,7 @@ inline_small_functions (void)
|
|||
&& edge->inline_failed)
|
||||
{
|
||||
gcc_assert (!edge->aux);
|
||||
update_edge_key (heap, edge);
|
||||
update_edge_key (edge_heap, edge);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1352,16 +1352,16 @@ inline_small_functions (void)
|
|||
|| !max_count
|
||||
|| (profile_info && flag_branch_probabilities));
|
||||
|
||||
while (!fibheap_empty (heap))
|
||||
while (!fibheap_empty (edge_heap))
|
||||
{
|
||||
int old_size = overall_size;
|
||||
struct cgraph_node *where, *callee;
|
||||
int badness = fibheap_min_key (heap);
|
||||
int badness = fibheap_min_key (edge_heap);
|
||||
int current_badness;
|
||||
int cached_badness;
|
||||
int growth;
|
||||
|
||||
edge = (struct cgraph_edge *) fibheap_extract_min (heap);
|
||||
edge = (struct cgraph_edge *) fibheap_extract_min (edge_heap);
|
||||
gcc_assert (edge->aux);
|
||||
edge->aux = NULL;
|
||||
if (!edge->inline_failed)
|
||||
|
@ -1382,7 +1382,7 @@ inline_small_functions (void)
|
|||
gcc_assert (current_badness >= badness);
|
||||
if (current_badness != badness)
|
||||
{
|
||||
edge->aux = fibheap_insert (heap, current_badness, edge);
|
||||
edge->aux = fibheap_insert (edge_heap, current_badness, edge);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1447,8 +1447,8 @@ inline_small_functions (void)
|
|||
/* Recursive inliner inlines all recursive calls of the function
|
||||
at once. Consequently we need to update all callee keys. */
|
||||
if (flag_indirect_inlining)
|
||||
add_new_edges_to_heap (heap, new_indirect_edges);
|
||||
update_callee_keys (heap, where, updated_nodes);
|
||||
add_new_edges_to_heap (edge_heap, new_indirect_edges);
|
||||
update_callee_keys (edge_heap, where, updated_nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1482,12 +1482,12 @@ inline_small_functions (void)
|
|||
gcc_checking_assert (!callee->global.inlined_to);
|
||||
inline_call (edge, true, &new_indirect_edges, &overall_size, true);
|
||||
if (flag_indirect_inlining)
|
||||
add_new_edges_to_heap (heap, new_indirect_edges);
|
||||
add_new_edges_to_heap (edge_heap, new_indirect_edges);
|
||||
|
||||
reset_edge_caches (edge->callee);
|
||||
reset_node_growth_cache (callee);
|
||||
|
||||
update_callee_keys (heap, edge->callee, updated_nodes);
|
||||
update_callee_keys (edge_heap, edge->callee, updated_nodes);
|
||||
}
|
||||
where = edge->caller;
|
||||
if (where->global.inlined_to)
|
||||
|
@ -1499,7 +1499,7 @@ inline_small_functions (void)
|
|||
inlined into (since it's body size changed) and for the functions
|
||||
called by function we inlined (since number of it inlinable callers
|
||||
might change). */
|
||||
update_caller_keys (heap, where, updated_nodes, NULL);
|
||||
update_caller_keys (edge_heap, where, updated_nodes, NULL);
|
||||
bitmap_clear (updated_nodes);
|
||||
|
||||
if (dump_file)
|
||||
|
@ -1525,7 +1525,7 @@ inline_small_functions (void)
|
|||
free_growth_caches ();
|
||||
if (new_indirect_edges)
|
||||
VEC_free (cgraph_edge_p, heap, new_indirect_edges);
|
||||
fibheap_delete (heap);
|
||||
fibheap_delete (edge_heap);
|
||||
if (dump_file)
|
||||
fprintf (dump_file,
|
||||
"Unit growth for small function inlining: %i->%i (%i%%)\n",
|
||||
|
|
|
@ -200,13 +200,13 @@ extern int nfunctions_inlined;
|
|||
static inline struct inline_summary *
|
||||
inline_summary (struct cgraph_node *node)
|
||||
{
|
||||
return VEC_index (inline_summary_t, inline_summary_vec, node->uid);
|
||||
return &VEC_index (inline_summary_t, inline_summary_vec, node->uid);
|
||||
}
|
||||
|
||||
static inline struct inline_edge_summary *
|
||||
inline_edge_summary (struct cgraph_edge *edge)
|
||||
{
|
||||
return VEC_index (inline_edge_summary_t,
|
||||
return &VEC_index (inline_edge_summary_t,
|
||||
inline_edge_summary_vec, edge->uid);
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ estimate_edge_growth (struct cgraph_edge *edge)
|
|||
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
|
||||
|| !(ret = VEC_index (edge_growth_cache_entry,
|
||||
edge_growth_cache,
|
||||
edge->uid)->size))
|
||||
edge->uid).size))
|
||||
return do_estimate_edge_growth (edge);
|
||||
return ret - (ret > 0);
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ estimate_edge_time (struct cgraph_edge *edge)
|
|||
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
|
||||
|| !(ret = VEC_index (edge_growth_cache_entry,
|
||||
edge_growth_cache,
|
||||
edge->uid)->time))
|
||||
edge->uid).time))
|
||||
return do_estimate_edge_time (edge);
|
||||
return ret - (ret > 0);
|
||||
}
|
||||
|
@ -274,6 +274,6 @@ reset_edge_growth_cache (struct cgraph_edge *edge)
|
|||
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) > edge->uid)
|
||||
{
|
||||
struct edge_growth_cache_entry zero = {0, 0};
|
||||
VEC_replace (edge_growth_cache_entry, edge_growth_cache, edge->uid, &zero);
|
||||
VEC_replace (edge_growth_cache_entry, edge_growth_cache, edge->uid, zero);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ ipa_populate_param_decls (struct cgraph_node *node,
|
|||
for (parm = fnargs; parm; parm = DECL_CHAIN (parm))
|
||||
{
|
||||
VEC_index (ipa_param_descriptor_t,
|
||||
info->descriptors, param_num)->decl = parm;
|
||||
info->descriptors, param_num).decl = parm;
|
||||
param_num++;
|
||||
}
|
||||
}
|
||||
|
@ -2439,10 +2439,10 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
|
|||
old_args->jump_functions);
|
||||
|
||||
for (i = 0; i < VEC_length (ipa_jump_func_t, old_args->jump_functions); i++)
|
||||
VEC_index (ipa_jump_func_t, new_args->jump_functions, i)->agg.items
|
||||
VEC_index (ipa_jump_func_t, new_args->jump_functions, i).agg.items
|
||||
= VEC_copy (ipa_agg_jf_item_t, gc,
|
||||
VEC_index (ipa_jump_func_t,
|
||||
old_args->jump_functions, i)->agg.items);
|
||||
old_args->jump_functions, i).agg.items);
|
||||
}
|
||||
|
||||
/* Hook that is called by cgraph.c when a node is duplicated. */
|
||||
|
@ -2672,7 +2672,7 @@ ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments,
|
|||
struct ipa_parm_adjustment *adj;
|
||||
gcc_assert (link);
|
||||
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
parm = VEC_index (tree, oparms, adj->base_index);
|
||||
adj->base = parm;
|
||||
|
||||
|
@ -2738,8 +2738,8 @@ ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments,
|
|||
When we are asked to remove it, we need to build new FUNCTION_TYPE
|
||||
instead. */
|
||||
if (TREE_CODE (orig_type) != METHOD_TYPE
|
||||
|| (VEC_index (ipa_parm_adjustment_t, adjustments, 0)->copy_param
|
||||
&& VEC_index (ipa_parm_adjustment_t, adjustments, 0)->base_index == 0))
|
||||
|| (VEC_index (ipa_parm_adjustment_t, adjustments, 0).copy_param
|
||||
&& VEC_index (ipa_parm_adjustment_t, adjustments, 0).base_index == 0))
|
||||
{
|
||||
new_type = build_distinct_type_copy (orig_type);
|
||||
TYPE_ARG_TYPES (new_type) = new_reversed;
|
||||
|
@ -2806,7 +2806,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
|
|||
{
|
||||
struct ipa_parm_adjustment *adj;
|
||||
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
|
||||
if (adj->copy_param)
|
||||
{
|
||||
|
@ -2989,7 +2989,7 @@ index_in_adjustments_multiple_times_p (int base_index,
|
|||
for (i = 0; i < len; i++)
|
||||
{
|
||||
struct ipa_parm_adjustment *adj;
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
|
||||
if (adj->base_index == base_index)
|
||||
{
|
||||
|
@ -3020,7 +3020,7 @@ ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
|
|||
for (i = 0; i < inlen; i++)
|
||||
{
|
||||
struct ipa_parm_adjustment *n;
|
||||
n = VEC_index (ipa_parm_adjustment_t, inner, i);
|
||||
n = &VEC_index (ipa_parm_adjustment_t, inner, i);
|
||||
|
||||
if (n->remove_param)
|
||||
removals++;
|
||||
|
@ -3032,10 +3032,10 @@ ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
|
|||
for (i = 0; i < outlen; i++)
|
||||
{
|
||||
struct ipa_parm_adjustment *r;
|
||||
struct ipa_parm_adjustment *out = VEC_index (ipa_parm_adjustment_t,
|
||||
outer, i);
|
||||
struct ipa_parm_adjustment *in = VEC_index (ipa_parm_adjustment_t, tmp,
|
||||
out->base_index);
|
||||
struct ipa_parm_adjustment *out = &VEC_index (ipa_parm_adjustment_t,
|
||||
outer, i);
|
||||
struct ipa_parm_adjustment *in = &VEC_index (ipa_parm_adjustment_t, tmp,
|
||||
out->base_index);
|
||||
|
||||
gcc_assert (!in->remove_param);
|
||||
if (out->remove_param)
|
||||
|
@ -3068,8 +3068,8 @@ ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
|
|||
|
||||
for (i = 0; i < inlen; i++)
|
||||
{
|
||||
struct ipa_parm_adjustment *n = VEC_index (ipa_parm_adjustment_t,
|
||||
inner, i);
|
||||
struct ipa_parm_adjustment *n = &VEC_index (ipa_parm_adjustment_t,
|
||||
inner, i);
|
||||
|
||||
if (n->remove_param)
|
||||
VEC_quick_push (ipa_parm_adjustment_t, adjustments, n);
|
||||
|
@ -3094,7 +3094,7 @@ ipa_dump_param_adjustments (FILE *file, ipa_parm_adjustment_vec adjustments,
|
|||
for (i = 0; i < len; i++)
|
||||
{
|
||||
struct ipa_parm_adjustment *adj;
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
|
||||
if (!first)
|
||||
fprintf (file, " ");
|
||||
|
|
|
@ -359,7 +359,7 @@ ipa_get_param_count (struct ipa_node_params *info)
|
|||
static inline tree
|
||||
ipa_get_param (struct ipa_node_params *info, int i)
|
||||
{
|
||||
return VEC_index (ipa_param_descriptor_t, info->descriptors, i)->decl;
|
||||
return VEC_index (ipa_param_descriptor_t, info->descriptors, i).decl;
|
||||
}
|
||||
|
||||
/* Set the used flag corresponding to the Ith formal parameter of the function
|
||||
|
@ -368,7 +368,7 @@ ipa_get_param (struct ipa_node_params *info, int i)
|
|||
static inline void
|
||||
ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
|
||||
{
|
||||
VEC_index (ipa_param_descriptor_t, info->descriptors, i)->used = val;
|
||||
VEC_index (ipa_param_descriptor_t, info->descriptors, i).used = val;
|
||||
}
|
||||
|
||||
/* Return the used flag corresponding to the Ith formal parameter of the
|
||||
|
@ -377,7 +377,7 @@ ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
|
|||
static inline bool
|
||||
ipa_is_param_used (struct ipa_node_params *info, int i)
|
||||
{
|
||||
return VEC_index (ipa_param_descriptor_t, info->descriptors, i)->used;
|
||||
return VEC_index (ipa_param_descriptor_t, info->descriptors, i).used;
|
||||
}
|
||||
|
||||
/* ipa_edge_args stores information related to a callsite and particularly its
|
||||
|
@ -406,7 +406,7 @@ ipa_get_cs_argument_count (struct ipa_edge_args *args)
|
|||
static inline struct ipa_jump_func *
|
||||
ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
|
||||
{
|
||||
return VEC_index (ipa_jump_func_t, args->jump_functions, i);
|
||||
return &VEC_index (ipa_jump_func_t, args->jump_functions, i);
|
||||
}
|
||||
|
||||
/* Vectors need to have typedefs of structures. */
|
||||
|
@ -425,10 +425,10 @@ extern GTY(()) VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
|
|||
|
||||
/* Return the associated parameter/argument info corresponding to the given
|
||||
node/edge. */
|
||||
#define IPA_NODE_REF(NODE) (VEC_index (ipa_node_params_t, \
|
||||
ipa_node_params_vector, (NODE)->uid))
|
||||
#define IPA_EDGE_REF(EDGE) (VEC_index (ipa_edge_args_t, \
|
||||
ipa_edge_args_vector, (EDGE)->uid))
|
||||
#define IPA_NODE_REF(NODE) (&VEC_index (ipa_node_params_t, \
|
||||
ipa_node_params_vector, (NODE)->uid))
|
||||
#define IPA_EDGE_REF(EDGE) (&VEC_index (ipa_edge_args_t, \
|
||||
ipa_edge_args_vector, (EDGE)->uid))
|
||||
/* This macro checks validity of index returned by
|
||||
ipa_get_param_decl_index function. */
|
||||
#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)
|
||||
|
|
|
@ -73,7 +73,7 @@ ipa_ref_list_first_reference (struct ipa_ref_list *list)
|
|||
{
|
||||
if (!VEC_length (ipa_ref_t, list->references))
|
||||
return NULL;
|
||||
return VEC_index (ipa_ref_t, list->references, 0);
|
||||
return &VEC_index (ipa_ref_t, list->references, 0);
|
||||
}
|
||||
|
||||
/* Return first referring ref in LIST or NULL if empty. */
|
||||
|
|
|
@ -49,7 +49,7 @@ ipa_record_reference (symtab_node referring_node,
|
|||
old_references = list->references;
|
||||
VEC_safe_grow (ipa_ref_t, gc, list->references,
|
||||
VEC_length (ipa_ref_t, list->references) + 1);
|
||||
ref = VEC_last (ipa_ref_t, list->references);
|
||||
ref = &VEC_last (ipa_ref_t, list->references);
|
||||
|
||||
list2 = &referred_node->symbol.ref_list;
|
||||
VEC_safe_push (ipa_ref_ptr, heap, list2->referring, ref);
|
||||
|
@ -93,7 +93,7 @@ ipa_remove_reference (struct ipa_ref *ref)
|
|||
}
|
||||
VEC_pop (ipa_ref_ptr, list->referring);
|
||||
|
||||
last = VEC_last (ipa_ref_t, list2->references);
|
||||
last = &VEC_last (ipa_ref_t, list2->references);
|
||||
if (ref != last)
|
||||
{
|
||||
*ref = *last;
|
||||
|
@ -111,7 +111,7 @@ void
|
|||
ipa_remove_all_references (struct ipa_ref_list *list)
|
||||
{
|
||||
while (VEC_length (ipa_ref_t, list->references))
|
||||
ipa_remove_reference (VEC_last (ipa_ref_t, list->references));
|
||||
ipa_remove_reference (&VEC_last (ipa_ref_t, list->references));
|
||||
VEC_free (ipa_ref_t, gc, list->references);
|
||||
list->references = NULL;
|
||||
}
|
||||
|
|
|
@ -917,7 +917,7 @@ find_split_points (int overall_time, int overall_size)
|
|||
|
||||
while (!VEC_empty (stack_entry, stack))
|
||||
{
|
||||
stack_entry *entry = VEC_last (stack_entry, stack);
|
||||
stack_entry *entry = &VEC_last (stack_entry, stack);
|
||||
|
||||
/* We are walking an acyclic graph, so edge_num counts
|
||||
succ and pred edges together. However when considering
|
||||
|
@ -984,9 +984,9 @@ find_split_points (int overall_time, int overall_size)
|
|||
new_entry.bb = dest;
|
||||
new_entry.edge_num = 0;
|
||||
new_entry.overall_time
|
||||
= VEC_index (bb_info, bb_info_vec, dest->index)->time;
|
||||
= VEC_index (bb_info, bb_info_vec, dest->index).time;
|
||||
new_entry.overall_size
|
||||
= VEC_index (bb_info, bb_info_vec, dest->index)->size;
|
||||
= VEC_index (bb_info, bb_info_vec, dest->index).size;
|
||||
new_entry.earliest = INT_MAX;
|
||||
new_entry.set_ssa_names = BITMAP_ALLOC (NULL);
|
||||
new_entry.used_ssa_names = BITMAP_ALLOC (NULL);
|
||||
|
@ -1006,8 +1006,8 @@ find_split_points (int overall_time, int overall_size)
|
|||
and merge stuff we accumulate during the walk. */
|
||||
else if (entry->bb != ENTRY_BLOCK_PTR)
|
||||
{
|
||||
stack_entry *prev = VEC_index (stack_entry, stack,
|
||||
VEC_length (stack_entry, stack) - 2);
|
||||
stack_entry *prev = &VEC_index (stack_entry, stack,
|
||||
VEC_length (stack_entry, stack) - 2);
|
||||
|
||||
entry->bb->aux = (void *)(intptr_t)-1;
|
||||
prev->can_split &= entry->can_split;
|
||||
|
@ -1489,8 +1489,8 @@ execute_split_functions (void)
|
|||
}
|
||||
overall_time += time;
|
||||
overall_size += size;
|
||||
VEC_index (bb_info, bb_info_vec, bb->index)->time = time;
|
||||
VEC_index (bb_info, bb_info_vec, bb->index)->size = size;
|
||||
VEC_index (bb_info, bb_info_vec, bb->index).time = time;
|
||||
VEC_index (bb_info, bb_info_vec, bb->index).size = size;
|
||||
}
|
||||
find_split_points (overall_time, overall_size);
|
||||
if (best_split_point.split_bbs)
|
||||
|
|
|
@ -233,6 +233,6 @@ uses_jv_markobj_p (tree dtable)
|
|||
this function is only used with flag_reduced_reflection. No
|
||||
point in asserting unless we hit the bad case. */
|
||||
gcc_assert (!flag_reduced_reflection || TARGET_VTABLE_USES_DESCRIPTORS == 0);
|
||||
v = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (dtable), 3)->value;
|
||||
v = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (dtable), 3).value;
|
||||
return (PROCEDURE_OBJECT_DESCRIPTOR == TREE_INT_CST_LOW (v));
|
||||
}
|
||||
|
|
|
@ -1533,7 +1533,7 @@ make_method_value (tree mdecl)
|
|||
v = VEC_alloc (constructor_elt, gc, length);
|
||||
VEC_safe_grow_cleared (constructor_elt, gc, v, length);
|
||||
|
||||
e = VEC_index (constructor_elt, v, idx--);
|
||||
e = &VEC_index (constructor_elt, v, idx--);
|
||||
e->value = null_pointer_node;
|
||||
|
||||
FOR_EACH_VEC_ELT (tree, DECL_FUNCTION_THROWS (mdecl), ix, t)
|
||||
|
@ -1542,7 +1542,7 @@ make_method_value (tree mdecl)
|
|||
tree utf8
|
||||
= build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig),
|
||||
IDENTIFIER_LENGTH (sig)));
|
||||
e = VEC_index (constructor_elt, v, idx--);
|
||||
e = &VEC_index (constructor_elt, v, idx--);
|
||||
e->value = utf8;
|
||||
}
|
||||
gcc_assert (idx == -1);
|
||||
|
@ -1621,7 +1621,7 @@ get_dispatch_table (tree type, tree this_class_addr)
|
|||
arraysize += 2;
|
||||
|
||||
VEC_safe_grow_cleared (constructor_elt, gc, v, arraysize);
|
||||
e = VEC_index (constructor_elt, v, arraysize - 1);
|
||||
e = &VEC_index (constructor_elt, v, arraysize - 1);
|
||||
|
||||
#define CONSTRUCTOR_PREPEND_VALUE(E, V) E->value = V, E--
|
||||
for (i = nvirtuals; --i >= 0; )
|
||||
|
@ -3007,7 +3007,7 @@ emit_catch_table (tree this_class)
|
|||
int n_catch_classes;
|
||||
constructor_elt *e;
|
||||
/* Fill in the dummy entry that make_class created. */
|
||||
e = VEC_index (constructor_elt, TYPE_CATCH_CLASSES (this_class), 0);
|
||||
e = &VEC_index (constructor_elt, TYPE_CATCH_CLASSES (this_class), 0);
|
||||
e->value = make_catch_class_record (null_pointer_node, null_pointer_node);
|
||||
CONSTRUCTOR_APPEND_ELT (TYPE_CATCH_CLASSES (this_class), NULL_TREE,
|
||||
make_catch_class_record (null_pointer_node,
|
||||
|
|
|
@ -514,8 +514,8 @@ build_constants_constructor (void)
|
|||
int c = outgoing_cpool->count;
|
||||
VEC_safe_grow_cleared (constructor_elt, gc, tags, c);
|
||||
VEC_safe_grow_cleared (constructor_elt, gc, data, c);
|
||||
t = VEC_index (constructor_elt, tags, c-1);
|
||||
d = VEC_index (constructor_elt, data, c-1);
|
||||
t = &VEC_index (constructor_elt, tags, c-1);
|
||||
d = &VEC_index (constructor_elt, data, c-1);
|
||||
}
|
||||
|
||||
#define CONSTRUCTOR_PREPEND_VALUE(E, V) E->value = V, E--
|
||||
|
|
|
@ -1430,7 +1430,7 @@ extern tree *type_map;
|
|||
#define PUSH_SUPER_VALUE(V, VALUE) \
|
||||
do \
|
||||
{ \
|
||||
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
|
||||
constructor_elt *_elt___ = &VEC_last (constructor_elt, V); \
|
||||
tree _next___ = DECL_CHAIN (_elt___->index); \
|
||||
gcc_assert (!DECL_NAME (_elt___->index)); \
|
||||
_elt___->value = VALUE; \
|
||||
|
@ -1444,7 +1444,7 @@ extern tree *type_map;
|
|||
#define PUSH_FIELD_VALUE(V, NAME, VALUE) \
|
||||
do \
|
||||
{ \
|
||||
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
|
||||
constructor_elt *_elt___ = &VEC_last (constructor_elt, V); \
|
||||
tree _next___ = DECL_CHAIN (_elt___->index); \
|
||||
gcc_assert (strcmp (IDENTIFIER_POINTER (DECL_NAME (_elt___->index)), \
|
||||
NAME) == 0); \
|
||||
|
|
|
@ -229,7 +229,7 @@ static void remove_node_from_ps (partial_schedule_ptr, ps_insn_ptr);
|
|||
|
||||
#define NODE_ASAP(node) ((node)->aux.count)
|
||||
|
||||
#define SCHED_PARAMS(x) VEC_index (node_sched_params, node_sched_param_vec, x)
|
||||
#define SCHED_PARAMS(x) (&VEC_index (node_sched_params, node_sched_param_vec, x))
|
||||
#define SCHED_TIME(x) (SCHED_PARAMS (x)->time)
|
||||
#define SCHED_ROW(x) (SCHED_PARAMS (x)->row)
|
||||
#define SCHED_STAGE(x) (SCHED_PARAMS (x)->stage)
|
||||
|
@ -305,7 +305,7 @@ static struct ps_reg_move_info *
|
|||
ps_reg_move (partial_schedule_ptr ps, int id)
|
||||
{
|
||||
gcc_checking_assert (id >= ps->g->num_nodes);
|
||||
return VEC_index (ps_reg_move_info, ps->reg_moves, id - ps->g->num_nodes);
|
||||
return &VEC_index (ps_reg_move_info, ps->reg_moves, id - ps->g->num_nodes);
|
||||
}
|
||||
|
||||
/* Return the rtl instruction that is being scheduled by partial schedule
|
||||
|
|
|
@ -3209,7 +3209,7 @@ objc_build_constructor (tree type, VEC(constructor_elt,gc) *elts)
|
|||
#ifdef OBJCPLUS
|
||||
/* Adjust for impedance mismatch. We should figure out how to build
|
||||
CONSTRUCTORs that consistently please both the C and C++ gods. */
|
||||
if (!VEC_index (constructor_elt, elts, 0)->index)
|
||||
if (!VEC_index (constructor_elt, elts, 0).index)
|
||||
TREE_TYPE (constructor) = init_list_type_node;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -802,7 +802,7 @@ add_removable_extension (const_rtx expr, rtx insn,
|
|||
different extension. FIXME: this obviously can be improved. */
|
||||
for (def = defs; def; def = def->next)
|
||||
if ((idx = def_map[INSN_UID(DF_REF_INSN (def->ref))])
|
||||
&& (cand = VEC_index (ext_cand, *insn_list, idx - 1))
|
||||
&& (cand = &VEC_index (ext_cand, *insn_list, idx - 1))
|
||||
&& (cand->code != code || cand->mode != mode))
|
||||
{
|
||||
if (dump_file)
|
||||
|
|
|
@ -201,7 +201,7 @@ typedef struct stack_def
|
|||
int top; /* index to top stack element */
|
||||
HARD_REG_SET reg_set; /* set of live registers */
|
||||
unsigned char reg[REG_STACK_SIZE];/* register - stack mapping */
|
||||
} *stack;
|
||||
} *stack_ptr;
|
||||
|
||||
/* This is used to carry information about basic blocks. It is
|
||||
attached to the AUX field of the standard CFG block. */
|
||||
|
@ -246,7 +246,7 @@ static rtx not_a_num;
|
|||
/* Forward declarations */
|
||||
|
||||
static int stack_regs_mentioned_p (const_rtx pat);
|
||||
static void pop_stack (stack, int);
|
||||
static void pop_stack (stack_ptr, int);
|
||||
static rtx *get_true_reg (rtx *);
|
||||
|
||||
static int check_asm_stack_operands (rtx);
|
||||
|
@ -254,19 +254,19 @@ static void get_asm_operands_in_out (rtx, int *, int *);
|
|||
static rtx stack_result (tree);
|
||||
static void replace_reg (rtx *, int);
|
||||
static void remove_regno_note (rtx, enum reg_note, unsigned int);
|
||||
static int get_hard_regnum (stack, rtx);
|
||||
static rtx emit_pop_insn (rtx, stack, rtx, enum emit_where);
|
||||
static void swap_to_top(rtx, stack, rtx, rtx);
|
||||
static bool move_for_stack_reg (rtx, stack, rtx);
|
||||
static bool move_nan_for_stack_reg (rtx, stack, rtx);
|
||||
static int get_hard_regnum (stack_ptr, rtx);
|
||||
static rtx emit_pop_insn (rtx, stack_ptr, rtx, enum emit_where);
|
||||
static void swap_to_top(rtx, stack_ptr, rtx, rtx);
|
||||
static bool move_for_stack_reg (rtx, stack_ptr, rtx);
|
||||
static bool move_nan_for_stack_reg (rtx, stack_ptr, rtx);
|
||||
static int swap_rtx_condition_1 (rtx);
|
||||
static int swap_rtx_condition (rtx);
|
||||
static void compare_for_stack_reg (rtx, stack, rtx);
|
||||
static bool subst_stack_regs_pat (rtx, stack, rtx);
|
||||
static void subst_asm_stack_regs (rtx, stack);
|
||||
static bool subst_stack_regs (rtx, stack);
|
||||
static void change_stack (rtx, stack, stack, enum emit_where);
|
||||
static void print_stack (FILE *, stack);
|
||||
static void compare_for_stack_reg (rtx, stack_ptr, rtx);
|
||||
static bool subst_stack_regs_pat (rtx, stack_ptr, rtx);
|
||||
static void subst_asm_stack_regs (rtx, stack_ptr);
|
||||
static bool subst_stack_regs (rtx, stack_ptr);
|
||||
static void change_stack (rtx, stack_ptr, stack_ptr, enum emit_where);
|
||||
static void print_stack (FILE *, stack_ptr);
|
||||
static rtx next_flags_user (rtx);
|
||||
|
||||
/* Return nonzero if any stack register is mentioned somewhere within PAT. */
|
||||
|
@ -354,7 +354,7 @@ next_flags_user (rtx insn)
|
|||
/* Reorganize the stack into ascending numbers, before this insn. */
|
||||
|
||||
static void
|
||||
straighten_stack (rtx insn, stack regstack)
|
||||
straighten_stack (rtx insn, stack_ptr regstack)
|
||||
{
|
||||
struct stack_def temp_stack;
|
||||
int top;
|
||||
|
@ -377,7 +377,7 @@ straighten_stack (rtx insn, stack regstack)
|
|||
/* Pop a register from the stack. */
|
||||
|
||||
static void
|
||||
pop_stack (stack regstack, int regno)
|
||||
pop_stack (stack_ptr regstack, int regno)
|
||||
{
|
||||
int top = regstack->top;
|
||||
|
||||
|
@ -721,7 +721,7 @@ remove_regno_note (rtx insn, enum reg_note note, unsigned int regno)
|
|||
returned if the register is not found. */
|
||||
|
||||
static int
|
||||
get_hard_regnum (stack regstack, rtx reg)
|
||||
get_hard_regnum (stack_ptr regstack, rtx reg)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -742,7 +742,7 @@ get_hard_regnum (stack regstack, rtx reg)
|
|||
cases the movdf pattern to pop. */
|
||||
|
||||
static rtx
|
||||
emit_pop_insn (rtx insn, stack regstack, rtx reg, enum emit_where where)
|
||||
emit_pop_insn (rtx insn, stack_ptr regstack, rtx reg, enum emit_where where)
|
||||
{
|
||||
rtx pop_insn, pop_rtx;
|
||||
int hard_regno;
|
||||
|
@ -793,7 +793,7 @@ emit_pop_insn (rtx insn, stack regstack, rtx reg, enum emit_where where)
|
|||
If REG is already at the top of the stack, no insn is emitted. */
|
||||
|
||||
static void
|
||||
emit_swap_insn (rtx insn, stack regstack, rtx reg)
|
||||
emit_swap_insn (rtx insn, stack_ptr regstack, rtx reg)
|
||||
{
|
||||
int hard_regno;
|
||||
rtx swap_rtx;
|
||||
|
@ -900,7 +900,7 @@ emit_swap_insn (rtx insn, stack regstack, rtx reg)
|
|||
is emitted. */
|
||||
|
||||
static void
|
||||
swap_to_top (rtx insn, stack regstack, rtx src1, rtx src2)
|
||||
swap_to_top (rtx insn, stack_ptr regstack, rtx src1, rtx src2)
|
||||
{
|
||||
struct stack_def temp_stack;
|
||||
int regno, j, k, temp;
|
||||
|
@ -941,7 +941,7 @@ swap_to_top (rtx insn, stack regstack, rtx src1, rtx src2)
|
|||
was deleted in the process. */
|
||||
|
||||
static bool
|
||||
move_for_stack_reg (rtx insn, stack regstack, rtx pat)
|
||||
move_for_stack_reg (rtx insn, stack_ptr regstack, rtx pat)
|
||||
{
|
||||
rtx *psrc = get_true_reg (&SET_SRC (pat));
|
||||
rtx *pdest = get_true_reg (&SET_DEST (pat));
|
||||
|
@ -1092,7 +1092,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
|
|||
a NaN into DEST, then invokes move_for_stack_reg. */
|
||||
|
||||
static bool
|
||||
move_nan_for_stack_reg (rtx insn, stack regstack, rtx dest)
|
||||
move_nan_for_stack_reg (rtx insn, stack_ptr regstack, rtx dest)
|
||||
{
|
||||
rtx pat;
|
||||
|
||||
|
@ -1231,7 +1231,7 @@ swap_rtx_condition (rtx insn)
|
|||
set up. */
|
||||
|
||||
static void
|
||||
compare_for_stack_reg (rtx insn, stack regstack, rtx pat_src)
|
||||
compare_for_stack_reg (rtx insn, stack_ptr regstack, rtx pat_src)
|
||||
{
|
||||
rtx *src1, *src2;
|
||||
rtx src1_note, src2_note;
|
||||
|
@ -1320,7 +1320,7 @@ compare_for_stack_reg (rtx insn, stack regstack, rtx pat_src)
|
|||
static int
|
||||
subst_stack_regs_in_debug_insn (rtx *loc, void *data)
|
||||
{
|
||||
stack regstack = (stack)data;
|
||||
stack_ptr regstack = (stack_ptr)data;
|
||||
int hard_regno;
|
||||
|
||||
if (!STACK_REG_P (*loc))
|
||||
|
@ -1361,7 +1361,7 @@ subst_all_stack_regs_in_debug_insn (rtx insn, struct stack_def *regstack)
|
|||
was deleted in the process. */
|
||||
|
||||
static bool
|
||||
subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
|
||||
subst_stack_regs_pat (rtx insn, stack_ptr regstack, rtx pat)
|
||||
{
|
||||
rtx *dest, *src;
|
||||
bool control_flow_insn_deleted = false;
|
||||
|
@ -2009,7 +2009,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
|
|||
requirements, since record_asm_stack_regs removes any problem asm. */
|
||||
|
||||
static void
|
||||
subst_asm_stack_regs (rtx insn, stack regstack)
|
||||
subst_asm_stack_regs (rtx insn, stack_ptr regstack)
|
||||
{
|
||||
rtx body = PATTERN (insn);
|
||||
int alt;
|
||||
|
@ -2292,7 +2292,7 @@ subst_asm_stack_regs (rtx insn, stack regstack)
|
|||
a control flow insn was deleted in the process. */
|
||||
|
||||
static bool
|
||||
subst_stack_regs (rtx insn, stack regstack)
|
||||
subst_stack_regs (rtx insn, stack_ptr regstack)
|
||||
{
|
||||
rtx *note_link, note;
|
||||
bool control_flow_insn_deleted = false;
|
||||
|
@ -2404,7 +2404,7 @@ subst_stack_regs (rtx insn, stack regstack)
|
|||
is no longer needed once this has executed. */
|
||||
|
||||
static void
|
||||
change_stack (rtx insn, stack old, stack new_stack, enum emit_where where)
|
||||
change_stack (rtx insn, stack_ptr old, stack_ptr new_stack, enum emit_where where)
|
||||
{
|
||||
int reg;
|
||||
int update_end = 0;
|
||||
|
@ -2610,7 +2610,7 @@ change_stack (rtx insn, stack old, stack new_stack, enum emit_where where)
|
|||
/* Print stack configuration. */
|
||||
|
||||
static void
|
||||
print_stack (FILE *file, stack s)
|
||||
print_stack (FILE *file, stack_ptr s)
|
||||
{
|
||||
if (! file)
|
||||
return;
|
||||
|
@ -2686,7 +2686,7 @@ static void
|
|||
convert_regs_exit (void)
|
||||
{
|
||||
int value_reg_low, value_reg_high;
|
||||
stack output_stack;
|
||||
stack_ptr output_stack;
|
||||
rtx retvalue;
|
||||
|
||||
retvalue = stack_result (current_function_decl);
|
||||
|
@ -2719,8 +2719,8 @@ convert_regs_exit (void)
|
|||
static void
|
||||
propagate_stack (edge e)
|
||||
{
|
||||
stack src_stack = &BLOCK_INFO (e->src)->stack_out;
|
||||
stack dest_stack = &BLOCK_INFO (e->dest)->stack_in;
|
||||
stack_ptr src_stack = &BLOCK_INFO (e->src)->stack_out;
|
||||
stack_ptr dest_stack = &BLOCK_INFO (e->dest)->stack_in;
|
||||
int reg;
|
||||
|
||||
/* Preserve the order of the original stack, but check whether
|
||||
|
@ -2746,8 +2746,8 @@ static bool
|
|||
compensate_edge (edge e)
|
||||
{
|
||||
basic_block source = e->src, target = e->dest;
|
||||
stack target_stack = &BLOCK_INFO (target)->stack_in;
|
||||
stack source_stack = &BLOCK_INFO (source)->stack_out;
|
||||
stack_ptr target_stack = &BLOCK_INFO (target)->stack_in;
|
||||
stack_ptr source_stack = &BLOCK_INFO (source)->stack_out;
|
||||
struct stack_def regstack;
|
||||
int reg;
|
||||
|
||||
|
|
|
@ -728,8 +728,8 @@ regrename_analyze (bitmap bb_mask)
|
|||
rtx insn;
|
||||
FOR_BB_INSNS (bb1, insn)
|
||||
{
|
||||
insn_rr_info *p = VEC_index (insn_rr_info, insn_rr,
|
||||
INSN_UID (insn));
|
||||
insn_rr_info *p = &VEC_index (insn_rr_info, insn_rr,
|
||||
INSN_UID (insn));
|
||||
p->op_info = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1583,7 +1583,7 @@ build_def_use (basic_block bb)
|
|||
|
||||
if (insn_rr != NULL)
|
||||
{
|
||||
insn_info = VEC_index (insn_rr_info, insn_rr, INSN_UID (insn));
|
||||
insn_info = &VEC_index (insn_rr_info, insn_rr, INSN_UID (insn));
|
||||
insn_info->op_info = XOBNEWVEC (&rename_obstack, operand_rr_info,
|
||||
recog_data.n_operands);
|
||||
memset (insn_info->op_info, 0,
|
||||
|
|
14
gcc/reload.h
14
gcc/reload.h
|
@ -243,19 +243,19 @@ typedef struct reg_equivs
|
|||
} reg_equivs_t;
|
||||
|
||||
#define reg_equiv_constant(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->constant
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).constant
|
||||
#define reg_equiv_invariant(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->invariant
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).invariant
|
||||
#define reg_equiv_memory_loc(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->memory_loc
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).memory_loc
|
||||
#define reg_equiv_address(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->address
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).address
|
||||
#define reg_equiv_mem(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->mem
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).mem
|
||||
#define reg_equiv_alt_mem_list(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->alt_mem_list
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).alt_mem_list
|
||||
#define reg_equiv_init(ELT) \
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT))->init
|
||||
VEC_index (reg_equivs_t, reg_equivs, (ELT)).init
|
||||
|
||||
DEF_VEC_O(reg_equivs_t);
|
||||
DEF_VEC_ALLOC_O(reg_equivs_t, gc);
|
||||
|
|
|
@ -664,7 +664,8 @@ grow_reg_equivs (void)
|
|||
for (i = old_size; i < max_regno; i++)
|
||||
{
|
||||
VEC_quick_insert (reg_equivs_t, reg_equivs, i, 0);
|
||||
memset (VEC_index (reg_equivs_t, reg_equivs, i), 0, sizeof (reg_equivs_t));
|
||||
memset (&VEC_index (reg_equivs_t, reg_equivs, i), 0,
|
||||
sizeof (reg_equivs_t));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -873,7 +873,7 @@ DEF_VEC_ALLOC_O (haifa_insn_data_def, heap);
|
|||
|
||||
extern VEC(haifa_insn_data_def, heap) *h_i_d;
|
||||
|
||||
#define HID(INSN) (VEC_index (haifa_insn_data_def, h_i_d, INSN_UID (INSN)))
|
||||
#define HID(INSN) (&VEC_index (haifa_insn_data_def, h_i_d, INSN_UID (INSN)))
|
||||
|
||||
/* Accessor macros for h_i_d. There are more in haifa-sched.c and
|
||||
sched-rgn.c. */
|
||||
|
@ -895,7 +895,7 @@ DEF_VEC_ALLOC_O (haifa_deps_insn_data_def, heap);
|
|||
|
||||
extern VEC(haifa_deps_insn_data_def, heap) *h_d_i_d;
|
||||
|
||||
#define HDID(INSN) (VEC_index (haifa_deps_insn_data_def, h_d_i_d, \
|
||||
#define HDID(INSN) (&VEC_index (haifa_deps_insn_data_def, h_d_i_d, \
|
||||
INSN_LUID (INSN)))
|
||||
#define INSN_DEP_COUNT(INSN) (HDID (INSN)->dep_count)
|
||||
#define HAS_INTERNAL_DEP(INSN) (HDID (INSN)->has_internal_dep)
|
||||
|
@ -909,7 +909,7 @@ extern VEC(haifa_deps_insn_data_def, heap) *h_d_i_d;
|
|||
#define INSN_COND_DEPS(INSN) (HDID (INSN)->cond_deps)
|
||||
#define CANT_MOVE(INSN) (HDID (INSN)->cant_move)
|
||||
#define CANT_MOVE_BY_LUID(LUID) (VEC_index (haifa_deps_insn_data_def, h_d_i_d, \
|
||||
LUID)->cant_move)
|
||||
LUID).cant_move)
|
||||
|
||||
|
||||
#define INSN_PRIORITY(INSN) (HID (INSN)->priority)
|
||||
|
|
|
@ -1524,7 +1524,7 @@ insert_in_history_vect (VEC (expr_history_def, heap) **pvect,
|
|||
|
||||
if (res)
|
||||
{
|
||||
expr_history_def *phist = VEC_index (expr_history_def, vect, ind);
|
||||
expr_history_def *phist = &VEC_index (expr_history_def, vect, ind);
|
||||
|
||||
/* It is possible that speculation types of expressions that were
|
||||
propagated through different paths will be different here. In this
|
||||
|
@ -4159,7 +4159,7 @@ finish_insns (void)
|
|||
removed during the scheduling. */
|
||||
for (i = 0; i < VEC_length (sel_insn_data_def, s_i_d); i++)
|
||||
{
|
||||
sel_insn_data_def *sid_entry = VEC_index (sel_insn_data_def, s_i_d, i);
|
||||
sel_insn_data_def *sid_entry = &VEC_index (sel_insn_data_def, s_i_d, i);
|
||||
|
||||
if (sid_entry->live)
|
||||
return_regset_to_pool (sid_entry->live);
|
||||
|
|
|
@ -765,8 +765,8 @@ DEF_VEC_ALLOC_O (sel_insn_data_def, heap);
|
|||
extern VEC (sel_insn_data_def, heap) *s_i_d;
|
||||
|
||||
/* Accessor macros for s_i_d. */
|
||||
#define SID(INSN) (VEC_index (sel_insn_data_def, s_i_d, INSN_LUID (INSN)))
|
||||
#define SID_BY_UID(UID) (VEC_index (sel_insn_data_def, s_i_d, LUID_BY_UID (UID)))
|
||||
#define SID(INSN) (&VEC_index (sel_insn_data_def, s_i_d, INSN_LUID (INSN)))
|
||||
#define SID_BY_UID(UID) (&VEC_index (sel_insn_data_def, s_i_d, LUID_BY_UID (UID)))
|
||||
|
||||
extern sel_insn_data_def insn_sid (insn_t);
|
||||
|
||||
|
@ -897,7 +897,7 @@ extern void sel_finish_global_bb_info (void);
|
|||
|
||||
/* Get data for BB. */
|
||||
#define SEL_GLOBAL_BB_INFO(BB) \
|
||||
(VEC_index (sel_global_bb_info_def, sel_global_bb_info, (BB)->index))
|
||||
(&VEC_index (sel_global_bb_info_def, sel_global_bb_info, (BB)->index))
|
||||
|
||||
/* Access macros. */
|
||||
#define BB_LV_SET(BB) (SEL_GLOBAL_BB_INFO (BB)->lv_set)
|
||||
|
@ -927,8 +927,8 @@ DEF_VEC_ALLOC_O (sel_region_bb_info_def, heap);
|
|||
extern VEC (sel_region_bb_info_def, heap) *sel_region_bb_info;
|
||||
|
||||
/* Get data for BB. */
|
||||
#define SEL_REGION_BB_INFO(BB) (VEC_index (sel_region_bb_info_def, \
|
||||
sel_region_bb_info, (BB)->index))
|
||||
#define SEL_REGION_BB_INFO(BB) (&VEC_index (sel_region_bb_info_def, \
|
||||
sel_region_bb_info, (BB)->index))
|
||||
|
||||
/* Get BB's note_list.
|
||||
A note_list is a list of various notes that was scattered across BB
|
||||
|
|
|
@ -1938,9 +1938,9 @@ undo_transformations (av_set_t *av_ptr, rtx insn)
|
|||
{
|
||||
expr_history_def *phist;
|
||||
|
||||
phist = VEC_index (expr_history_def,
|
||||
EXPR_HISTORY_OF_CHANGES (expr),
|
||||
index);
|
||||
phist = &VEC_index (expr_history_def,
|
||||
EXPR_HISTORY_OF_CHANGES (expr),
|
||||
index);
|
||||
|
||||
switch (phist->type)
|
||||
{
|
||||
|
@ -3581,7 +3581,7 @@ vinsn_vec_has_expr_p (vinsn_vec_t vinsn_vec, expr_t expr)
|
|||
EXPR_HISTORY_OF_CHANGES (expr))
|
||||
? VEC_index (expr_history_def,
|
||||
EXPR_HISTORY_OF_CHANGES (expr),
|
||||
i++)->old_expr_vinsn
|
||||
i++).old_expr_vinsn
|
||||
: NULL))
|
||||
FOR_EACH_VEC_ELT (vinsn_t, vinsn_vec, n, vinsn)
|
||||
if (VINSN_SEPARABLE_P (vinsn))
|
||||
|
|
|
@ -49,7 +49,7 @@ static const char digit_vector[] = {
|
|||
|
||||
struct ht *ident_hash;
|
||||
|
||||
static hashnode alloc_node (hash_table *);
|
||||
static hashnode alloc_node (cpp_hash_table *);
|
||||
static int mark_ident (struct cpp_reader *, hashnode, const void *);
|
||||
|
||||
static void *
|
||||
|
@ -70,7 +70,7 @@ init_stringpool (void)
|
|||
|
||||
/* Allocate a hash node. */
|
||||
static hashnode
|
||||
alloc_node (hash_table *table ATTRIBUTE_UNUSED)
|
||||
alloc_node (cpp_hash_table *table ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return GCC_IDENT_TO_HT_IDENT (make_node (IDENTIFIER_NODE));
|
||||
}
|
||||
|
@ -210,6 +210,32 @@ gt_pch_n_S (const void *x)
|
|||
gt_pch_note_object (CONST_CAST (void *, x), CONST_CAST (void *, x),
|
||||
>_pch_p_S, gt_types_enum_last);
|
||||
}
|
||||
|
||||
|
||||
/* User-callable entry point for marking string X. */
|
||||
|
||||
void
|
||||
gt_pch_nx (const char *& x)
|
||||
{
|
||||
gt_pch_n_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pch_nx (unsigned char *& x)
|
||||
{
|
||||
gt_pch_n_S (x);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pch_nx (unsigned char& x ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gt_pch_nx (unsigned char *x, gt_pointer_operator op, void *cookie)
|
||||
{
|
||||
op (x, cookie);
|
||||
}
|
||||
|
||||
/* Handle saving and restoring the string pool for PCH. */
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain,
|
|||
{
|
||||
/* Now push a separator. */
|
||||
if (domain.has_lb)
|
||||
VEC_quick_push (gimple, conds, NULL);
|
||||
VEC_quick_push (gimple, conds, (gimple)NULL);
|
||||
|
||||
gen_one_condition (arg, domain.ub,
|
||||
(domain.is_ub_inclusive
|
||||
|
@ -496,7 +496,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
|
|||
type is integer. */
|
||||
|
||||
/* Push a separator. */
|
||||
VEC_quick_push (gimple, conds, NULL);
|
||||
VEC_quick_push (gimple, conds, (gimple)NULL);
|
||||
|
||||
temp = create_tmp_var (int_type, "DCE_COND1");
|
||||
cst0 = build_int_cst (int_type, 0);
|
||||
|
|
|
@ -7872,3 +7872,54 @@ struct gimple_opt_pass pass_warn_unused_result =
|
|||
0, /* todo_flags_finish */
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* Garbage collection support for edge_def. */
|
||||
|
||||
extern void gt_ggc_mx (tree&);
|
||||
extern void gt_ggc_mx (gimple&);
|
||||
extern void gt_ggc_mx (rtx&);
|
||||
extern void gt_ggc_mx (basic_block&);
|
||||
|
||||
void
|
||||
gt_ggc_mx (edge_def *e)
|
||||
{
|
||||
gt_ggc_mx (e->src);
|
||||
gt_ggc_mx (e->dest);
|
||||
if (current_ir_type () == IR_GIMPLE)
|
||||
gt_ggc_mx (e->insns.g);
|
||||
else
|
||||
gt_ggc_mx (e->insns.r);
|
||||
gt_ggc_mx (e->goto_block);
|
||||
}
|
||||
|
||||
/* PCH support for edge_def. */
|
||||
|
||||
extern void gt_pch_nx (tree&);
|
||||
extern void gt_pch_nx (gimple&);
|
||||
extern void gt_pch_nx (rtx&);
|
||||
extern void gt_pch_nx (basic_block&);
|
||||
|
||||
void
|
||||
gt_pch_nx (edge_def *e)
|
||||
{
|
||||
gt_pch_nx (e->src);
|
||||
gt_pch_nx (e->dest);
|
||||
if (current_ir_type () == IR_GIMPLE)
|
||||
gt_pch_nx (e->insns.g);
|
||||
else
|
||||
gt_pch_nx (e->insns.r);
|
||||
gt_pch_nx (e->goto_block);
|
||||
}
|
||||
|
||||
void
|
||||
gt_pch_nx (edge_def *e, gt_pointer_operator op, void *cookie)
|
||||
{
|
||||
op (&(e->src), cookie);
|
||||
op (&(e->dest), cookie);
|
||||
if (current_ir_type () == IR_GIMPLE)
|
||||
op (&(e->insns.g), cookie);
|
||||
else
|
||||
op (&(e->insns.r), cookie);
|
||||
op (&(e->goto_block), cookie);
|
||||
}
|
||||
|
|
|
@ -3999,7 +3999,7 @@ splice_all_param_accesses (VEC (access_p, heap) **representatives)
|
|||
result = UNUSED_PARAMS;
|
||||
}
|
||||
else
|
||||
VEC_quick_push (access_p, *representatives, NULL);
|
||||
VEC_quick_push (access_p, *representatives, (access_p) NULL);
|
||||
}
|
||||
|
||||
if (result == NO_GOOD_ACCESS)
|
||||
|
@ -4208,7 +4208,7 @@ get_adjustment_for_base (ipa_parm_adjustment_vec adjustments, tree base)
|
|||
{
|
||||
struct ipa_parm_adjustment *adj;
|
||||
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
if (!adj->copy_param && adj->base == base)
|
||||
return adj;
|
||||
}
|
||||
|
@ -4315,7 +4315,7 @@ sra_ipa_modify_expr (tree *expr, bool convert,
|
|||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
|
||||
if (adj->base == base &&
|
||||
(adj->offset == offset || adj->remove_param))
|
||||
|
@ -4522,7 +4522,7 @@ sra_ipa_reset_debug_stmts (ipa_parm_adjustment_vec adjustments)
|
|||
tree name, vexpr, copy = NULL_TREE;
|
||||
use_operand_p use_p;
|
||||
|
||||
adj = VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
adj = &VEC_index (ipa_parm_adjustment_t, adjustments, i);
|
||||
if (adj->copy_param || !is_gimple_reg (adj->base))
|
||||
continue;
|
||||
name = ssa_default_def (cfun, adj->base);
|
||||
|
|
|
@ -215,7 +215,8 @@ addr_for_mem_ref (struct mem_address *addr, addr_space_t as,
|
|||
templ_index + 1);
|
||||
|
||||
/* Reuse the templates for addresses, so that we do not waste memory. */
|
||||
templ = VEC_index (mem_addr_template, mem_addr_template_list, templ_index);
|
||||
templ = &VEC_index (mem_addr_template, mem_addr_template_list,
|
||||
templ_index);
|
||||
if (!templ->ref)
|
||||
{
|
||||
sym = (addr->symbol ?
|
||||
|
|
|
@ -130,6 +130,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "dbgcnt.h"
|
||||
#include "gimple-fold.h"
|
||||
#include "params.h"
|
||||
#include "hash-table.h"
|
||||
|
||||
|
||||
/* Possible lattice values. */
|
||||
|
@ -1687,11 +1688,17 @@ evaluate_stmt (gimple stmt)
|
|||
return val;
|
||||
}
|
||||
|
||||
typedef hash_table <gimple_statement_d, typed_pointer_hash<gimple_statement_d>,
|
||||
typed_pointer_equal<gimple_statement_d>,
|
||||
typed_null_remove<gimple_statement_d> >
|
||||
gimple_htab;
|
||||
|
||||
/* Given a BUILT_IN_STACK_SAVE value SAVED_VAL, insert a clobber of VAR before
|
||||
each matching BUILT_IN_STACK_RESTORE. Mark visited phis in VISITED. */
|
||||
|
||||
static void
|
||||
insert_clobber_before_stack_restore (tree saved_val, tree var, htab_t *visited)
|
||||
insert_clobber_before_stack_restore (tree saved_val, tree var,
|
||||
gimple_htab *visited)
|
||||
{
|
||||
gimple stmt, clobber_stmt;
|
||||
tree clobber;
|
||||
|
@ -1711,10 +1718,10 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, htab_t *visited)
|
|||
}
|
||||
else if (gimple_code (stmt) == GIMPLE_PHI)
|
||||
{
|
||||
if (*visited == NULL)
|
||||
*visited = htab_create (10, htab_hash_pointer, htab_eq_pointer, NULL);
|
||||
if (!visited->is_created ())
|
||||
visited->create (10);
|
||||
|
||||
slot = (gimple *)htab_find_slot (*visited, stmt, INSERT);
|
||||
slot = visited->find_slot (stmt, INSERT);
|
||||
if (*slot != NULL)
|
||||
continue;
|
||||
|
||||
|
@ -1757,7 +1764,7 @@ insert_clobbers_for_var (gimple_stmt_iterator i, tree var)
|
|||
{
|
||||
gimple stmt;
|
||||
tree saved_val;
|
||||
htab_t visited = NULL;
|
||||
gimple_htab visited;
|
||||
|
||||
for (; !gsi_end_p (i); gsi_prev_dom_bb_nondebug (&i))
|
||||
{
|
||||
|
@ -1774,8 +1781,8 @@ insert_clobbers_for_var (gimple_stmt_iterator i, tree var)
|
|||
break;
|
||||
}
|
||||
|
||||
if (visited != NULL)
|
||||
htab_delete (visited);
|
||||
if (visited.is_created ())
|
||||
visited.dispose ();
|
||||
}
|
||||
|
||||
/* Detects a __builtin_alloca_with_align with constant size argument. Declares
|
||||
|
|
|
@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "bitmap.h"
|
||||
#include "dumpfile.h"
|
||||
#include "tree-flow.h"
|
||||
#include "hashtab.h"
|
||||
#include "hash-table.h"
|
||||
#include "tree-ssa-live.h"
|
||||
#include "diagnostic-core.h"
|
||||
|
||||
|
@ -1258,22 +1258,19 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
|
|||
}
|
||||
}
|
||||
|
||||
/* Returns a hash code for P. */
|
||||
/* Returns a hash code for N. */
|
||||
|
||||
static hashval_t
|
||||
hash_ssa_name_by_var (const void *p)
|
||||
inline hashval_t
|
||||
hash_ssa_name_by_var (const_tree n)
|
||||
{
|
||||
const_tree n = (const_tree) p;
|
||||
return (hashval_t) htab_hash_pointer (SSA_NAME_VAR (n));
|
||||
}
|
||||
|
||||
/* Returns nonzero if P1 and P2 are equal. */
|
||||
/* Returns nonzero if N1 and N2 are equal. */
|
||||
|
||||
static int
|
||||
eq_ssa_name_by_var (const void *p1, const void *p2)
|
||||
inline int
|
||||
eq_ssa_name_by_var (const_tree n1, const_tree n2)
|
||||
{
|
||||
const_tree n1 = (const_tree) p1;
|
||||
const_tree n2 = (const_tree) p2;
|
||||
return SSA_NAME_VAR (n1) == SSA_NAME_VAR (n2);
|
||||
}
|
||||
|
||||
|
@ -1289,7 +1286,9 @@ coalesce_ssa_name (void)
|
|||
bitmap used_in_copies = BITMAP_ALLOC (NULL);
|
||||
var_map map;
|
||||
unsigned int i;
|
||||
static htab_t ssa_name_hash;
|
||||
static hash_table <tree_node, hash_ssa_name_by_var, eq_ssa_name_by_var,
|
||||
typed_null_remove<tree_node> >
|
||||
ssa_name_hash;
|
||||
|
||||
cl = create_coalesce_list ();
|
||||
map = create_outofssa_var_map (cl, used_in_copies);
|
||||
|
@ -1298,8 +1297,7 @@ coalesce_ssa_name (void)
|
|||
so debug info remains undisturbed. */
|
||||
if (!optimize)
|
||||
{
|
||||
ssa_name_hash = htab_create (10, hash_ssa_name_by_var,
|
||||
eq_ssa_name_by_var, NULL);
|
||||
ssa_name_hash.create (10);
|
||||
for (i = 1; i < num_ssa_names; i++)
|
||||
{
|
||||
tree a = ssa_name (i);
|
||||
|
@ -1309,7 +1307,7 @@ coalesce_ssa_name (void)
|
|||
&& !DECL_IGNORED_P (SSA_NAME_VAR (a))
|
||||
&& (!has_zero_uses (a) || !SSA_NAME_IS_DEFAULT_DEF (a)))
|
||||
{
|
||||
tree *slot = (tree *) htab_find_slot (ssa_name_hash, a, INSERT);
|
||||
tree *slot = ssa_name_hash.find_slot (a, INSERT);
|
||||
|
||||
if (!*slot)
|
||||
*slot = a;
|
||||
|
@ -1322,7 +1320,7 @@ coalesce_ssa_name (void)
|
|||
}
|
||||
}
|
||||
}
|
||||
htab_delete (ssa_name_hash);
|
||||
ssa_name_hash.dispose ();
|
||||
}
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
dump_var_map (dump_file, map);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue