summaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
AgeCommit message (Collapse)Author
2020-01-01Update copyright years.Jakub Jelinek
From-SVN: r279813
2019-10-16[AArch64] Add partial SVE vector modesRichard Sandiford
This patch adds extra vector modes that represent a half, quarter or eighth of what an SVE vector can hold. This is useful for describing the memory vector involved in an extending load or truncating store. It might also be useful in future for representing "unpacked" SVE registers, i.e. registers that contain values in the low bits of a wider containing element. The new modes could have the same width as an Advanced SIMD mode for certain -msve-vector-bits=N options, so we need to ensure that they come later in the mode list and that Advanced SIMD modes always "win". 2019-10-16 Richard Sandiford <richard.sandiford@arm.com> gcc/ * genmodes.c (mode_data::order): New field. (blank_mode): Update accordingly. (VECTOR_MODES_WITH_PREFIX): Add an order parameter. (make_vector_modes): Likewise. (VECTOR_MODES): Update use accordingly. (cmp_modes): Sort by the new order field ahead of sorting by size. * config/aarch64/aarch64-modes.def (VNx2QI, VN2xHI, VNx2SI) (VNx4QI, VNx4HI, VNx8QI): New partial vector modes. * config/aarch64/aarch64.c (VEC_PARTIAL): New flag value. (aarch64_classify_vector_mode): Handle the new partial modes. (aarch64_vl_bytes): New function. (aarch64_hard_regno_nregs): Use it instead of BYTES_PER_SVE_VECTOR when counting the number of registers in an SVE mode. (aarch64_class_max_nregs): Likewise. (aarch64_hard_regno_mode_ok): Don't allow partial vectors in registers yet. (aarch64_classify_address): Treat partial vectors analogously to full vectors. (aarch64_print_address_internal): Consolidate the printing of MUL VL addresses, using aarch64_vl_bytes as the number of bytes represented by "VL". (aarch64_vector_mode_supported_p): Reject partial vector modes. From-SVN: r277062
2019-01-01Update copyright years.Jakub Jelinek
From-SVN: r267494
2018-08-24emit-rtl.c (init_emit_once): Do not emit MODE_POINTER_BOUNDS RTXes.Uros Bizjak
* emit-rtl.c (init_emit_once): Do not emit MODE_POINTER_BOUNDS RTXes. * emit-rtl.h (rtl_data): Remove return_bnd. * explow.c (trunc_int_for_mode): Do not handle POINTER_BOUNDS_MODE_P. * function.c (diddle_return_value): Do not handle crtl->return_bnd. * genmodes.c (complete_mode): Do not handle MODE_POINTER_BOUNDS. (POINTER_BOUNDS_MODE): Remove definition. (make_pointer_bounds_mode): Remove. (get_mode_class): Do not handle MODE_POINTER_BOUNDS. * machmode.h (POINTER_BOUNDS_MODE_P): Remove definition. (scalare_mode::includes_p): Do not handle MODE_POINTER_BOUNDS. * mode-classes.def: Do not define MODE_POINTER_BOUNDS. * stor-layout.c (int_mode_for_mode): Do not handle MODE_POINTER_BOUNDS. * tree-core.h (enum tree_index): Remove TI_POINTER_BOUNDS_TYPE. * varasm.c (output_constant_pool_2): Do not handle MODE_POINTER_BOUNDS. * config/i386/i386-modes.def (BND32, BND64): Remove. * config/i386/i386.c (dbx_register_map): Remove bound registers. (dbx64_register_map): Ditto. (svr4_dbx_register_map): Ditto. (indirect_thunk_bnd_needed): Remove. (indirect_thunks_bnd_used): Ditto. (indirect_return_bnd_needed): Ditto. (indirect_return_via_cx_bnd): Ditto. (enum indirect_thunk_prefix): Remove indirect_thunk_prefix_bnd. (indirect_thunk_name): Remove handling of indirect_thunk_prefix_bnd. (output_indirect_thunk): Ditto. Remove need_prefix argument. (output_indirect_thunk_function): Remove handling of indirect_return_bnd_needed, indirect_return_via_cx_bnd, indirect_thunk_bnd_needed and indirect_thunks_bnd_used variables. (ix86_save_reg): Remove handling of crtl->return_bnd. (ix86_legitimate_constant_p): Remove handling of POINTER_BOUNDS_MODE_P. (ix86_print_operand_address_as): Remove handling of UNSPEC_BNDMK_ADDR and UNSPEC_BNDLX_ADDR. (ix86_output_indirect_branch_via_reg): Remove handling of indirect_thunk_prefix_bnd. (ix86_output_indirect_branch_via_push): Ditto. (ix86_output_function_return): Ditto. (ix86_output_indirect_function_return): Ditto. (avoid_func_arg_motion): Do not handle UNSPEC_BNDSTX. * config/i386/i386.h (FIXED_REGISTERS): Remove bound registers. (CALL_USED_REGISTERS): Ditto. (REG_ALLOC_ORDER): Update for removal of bound registers. (HI_REGISTER_NAMES): Ditto. * config/i386/i386.md (UNSPEC_BNDMK, UNSPEC_BNDMK_ADDR, UNSPEC_BNDSTX) (UNSPEC_BNDLDX, UNSPEC_BNDLDX_ADDR, UNSPEC_BNDCL, UNSPEC_BNDCU) (UNSPEC_BNDCN, UNSPEC_MPX_FENCE): Remove. (BND0_REG, BND1_REG, BND2_REG, BND3_REG): Remove (FIRST_PSEUDO_REG): Update. (BND): Remove mode iterator. * config/i386/predicates.md (bnd_mem_operator): Remove. From-SVN: r263835
2018-02-14re PR target/79242 (ICE in simplify_subreg, at simplify-rtx.c:6029)Jozef Lawrynowicz
2018-02-14 Jozef Lawrynowicz <jozefl.gcc@gmail.com> PR target/79242 * machmode.def: Define a complex mode for PARTIAL_INT. * genmodes.c (complex_class): Return MODE_COMPLEX_INT for MODE_PARTIAL_INT. * doc/rtl.texi: Document CSPImode. * config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode handling. (msp430_hard_regno_nregs_with_padding): Likewise. PR target/79242 * gcc.target/msp430/pr79242.c: New test. From-SVN: r257653
2018-01-03Allow the target to set MAX_BITSIZE_MODE_ANY_MODERichard Sandiford
The default value of MAX_BITSIZE_MODE_ANY_MODE is calculated from the initial mode sizes specified in the modes.def file. The target needs to be able to override it if ADJUST_BYTESIZE & co. can choose a bigger size. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default is calculated and how it can be overridden. * genmodes.c (max_bitsize_mode_any_mode): New variable. (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE, if defined. (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE, if nonzero. From-SVN: r256206
2018-01-03Add support for adjusting the number of units in a modeRichard Sandiford
We already allow the target to change the size and alignment of a mode. This patch does the same thing for the number of units, which is needed to give command-line control of the SVE vector length. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION. (mode_nunits): Likewise CONST_MODE_NUNITS. * machmode.def (ADJUST_NUNITS): Document. * genmodes.c (mode_data::need_nunits_adj): New field. (blank_mode): Update accordingly. (adj_nunits): New variable. (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ parameter. (emit_mode_size_inline): Set need_bytesize_adj for all modes listed in adj_nunits. (emit_mode_nunits_inline): Set need_nunits_adj for all modes listed in adj_nunits. Don't emit case statements for such modes. (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS and CONST_MODE_PRECISION. Make CONST_MODE_SIZE expand to nothing if adj_nunits is nonnull. (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl. (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit) (emit_mode_fbit): Update use of print_maybe_const_decl. (emit_move_size): Likewise. Treat the array as non-const if adj_nunits. (emit_mode_adjustments): Handle adj_nunits. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256204
2018-01-03Allow targets to pick a vector prefix other than "V"Richard Sandiford
Originally the SVE port used the names for 256-bit vectors, as the next available increment after Advanced SIMD. However, that was always a bit of a hack and is bound to confuse people new to the code. Nothing actually requires vector modes to have names of the form V<nunits><mode>, and after talking it over with the AArch64 maintainers, we agreed to switch to things like: VNx16QI instead. This patch lets targets pick this kind of prefix. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * machmode.def (VECTOR_MODES_WITH_PREFIX): Document. * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro. (VECTOR_MODES): Use it. (make_vector_modes): Take the prefix as an argument. From-SVN: r256203
2018-01-03Add support for MODE_VECTOR_BOOLRichard Sandiford
This patch adds a new mode class to represent vectors of booleans. GET_MODE_BITSIZE (m) / GET_MODE_NUNITS (m) determines the number of bits that are used to represent each boolean; this can be 1 for a fully-packed representation or greater than 1 for an unpacked representation. In the latter case, the value of bits other than the lowest is not significant. These are used by the SVE port to represent predicates. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * mode-classes.def (MODE_VECTOR_BOOL): New mode class. * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true for MODE_VECTOR_BOOL. * machmode.def (VECTOR_BOOL_MODE): Document. * genmodes.c (VECTOR_BOOL_MODE): New macro. (make_vector_bool_mode): New function. (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle MODE_VECTOR_BOOL. * lto-streamer-in.c (lto_input_mode_table): Likewise. * rtx-vector-builder.c (rtx_vector_builder::find_cached_value): Likewise. * stor-layout.c (int_mode_for_mode): Likewise. * tree.c (build_vector_type_for_mode): Likewise. * varasm.c (output_constant_pool_2): Likewise. * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx for MODE_VECTOR_BOOL. * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list of mode class checks. * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P instead of a list of mode class checks. (expand_vector_scalar_condition): Likewise. (type_for_widest_vector_mode): Handle BImode as an inner mode. gcc/c-family/ * c-common.c (c_common_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/fortran/ * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/lto/ * lto-lang.c (lto_type_for_mode): Handle MODE_VECTOR_BOOL. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256202
2018-01-03poly_int: GET_MODE_SIZERichard Sandiford
This patch changes GET_MODE_SIZE from unsigned short to poly_uint16. The non-mechanical parts were handled by previous patches. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (mode_size): Change from unsigned short to poly_uint16_pod. (mode_to_bytes): Return a poly_uint16 rather than an unsigned short. (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is not polynomial. (fixed_size_mode::includes_p): Check for constant-sized modes. * genmodes.c (emit_mode_size_inline): Make mode_size_inline return a poly_uint16 rather than an unsigned short. (emit_mode_size): Change the type of mode_size from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the initializer. (emit_mode_adjustments): Cope with polynomial vector sizes. * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value for GET_MODE_SIZE. * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value for GET_MODE_SIZE. * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial. * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise. * caller-save.c (setup_save_areas): Likewise. (replace_reg_with_saved_mem): Likewise. * calls.c (emit_library_call_value_1): Likewise. * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise. * combine.c (simplify_set, make_extraction, simplify_shift_const_1) (gen_lowpart_for_combine): Likewise. * convert.c (convert_to_integer_1): Likewise. * cse.c (equiv_constant, cse_insn): Likewise. * cselib.c (autoinc_split, cselib_hash_rtx): Likewise. (cselib_subst_to_values): Likewise. * dce.c (word_dce_process_block): Likewise. * df-problems.c (df_word_lr_mark_ref): Likewise. * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise. * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor) (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor) (rtl_for_decl_location): Likewise. * emit-rtl.c (gen_highpart, widen_memory_access): Likewise. * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise. * expr.c (emit_group_load_1, clear_storage_hints): Likewise. (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise. (expand_expr_real_1): Likewise. * function.c (assign_parm_setup_block_p, assign_parm_setup_block) (pad_below): Likewise. * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise. * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise. * ira.c (get_subreg_tracking_sizes): Likewise. * ira-build.c (ira_create_allocno_objects): Likewise. * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise. (ira_sort_regnos_for_alter_reg): Likewise. * ira-costs.c (record_operand_costs): Likewise. * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn) (resolve_simple_move): Likewise. * lra-constraints.c (get_reload_reg, operands_match_p): Likewise. (process_addr_reg, simplify_operand_subreg, curr_insn_transform) (lra_constraints): Likewise. (CONST_POOL_OK_P): Reject variable-sized modes. * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare) (add_pseudo_to_slot, lra_spill): Likewise. * omp-low.c (omp_clause_aligned_alignment): Likewise. * optabs-query.c (get_best_extraction_insn): Likewise. * optabs-tree.c (expand_vec_cond_expr_p): Likewise. * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise. (expand_mult_highpart, valid_multiword_target_p): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * regcprop.c (maybe_mode_change): Likewise. * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise. * regrename.c (build_def_use): Likewise. * regstat.c (dump_reg_info): Likewise. * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload) (find_reloads, find_reloads_subreg_address): Likewise. * reload1.c (eliminate_regs_1): Likewise. * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise. * simplify-rtx.c (avoid_constant_pool_reference): Likewise. (simplify_binary_operation_1, simplify_subreg): Likewise. * targhooks.c (default_function_arg_padding): Likewise. (default_hard_regno_nregs, default_class_max_nregs): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. (verify_gimple_assign_ternary): Likewise. * tree-inline.c (estimate_move_cost): Likewise. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise. (get_address_cost_ainc): Likewise. * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise. (vect_supportable_dr_alignment): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift) (vectorizable_operation, vectorizable_load): Likewise. * tree.c (build_same_sized_truth_vector_type): Likewise. * valtrack.c (cleanup_auto_inc_dec): Likewise. * var-tracking.c (emit_note_insn_var_location): Likewise. * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>. (ADDR_VEC_ALIGN): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256201
2018-01-03poly_int: GET_MODE_PRECISIONRichard Sandiford
This patch changes GET_MODE_PRECISION from an unsigned short to a poly_uint16. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (mode_precision): Change from unsigned short to poly_uint16_pod. (mode_to_precision): Return a poly_uint16 rather than an unsigned short. (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is not polynomial. (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case in which the mode is already known to be a scalar_int_mode. * genmodes.c (emit_mode_precision): Change the type of mode_precision from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the initializer. * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value for GET_MODE_PRECISION. * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value for GET_MODE_PRECISION. * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION as polynomial. (try_combine, find_split_point, combine_simplify_rtx): Likewise. (expand_field_assignment, make_extraction): Likewise. (make_compound_operation_int, record_dead_and_set_regs_1): Likewise. (get_last_value): Likewise. * convert.c (convert_to_integer_1): Likewise. * cse.c (cse_insn): Likewise. * expr.c (expand_expr_real_1): Likewise. * lra-constraints.c (simplify_operand_subreg): Likewise. * optabs-query.c (can_atomic_load_p): Likewise. * optabs.c (expand_atomic_load): Likewise. (expand_atomic_store): Likewise. * ree.c (combine_reaching_defs): Likewise. * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise. * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise. * tree.h (type_has_mode_precision_p): Likewise. * ubsan.c (instrument_si_overflow): Likewise. gcc/ada/ * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION as polynomial. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256198
2018-01-03poly_int: GET_MODE_NUNITSRichard Sandiford
This patch changes GET_MODE_NUNITS from unsigned char to poly_uint16, although it remains a macro when compiling target code with NUM_POLY_INT_COEFFS == 1. We can handle permuted loads and stores for variable nunits if the number of statements is a power of 2, but not otherwise. The to_constant call in make_vector_type goes away in a later patch. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (mode_nunits): Change from unsigned char to poly_uint16_pod. (ONLY_FIXED_SIZE_MODES): New macro. (pod_mode::measurement_type, scalar_int_mode::measurement_type) (scalar_float_mode::measurement_type, scalar_mode::measurement_type) (complex_mode::measurement_type, fixed_size_mode::measurement_type): New typedefs. (mode_to_nunits): Return a poly_uint16 rather than an unsigned short. (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is not polynomial. * genmodes.c (ZERO_COEFFS): New macro. (emit_mode_nunits_inline): Make mode_nunits_inline return a poly_uint16. (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod. Use ZERO_COEFFS when emitting initializers. * data-streamer.h (bp_pack_poly_value): New function. (bp_unpack_poly_value): Likewise. * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value for GET_MODE_NUNITS. * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value for GET_MODE_NUNITS. * tree.c (make_vector_type): Remove temporary shim and make the real function take the number of units as a poly_uint64 rather than an int. (build_vector_type_for_mode): Handle polynomial nunits. * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise. * emit-rtl.c (const_vec_series_p_1): Likewise. (gen_rtx_CONST_VECTOR): Likewise. * fold-const.c (test_vec_duplicate_folding): Likewise. * genrecog.c (validate_pattern): Likewise. * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise. * optabs-tree.c (expand_vec_cond_expr_p): Likewise. * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise. (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise. (expand_vec_cond_expr, expand_mult_highpart): Likewise. * rtlanal.c (subreg_get_info): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise. (vect_grouped_load_supported): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. * tree-vect-loop.c (have_whole_vector_shift): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. (simplify_const_unary_operation, simplify_binary_operation_1) (simplify_const_binary_operation, simplify_ternary_operation) (test_vector_ops_duplicate, test_vector_ops): Likewise. (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode instead of CONST_VECTOR_NUNITS. * varasm.c (output_constant_pool_2): Likewise. * rtx-vector-builder.c (rtx_vector_builder::build): Only include the explicit-encoded elements in the XVEC for variable-length vectors. gcc/ada/ * gcc-interface/misc.c (enumerate_modes): Handle polynomial GET_MODE_NUNITS. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256195
2018-01-03Update copyright years.Jakub Jelinek
From-SVN: r256169
2017-12-14poly_int: add poly-int.hRichard Sandiford
This patch adds a new "poly_int" class to represent polynomial integers of the form: C0 + C1*X1 + C2*X2 ... + Cn*Xn It also adds poly_int-based typedefs for offsets and sizes of various precisions. In these typedefs, the Ci coefficients are compile-time constants and the Xi indeterminates are run-time invariants. The number of coefficients is controlled by the target and is initially 1 for all ports. Most routines can handle general coefficient counts, but for now a few are specific to one or two coefficients. Support for other coefficient counts can be added when needed. The patch also adds a new macro, IN_TARGET_CODE, that can be set to indicate that a TU contains target-specific rather than target-independent code. When this macro is set and the number of coefficients is 1, the poly-int.h classes define a conversion operator to a constant. This allows most existing target code to work without modification. The main exceptions are: - values passed through ..., which need an explicit conversion to a constant - ?: expression in which one arm ends up being a polynomial and the other remains a constant. In these cases it would be valid to convert the constant to a polynomial and the polynomial to a constant, so a cast is needed to break the ambiguity. The patch also adds a new target hook to return the estimated value of a polynomial for costing purposes. The patch also adds operator<< on wide_ints (it was already defined for offset_int and widest_int). I think this was originally excluded because >> is ambiguous for wide_int, but << is useful for converting bytes to bits, etc., so is worth defining on its own. The patch also adds operator% and operator/ for offset_int and widest_int, since those types are always signed. These changes allow the poly_int interface to be more predictable. I'd originally tried adding the tests as selftests, but that ended up bloating cc1 by at least a third. It also took a while to build them at -O2. The patch therefore uses plugin tests instead, where we can force the tests to be built at -O0. They still run in negligible time when built that way. 2017-12-14 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * poly-int.h: New file. * poly-int-types.h: Likewise. * coretypes.h: Include them. (POLY_INT_CONVERSION): Define. * target.def (estimated_poly_value): New hook. * doc/tm.texi.in (TARGET_ESTIMATED_POLY_VALUE): New hook. * doc/tm.texi: Regenerate. * doc/poly-int.texi: New file. * doc/gccint.texi: Include it. * doc/rtl.texi: Describe restrictions on subreg modes. * Makefile.in (TEXI_GCCINT_FILES): Add poly-int.texi. * genmodes.c (NUM_POLY_INT_COEFFS): Provide a default definition. (emit_insn_modes_h): Emit a definition of NUM_POLY_INT_COEFFS. * targhooks.h (default_estimated_poly_value): Declare. * targhooks.c (default_estimated_poly_value): New function. * target.h (estimated_poly_value): Likewise. * wide-int.h (WI_UNARY_RESULT): Use wi::binary_traits. (wi::unary_traits): Delete. (wi::binary_traits::signed_shift_result_type): Define for offset_int << HOST_WIDE_INT, etc. (generic_wide_int::operator <<=): Define for all types and use wi::lshift instead of <<. (wi::hwi_with_prec): Add a default constructor. (wi::ints_for): New class. (operator <<): Define for all wide-int types. (operator /): New function. (operator %): Likewise. * selftest.h (ASSERT_KNOWN_EQ, ASSERT_KNOWN_EQ_AT, ASSERT_MAYBE_NE) (ASSERT_MAYBE_NE_AT): New macros. gcc/testsuite/ * gcc.dg/plugin/poly-int-tests.h, gcc.dg/plugin/poly-int-test-1.c, gcc.dg/plugin/poly-int-01_plugin.c, gcc.dg/plugin/poly-int-02_plugin.c, gcc.dg/plugin/poly-int-03_plugin.c, gcc.dg/plugin/poly-int-04_plugin.c, gcc.dg/plugin/poly-int-05_plugin.c, gcc.dg/plugin/poly-int-06_plugin.c, gcc.dg/plugin/poly-int-07_plugin.c: New tests. * gcc.dg/plugin/plugin.exp: Run them. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255617
2017-09-29qsort comparator consistency checkingAlexander Monakov
* genmodes.c (calc_wider_mode): Suppress qsort macro. * system.h [CHECKING_P] (qsort): Redirect to qsort_chk. (qsort_chk): Declare. * vec.c [CHECKING_P] (qsort_chk_error): New static function. (qsort_chk): New function. From-SVN: r253295
2017-08-30[77/77] Add a complex_mode classRichard Sandiford
This patch adds another machine_mode wrapper for modes that are known to be COMPLEX_MODE_P. There aren't yet many places that make use of it, but that might change in future. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (complex_mode): New type. * gdbhooks.py (build_pretty_printer): Handle it. * machmode.h (complex_mode): New class. (complex_mode::includes_p): New function. (is_complex_int_mode): Likewise. (is_complex_float_mode): Likewise. * genmodes.c (get_mode_class): Handle complex mode classes. * function.c (expand_function_end): Use is_complex_int_mode. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_complex_float_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251527
2017-08-30[64/77] Add a scalar_mode classRichard Sandiford
This patch adds a scalar_mode class that can hold any scalar mode, specifically: - scalar integers - scalar floating-point values - scalar fractional modes - scalar accumulator modes - pointer bounds modes To start with this patch uses this type for GET_MODE_INNER. Later patches add more uses. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (scalar_mode): New class. * machmode.h (scalar_mode): Likewise. (scalar_mode::includes_p): New function. (mode_to_inner): Return a scalar_mode rather than a machine_mode. * gdbhooks.py (build_pretty_printers): Handle scalar_mode. * genmodes.c (get_mode_class): Handle remaining scalar modes. * cfgexpand.c (expand_debug_expr): Use scalar_mode. * expmed.c (store_bit_field_1): Likewise. (extract_bit_field_1): Likewise. * expr.c (write_complex_part): Likewise. (read_complex_part): Likewise. (emit_move_complex_push): Likewise. (expand_expr_real_2): Likewise. * function.c (assign_parm_setup_reg): Likewise. (assign_parms_unsplit_complex): Likewise. * optabs.c (expand_binop): Likewise. * rtlanal.c (subreg_get_info): Likewise. * simplify-rtx.c (simplify_immed_subreg): Likewise. * varasm.c (output_constant_pool_2): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251515
2017-08-30[16/77] Add scalar_int_mode_podRichard Sandiford
This patch adds a POD class for scalar integers, as an instance of a new pod_mode template. Later patches will use pod_mode in situations that really do need to be POD; this patch is simply using PODs to remove load-time initialisation. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (pod_mode): New type. (scalar_int_mode_pod): New typedef. * machmode.h (pod_mode): New class. (int_n_data_t::m): Change type to scalar_int_mode_pod. * genmodes.c (emit_mode_int_n): Update accordingly. * lower-subreg.h (target_lower_subreg): Change type to scalar_int_mode_pod. * gdbhooks.py (build_pretty_printer): Handle pod_mode and scalar_int_mode_pod. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251468
2017-08-30[15/77] Add scalar_int_modeRichard Sandiford
Similar to the previous scalar_float_mode patch, but for modes that satisfy SCALAR_INT_MODE_P. There are very many uses of scalar integers, so this patch only makes a token change to the types of byte_mode, word_mode, ptr_mode and rs6000_pmode. The next patches in the series gradually replace more uses. The patch also removes and adds casts to some target-specific code due to the new types of SImode, DImode and Pmode. The as_a <scalar_int_mode> goes away in a later patch. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * config/powerpcspe/powerpcspe.h (rs6000_pmode): Change type from machine_mode to scalar_int_mode. * config/powerpcspe/powerpcspe.c (rs6000_pmode): Likewise. (rs6000_option_override_internal): Remove cast to int. * config/rs6000/rs6000.h (rs6000_pmode): Change type from machine_mode to scalar_int_mode. * config/rs6000/rs6000.c (rs6000_pmode): Likewise. (rs6000_option_override_internal): Remove cast to int. * config/s390/s390.h (Pmode): Remove cast to machine_mode. * config/epiphany/epiphany.h (RTX_OK_FOR_OFFSET_P): Add cast to machine_mode. * config/s390/s390.c (s390_expand_builtin): Likewise. * coretypes.h (scalar_int_mode): New type. (opt_scalar_int_mode): New typedef. * machmode.h (scalar_int_mode): New class. (scalar_int_mode::includes_p): New function. (byte_mode): Change type to scalar_int_mode. (word_mode): Likewise. (ptr_mode): Likewise. * emit-rtl.c (byte_mode): Likewise. (word_mode): Likewise. (ptr_mode): Likewise. (init_derived_machine_modes): Update accordingly. * genmodes.c (get_mode_class): Return scalar_int_mode for MODE_INT and MODE_PARTIAL_INT. * gdbhooks.py (build_pretty_printer): Handle scalar_int_mode and opt_scalar_int_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251467
2017-08-30[7/77] Add scalar_float_modeRichard Sandiford
This patch adds a scalar_float_mode class, which wraps a mode enum that is known to satisfy SCALAR_FLOAT_MODE_P. Things like "SFmode" now give a scalar_float_mode object instead of a machine_mode. This in turn needs a change to the real.h format_helper, so that it can accept both machine_modes and scalar_float_modes. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (scalar_float_mode): New type. * machmode.h (mode_traits::from_int): Use machine_mode if USE_ENUM_MODES is defined. (is_a): New function. (as_a): Likewise. (dyn_cast): Likewise. (scalar_float_mode): New class. (scalar_float_mode::includes_p): New function. (is_float_mode): Likewise. * gdbhooks.py (MachineModePrinter): New class. (build_pretty_printer): Use it for scalar_float_mode. * real.h (FLOAT_MODE_FORMAT): Use as_a <scalar_float_mode>. (format_helper::format_helper): Turn into a template. * genmodes.c (get_mode_class): New function. (emit_insn_modes_h): Give modes the class returned by get_mode_class, or machine_mode if none. * config/aarch64/aarch64.c (aarch64_simd_valid_immediate): Use as_a <scalar_float_mode>. * dwarf2out.c (mem_loc_descriptor): Likewise. (insert_float): Likewise. (add_const_value_attribute): Likewise. * simplify-rtx.c (simplify_immed_subreg): Likewise. * optabs.c (expand_absneg_bit): Take a scalar_float_mode. (expand_unop): Update accordingly. (expand_abs_nojump): Likewise. (expand_copysign_absneg): Take a scalar_float_mode. (expand_copysign_bit): Likewise. (expand_copysign): Update accordingly. gcc/ada/ * gcc-interface/utils.c (gnat_type_for_mode): Use is_a <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_float_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251458
2017-08-30[3/77] Allow machine modes to be classesRichard Sandiford
This patch makes various changes that allow modes like SImode to be classes rather than enums. Firstly, it adds inline functions for all mode size properties, with the macros being simple wrappers around them. This is necessary for the __builtin_constant_p trick to continue working effectively when the mode arguments are slightly more complex (but still foldable at compile time). These inline functions are trivial and heavily used. There's not much point keeping them out-of-line at -O0: if anything it would make debugging harder rather than easier, and it would also slow things down. The patch therefore marks them as "always_inline", if that's available. Later patches use this approach too. Using inline functions means that it's no longer possible to pass an int to GET_MODE_PRECISION etc. The Fortran and powerpcspe-c.c parts are needed to avoid instances of that. The patch continues to use enums for gencondmd.c, so that more mode comparisons are integer constant expressions when checking for always-true or always-false conditions. This is the only intended use of USE_ENUM_MODES. The patch also enforces the previous replacement of case statements by defining modes as: #define FOOmode ((void) 0, E_FOOmode) This adds no overhead but makes sure that new uses of "case FOOmode:" don't accidentally creep in when FOOmode has no specific class associated with it. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * genconditions.c (write_header): Add a "#define USE_ENUM_MODES". * genmodes.c (emit_insn_modes_h): Define FOOmode to E_FOOmode if USE_ENUM_MODES is defined and to ((void) 0, E_FOOmode) otherwise. * machmode.h (mode_size): Move earlier in file. (mode_precision): Likewise. (mode_inner): Likewise. (mode_nunits): Likewise. (mode_unit_size): Likewise. (unit_unit_precision): Likewise. (mode_wider): Likewise. (mode_2xwider): Likewise. (machine_mode): New class. (mode_to_bytes): New function. (mode_to_bits): Likewise. (mode_to_precision): Likewise. (mode_to_inner): Likewise. (mode_to_unit_size): Likewise. (mode_to_unit_precision): Likewise. (mode_to_nunits): Likewise. (GET_MODE_SIZE): Use mode_to_bytes. (GET_MODE_BITSIZE): Use mode_to_bits. (GET_MODE_PRECISION): Use mode_to_precision. (GET_MODE_INNER): Use mode_to_inner. (GET_MODE_UNIT_SIZE): Use mode_to_unit_size. (GET_MODE_UNIT_PRECISION): Use mode_to_unit_precision. (GET_MODE_NUNITS): Use mode_to_nunits. * system.h (ALWAYS_INLINE): New macro. * config/powerpcspe/powerpcspe-c.c (altivec_resolve_overloaded_builtin): Use machine_mode instead of int for arg1_mode and arg2_mode. gcc/fortran/ * trans-types.c (gfc_init_kinds): Use machine_mode instead of int for "mode". Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251454
2017-08-30[1/77] Add an E_ prefix to mode namesRichard Sandiford
Later patches will add wrapper types for specific classes of mode. E.g. SImode will be a scalar_int_mode, SFmode will be a scalar_float_mode, etc. This patch prepares for that change by adding an E_ prefix to the mode enum values. It also adds #defines that map the unprefixed names to the prefixed names; e.g: #define QImode E_QImode Later patches will change this to use things like scalar_int_mode where appropriate. The patch continues to use enum values to initialise static data. This isn't necessary for correctness, but it cuts down on the amount of load-time initialisation and shouldn't have any downsides. The patch also changes things like: cmp_mode == DImode ? DFmode : DImode to: cmp_mode == DImode ? E_DFmode : E_DImode This is because DImode and DFmode will eventually be different classes, so the original ?: wouldn't be well-formed. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * genmodes.c (mode_size_inline): Add an E_ prefix to mode names. (mode_nunits_inline): Likewise. (mode_inner_inline): Likewise. (mode_unit_size_inline): Likewise. (mode_unit_precision_inline): Likewise. (emit_insn_modes_h): Likewise. Also emit a #define of the unprefixed name. (emit_mode_wider): Add an E_ prefix to mode names. (emit_mode_complex): Likewise. (emit_mode_inner): Likewise. (emit_mode_adjustments): Likewise. (emit_mode_int_n): Likewise. * config/aarch64/aarch64-builtins.c (v8qi_UP, v4hi_UP, v4hf_UP) (v2si_UP, v2sf_UP, v1df_UP, di_UP, df_UP, v16qi_UP, v8hi_UP, v8hf_UP) (v4si_UP, v4sf_UP, v2di_UP, v2df_UP, ti_UP, oi_UP, ci_UP, xi_UP) (si_UP, sf_UP, hi_UP, hf_UP, qi_UP): Likewise. (CRC32_BUILTIN, ENTRY): Likewise. * config/aarch64/aarch64.c (aarch64_push_regs): Likewise. (aarch64_pop_regs): Likewise. (aarch64_process_components): Likewise. * config/alpha/alpha.c (alpha_emit_conditional_move): Likewise. * config/arm/arm-builtins.c (v8qi_UP, v4hi_UP, v4hf_UP, v2si_UP) (v2sf_UP, di_UP, v16qi_UP, v8hi_UP, v8hf_UP, v4si_UP, v4sf_UP) (v2di_UP, ti_UP, ei_UP, oi_UP, hf_UP, si_UP, void_UP): Likewise. * config/arm/arm.c (arm_init_libfuncs): Likewise. * config/i386/i386-builtin-types.awk (ix86_builtin_type_vect_mode): Likewise. * config/i386/i386-builtin.def (pcmpestr): Likewise. (pcmpistr): Likewise. * config/microblaze/microblaze.c (double_memory_operand): Likewise. * config/mmix/mmix.c (mmix_output_condition): Likewise. * config/powerpcspe/powerpcspe.c (rs6000_init_hard_regno_mode_ok): Likewise. * config/rl78/rl78.c (mduc_regs): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Likewise. (htm_expand_builtin): Likewise. * config/sh/sh.h (REGISTER_NATURAL_MODE): Likewise. * config/sparc/sparc.c (emit_save_or_restore_regs): Likewise. * config/xtensa/xtensa.c (print_operand): Likewise. * expmed.h (NUM_MODE_PARTIAL_INT): Likewise. (NUM_MODE_VECTOR_INT): Likewise. * genoutput.c (null_operand): Likewise. (output_operand_data): Likewise. * genrecog.c (print_parameter_value): Likewise. * lra.c (debug_operand_data): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251452
2017-07-02Reorganise machmode.h headersRichard Sandiford
This patch splits the auto-generated inline functions out of insn-modes.h and puts them in a new header file, insn-modes-inline.h. It also makes coretypes.h include these files directly, rather than indirectly via machmode.h. This in turn allows insn-modes-inline.h and machmode.h to come later in the include list, after wide-int.h. This is useful for later patches. insn-modes.h itself still needs to come first, since it provides configuration information like MAX_BITSIZE_MODE_ANY_INT, which is used to control the size of a wide_int. The patch also makes the generator files include machmode.h via coretypes.h. Previously they did it by more indirect means. Finally, the patch makes wide-int-print.h available via coretypes.h too. There didn't seem to be any reason to force only the print routines to be included directly, and it would be painful to extend that approach to the SVE patches. [Based on the code ARM contributed in branches/ARM/sve-branch@242100] 2017-07-02 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> contrib/header-tools/ * graph-header-logs (ignore): Update coretypes.h header list. gcc/ * Makefile.in (MACHMODE_H): Remove insn-modes.h (CORETYPES_H): New define. (MOSTLYCLEANFILES): Add insn-modes-inline.h. (insn-modes-inline.h, s-modes-inline-h): New rules. (generated_files): Add insn-modes-inline.h. (RTL_BASE_H, TREE_CORE_H): Use CORETYPES_H instead of coretypes.h. (build/gensupport.o, build/ggc-none.o, build/print-rtl.o): Likewise. (build/read-md.o, build/read-rtl.o, build/rtl.o): Likewise. (build/vec.o, build/hash-table.o, build/inchash.o): Likewise. (build/gencondmd.o, build/genattr.o, build/genattr-common.o): Likewise. (build/genattrtab.o, build/genautomata.o, build/gencheck.o): Likewise. (build/gencodes.o, build/genconditions.o): Likewise. (build/genconfig.o, build/genconstants.o, build/genemit.o): Likewise. (build/genenums.o, build/genextract.o, build/genflags.o): Likewise. (build/gentarget-def.o, build/genmddeps.o, build/genopinit.o) (build/genoutput.o, build/genpeep.o, build/genpreds.o): Likewise. (build/genrecog.o, build/genmddump.o, build/genmatch.o): Likewise. (build/gencfn-macros.o, build/gcov-iov.o): Likewise. * coretypes.h: Include everything up to real.h for generators. Include insn-modes.h first. Include wide-int-print.h after wide-int.h. Include insn-modes-inline.h and then machmode.h. * machmode.h: Don't include insn-modes.h here. * function-tests.c: Remove includes of signop.h, machmode.h, double-int.h and wide-int.h. * rtl.h: Likewise. * gcc-rich-location.c: Remove includes of machmode.h, double-int.h and wide-int.h. * optc-save-gen.awk: Likewise. * gencheck.c (BITS_PER_UNIT): Delete dummy definition. * godump.c: Remove include of wide-int-print.h. * pretty-print.h: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * hash-map-tests.c: Remove include of signop.h. * hash-set-tests.c: Likewise. * rtl-tests.c: Likewise. * mkconfig.sh: Remove include of machmode.h. * genmodes.c (emit_insn_modes_h): Split emission of inline functions into... (emit_insn_modes_inline_h): ...this new function. Emit the code into an insn-modes-inline.h header file, adding appropriate include guards and end comments. (emit_insn_modes_c_header): Remove include of machmode.h. (emit_min_insn_modes_c_header): Include coretypes.h rather than machmode.h. (main): Handle -i flag and call emit_insn_modes_inline_h when it is passed. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r249881
2017-03-24genrecog.c (validate_pattern): Add VEC_SELECT validation.Jakub Jelinek
* genrecog.c (validate_pattern): Add VEC_SELECT validation. * genmodes.c (emit_min_insn_modes_c): Call emit_mode_nunits and emit_mode_inner. From-SVN: r246460
2017-01-01Update copyright years.Jakub Jelinek
From-SVN: r243994
2016-11-17Enable AVX512_4FMAPS and AVX512_4VNNIW instructionsKirill Yukhin
This requires additional patch for register allocator from Vladimir Makarov. gcc/ 2016-11-17 Kirill Yukhin <kirill.yukhin@gmail.com> Andrew Senkevich <andrew.senkevich@intel.com> * common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX5124FMAPS_SET, OPTION_MASK_ISA_AVX5124FMAPS_UNSET, OPTION_MASK_ISA_AVX5124VNNIW_SET, OPTION_MASK_ISA_AVX5124VNNIW_UNSET): New. (ix86_handle_option): Handle OPT_mavx5124fmaps, OPT_mavx5124vnniw. * config.gcc: Add avx5124fmapsintrin.h, avx5124vnniwintrin.h. * config/i386/avx5124fmapsintrin.h: New file. * config/i386/avx5124vnniwintrin.h: Ditto. * config/i386/constraints.md (h): New constraint. * config/i386/cpuid.h: (bit_AVX5124VNNIW, bit_AVX5124FMAPS): New. * config/i386/driver-i386.c (host_detect_local_cpu): Detect avx5124fmaps, avx5124vnniw. * config/i386/i386-builtin-types.def: Add types V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF_V16SF_UHI, V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF, V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF, V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF_V4SF_UQI, V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI, V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI_V16SI_UHI. * config/i386/i386-builtin.def (__builtin_ia32_4fmaddps_mask, __builtin_ia32_4fmaddps, __builtin_ia32_4fmaddss, __builtin_ia32_4fmaddss_mask, __builtin_ia32_4fnmaddps_mask, __builtin_ia32_4fnmaddps, __builtin_ia32_4fnmaddss, __builtin_ia32_4fnmaddss_mask, __builtin_ia32_vp4dpwssd, __builtin_ia32_vp4dpwssd_mask, __builtin_ia32_vp4dpwssds, __builtin_ia32_vp4dpwssds_mask): New. * config/i386/i386-c.c (ix86_target_macros_internal): Define __AVX5124FMAPS__, __AVX5124VNNIW__. * config/i386/i386-modes.def: Fixed comment typos, added new modes (VECTOR_MODES (FLOAT, 256), VECTOR_MODE (INT, SI, 64)). * config/i386/i386.c (ix86_target_string): Add -mavx5124fmaps, -mavx5124vnniw. (PTA_AVX5124FMAPS, PTA_AVX5124VNNIW): Define. (ix86_option_override_internal): Handle new options. (ix86_valid_target_attribute_inner_p): Add avx5124fmaps, avx5124vnniw. (ix86_expand_builtin): Handle new builtins. (ix86_additional_allocno_class_p): New. * config/i386/i386.h (TARGET_AVX5124FMAPS, TARGET_AVX5124FMAPS_P, TARGET_AVX5124VNNIW, TARGET_AVX5124VNNIW_P): Define. (reg_class): Add MOD4_SSE_REGS. (MOD4_SSE_REG_P, MOD4_SSE_REGNO_P): New. * config/i386/i386.opt: Add mavx5124fmaps, mavx5124vnniw. * config/i386/immintrin.h: Include avx5124fmapsintrin.h, avx5124vnniwintrin.h. * config/i386/sse.md (unspec): Add UNSPEC_VP4FMADD, UNSPEC_VP4FNMADD, UNSPEC_VP4DPWSSD, UNSPEC_VP4DPWSSDS. (define_mode_iterator IMOD4): New. (define_mode_attr imod4_narrow): Ditto. (define_insn "mov<mode>"): Ditto. (define_insn "avx5124fmaddps_4fmaddps"): Ditto. (define_insn "avx5124fmaddps_4fmaddps_mask"): Ditto. (define_insn "avx5124fmaddps_4fmaddps_maskz"): Ditto. (define_insn "avx5124fmaddps_4fmaddss"): Ditto. (define_insn "avx5124fmaddps_4fmaddss_mask"): Ditto. (define_insn "avx5124fmaddps_4fmaddss_maskz"): Ditto. (define_insn "avx5124fmaddps_4fnmaddps"): Ditto. (define_insn "avx5124fmaddps_4fnmaddps_mask"): Ditto. (define_insn "avx5124fmaddps_4fnmaddps_maskz"): Ditto. (define_insn "avx5124fmaddps_4fnmaddss"): Ditto. (define_insn "avx5124fmaddps_4fnmaddss_mask"): Ditto. (define_insn "avx5124fmaddps_4fnmaddss_maskz"): Ditto. (define_insn "avx5124vnniw_vp4dpwssd"): Ditto. (define_insn "avx5124vnniw_vp4dpwssd_mask"): Ditto. (define_insn "avx5124vnniw_vp4dpwssd_maskz"): Ditto. (define_insn "avx5124vnniw_vp4dpwssds"): Ditto. (define_insn "avx5124vnniw_vp4dpwssds_mask"): Ditto. (define_insn "avx5124vnniw_vp4dpwssds_maskz"): Ditto. * init-regs.c (initialize_uninitialized_regs): Add emit_clobber call. * genmodes.c (mode_size_inline): Extend return type. * machmode.h (mode_size, mode_base_align): Extend type. gcc/testsuite/ 2016-11-17 Kirill Yukhin <kirill.yukhin@gmail.com> Andrew Senkevich <andrew.senkevich@intel.com> * gcc.target/i386/avx5124fmadd-v4fmaddps-1.c: New test. * gcc.target/i386/avx5124fmadd-v4fmaddps-2.c: Ditto. * gcc.target/i386/avx5124fmadd-v4fmaddss-1.c: Ditto. * gcc.target/i386/avx5124fmadd-v4fnmaddps-1.c: Ditto. * gcc.target/i386/avx5124fmadd-v4fnmaddps-2.c: Ditto. * gcc.target/i386/avx5124fmadd-v4fnmaddss-1.c: Ditto. * gcc.target/i386/avx5124fmaps-check.h: Ditto. * gcc.target/i386/avx5124vnniw-check.h: Ditto. * gcc.target/i386/avx5124vnniw-vp4dpwssd-1.c: Ditto. * gcc.target/i386/avx5124vnniw-vp4dpwssd-2.c: Ditto. * gcc.target/i386/avx5124vnniw-vp4dpwssds-1.c: Ditto. * gcc.target/i386/avx5124vnniw-vp4dpwssds-2.c: Ditto. * gcc.target/i386/avx512f-helper.h: Add avx5124fmaps-check.h, avx5124vnniw-check.h. * gcc.target/i386/i386.exp (check_effective_target_avx5124fmaps, check_effective_target_avx5124vnniw): New. * gcc.target/i386/m128-check.h (ESP_FLOAT, ESP_DOUBLE): Set under ifndef. * gcc.target/i386/sse-12.c: Add -mavx5124fmaps, -mavx5124vnniw. * gcc.target/i386/sse-13.c: Ditto. * g++.dg/other/i386-2.C: Ditto. * g++.dg/other/i386-3.C: Ditto. * gcc.target/i386/sse-22.c: Ditto. * gcc.target/i386/sse-23.c: Ditto. From-SVN: r242569
2016-09-01c-ada-spec.c (dump_ada_function_declaration): Increase buffer size to ↵Martin Sebor
guarantee it fits the output of the formatted function... gcc/c-family/ChangeLog: * c-ada-spec.c (dump_ada_function_declaration): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/cp/ChangeLog: * mangle.c: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/go/ChangeLog: * gofrontend/expressions.cc: Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. gcc/java/ChangeLog: * decl.c (give_name_to_locals): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * mangle_name.c (append_unicode_mangled_name): Same. gcc/ChangeLog: * genmatch.c (parser::parse_expr): Increase buffer size to guarantee it fits the output of the formatted function regardless of its arguments. * gcc/genmodes.c (parser::parse_expr): Same. * gimplify.c (gimplify_asm_expr): Same. * passes.c (pass_manager::register_one_dump_file): Same. * print-tree.c (print_node): Same. From-SVN: r239949
2016-07-26Teach VRP to register assertions along default switch labels (PR18046)Patrick Palka
gcc/ChangeLog: PR tree-optimization/18046 * genmodes.c (emit_mode_size_inline): Emit an assert that verifies that mode is a valid array index. (emit_mode_nuinits_inline): Likewise. (emit_mode_inner_inline): Likewise. (emit_mode_unit_size_inline): Likewise. (emit_mode_unit_precision_inline): Likewise. * tree-vrp.c: Include params.h. (find_switch_asserts): Register edge assertions for the default label which correspond to the anti-ranges of each case label. * params.def (PARAM_MAX_VRP_SWITCH_ASSERTIONS): New. * doc/invoke.texi: Document it. gcc/testsuite/ChangeLog: PR tree-optimization/18046 * gcc.dg/tree-ssa/ssa-dom-thread-6.c: Bump FSM count to 5. * gcc.dg/tree-ssa/vrp103.c: New test. * gcc.dg/tree-ssa/vrp104.c: New test. From-SVN: r238761
2016-07-20cse.c: Use HOST_WIDE_INT_M1 instead of ~(HOST_WIDE_INT) 0.Uros Bizjak
* cse.c: Use HOST_WIDE_INT_M1 instead of ~(HOST_WIDE_INT) 0. * combine.c: Use HOST_WIDE_INT_M1U instead of ~(unsigned HOST_WIDE_INT) 0. * double-int.h: Ditto. * dse.c: Ditto. * dwarf2asm.c:Ditto. * expmed.c: Ditto. * genmodes.c: Ditto. * match.pd: Ditto. * read-rtl.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-ssa-loop-prefetch.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-patterns.c: Ditto. * tree.c: Ditto. From-SVN: r238529
2016-07-19builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1...Uros Bizjak
* builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, HOST_WIDE_INT_1U instead of (unsigned HOST_WIDE_INT) 1, HOST_WIDE_INT_M1 instead of (HOST_WIDE_INT) -1 and HOST_WIDE_INT_M1U instead of (unsigned HOST_WIDE_INT) -1. * combine.c: Ditto. * cse.c: Ditto. * dojump.c: Ditto. * double-int.c: Ditto. * dse.c: Ditto. * dwarf2out.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * fwprop.c: Ditto. * genmodes.c: Ditto. * hwint.c: Ditto. * hwint.h: Ditto. * ifcvt.c: Ditto. * loop-doloop.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * match.pd: Ditto. * optabs.c: Ditto. * real.c: Ditto. * reload.c: Ditto. * rtlanal.c: Ditto. * simplify-rtx.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-patterns.c: Ditto. * tree.c: Ditto. * tree.h: Ditto. * ubsan.c: Ditto. * varasm.c: Ditto. * wide-int-print.cc: Ditto. * wide-int.cc: Ditto. * wide-int.h: Ditto. From-SVN: r238481
2016-05-02machmode.h (mode_complex): Add support to give the complex mode for a given ↵Michael Meissner
mode. [gcc] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * machmode.h (mode_complex): Add support to give the complex mode for a given mode. (GET_MODE_COMPLEX_MODE): Likewise. * stor-layout.c (layout_type): For COMPLEX_TYPE, use the mode stored by build_complex_type and gfc_build_complex_type instead of trying to figure out the appropriate mode based on the size. Raise an assertion error, if the type was not set. * genmodes.c (struct mode_data): Add field for the complex type of the given type. (blank_mode): Likewise. (make_complex_modes): Remember the complex mode created in the base type. (emit_mode_complex): Write out the mode_complex array to map a type mode to the complex version. (emit_insn_modes_c): Likewise. * tree.c (build_complex_type): Set the complex type to use before calling layout_type. * config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Add support for __float128 complex datatypes. (rs6000_hard_regno_mode_ok): Likewise. (rs6000_setup_reg_addr_masks): Likewise. (rs6000_complex_function_value): Likewise. * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Likewise. __float128 and __ibm128 complex. (FLOAT128_IBM_P): Likewise. (ALTIVEC_ARG_MAX_RETURN): Likewise. * doc/extend.texi (Additional Floating Types): Document that -mfloat128 must be used to enable __float128. Document complex __float128 and __ibm128 support. [gcc/fortran] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * trans-types.c (gfc_build_complex_type): [gcc/testsuite] 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com> * gcc.target/powerpc/float128-complex-1.c: New tests for complex __float128. * gcc.target/powerpc/float128-complex-2.c: Likewise. From-SVN: r235794
2016-01-04Update copyright years.Jakub Jelinek
From-SVN: r232055
2015-09-01genmodes.c: Add CONST_MODE_UNIT_SIZE modifier.David Sherwood
2015-09-01 David Sherwood <david.sherwood@arm.com> gcc/ * genmodes.c: Add CONST_MODE_UNIT_SIZE modifier. From-SVN: r227369
2015-08-19genmodes.c (emit_mode_unit_size_inline): New function.David Sherwood
2015-08-19 David Sherwood <david.sherwood@arm.com> gcc/ * genmodes.c (emit_mode_unit_size_inline): New function. (emit_mode_unit_precision_inline): New function. (emit_insn_modes_h): Emit new #define. Emit new functions. (emit_mode_unit_size): New function. (emit_mode_unit_precision): New function. (emit_mode_adjustments): Add mode_unit_size adjustments. (emit_insn_modes_c): Emit new arrays. * machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to use new inline methods. From-SVN: r227013
2015-07-28arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally.David Sherwood
gcc/ 2015-07-28 David Sherwood <david.sherwood@arm.com> * config/arm/arm.c (neon_element_bits, neon_valid_immediate): Call GET_MODE_INNER unconditionally. * config/spu/spu.c (arith_immediate_p): Likewise. * config/i386/i386.c (ix86_build_signbit_mask): Likewise. * expmed.c (synth_mult): Remove check for VOIDmode result from GET_MODE_INNER. (expand_mult_const): Likewise. * fold-const.c (fold_binary_loc): Replace call to element_precision with call to GET_MODE_PRECISION. * genmodes.c (emit_mode_inner_inline): Replace void_mode->name with m->name. (emit_mode_inner): Likewise. * lto-streamer-out.c (lto_write_mode_table): Update GET_MODE_INNER result check. * machmode.h (GET_MODE_UNIT_SIZE): Simplify. (GET_MODE_UNIT_PRECISION): Likewise. * rtlanal.c (subreg_get_info): Call GET_MODE_INNER unconditionally. * simplify-rtx.c (simplify_immed_subreg): Likewise. * stor-layout.c (bitwise_type_for_mode): Update assert. (element_precision): Remove. From-SVN: r226328
2015-06-08coretypes.h: Include hash-table.h and hash-set.h for host files.Andrew MacLeod
2015-06-08 Andrew MacLeod <amacleod@redhat.com> * coretypes.h: Include hash-table.h and hash-set.h for host files. * ggc.h: Don't include statistics.h> * hash-map.h: Remove all includes. * hash-set.h: Likewise. * hash-table.h: Add statistics.h, inchash.h and hash-map-traits.h to the include list. Remove <new>. * inchash.h: Remove all includes. * mem-stats.h: Likewise. * vec.h: No special processing for generators or ggc. * alias.c : Adjust include files. * alloc-pool.c : Likewise. * alloc-pool.h : Likewise. * asan.c : Likewise. * attribs.c : Likewise. * auto-inc-dec.c : Likewise. * auto-profile.c : Likewise. * bb-reorder.c : Likewise. * bitmap.c : Likewise. * bitmap.h : Likewise. * bt-load.c : Likewise. * builtins.c : Likewise. * caller-save.c : Likewise. * calls.c : Likewise. * ccmp.c : Likewise. * cfg.c : Likewise. * cfganal.c : Likewise. * cfgbuild.c : Likewise. * cfgcleanup.c : Likewise. * cfgexpand.c : Likewise. * cfghooks.c : Likewise. * cfgloop.c : Likewise. * cfgloop.h : Likewise. * cfgloopanal.c : Likewise. * cfgloopmanip.c : Likewise. * cfgrtl.c : Likewise. * cgraph.c : Likewise. * cgraphbuild.c : Likewise. * cgraphclones.c : Likewise. * cgraphunit.c : Likewise. * cilk-common.c : Likewise. * combine-stack-adj.c : Likewise. * combine.c : Likewise. * compare-elim.c : Likewise. * context.c : Likewise. * convert.c : Likewise. * coverage.c : Likewise. * cppbuiltin.c : Likewise. * cprop.c : Likewise. * cse.c : Likewise. * cselib.c : Likewise. * data-streamer-in.c : Likewise. * data-streamer-out.c : Likewise. * data-streamer.c : Likewise. * data-streamer.h : Likewise. * dbxout.c : Likewise. * dce.c : Likewise. * ddg.c : Likewise. * debug.c : Likewise. * df-core.c : Likewise. * df-problems.c : Likewise. * df-scan.c : Likewise. * df.h : Likewise. * dfp.c : Likewise. * dojump.c : Likewise. * dominance.c : Likewise. * domwalk.c : Likewise. * double-int.c : Likewise. * dse.c : Likewise. * dumpfile.c : Likewise. * dwarf2asm.c : Likewise. * dwarf2cfi.c : Likewise. * dwarf2out.c : Likewise. * emit-rtl.c : Likewise. * et-forest.c : Likewise. * except.c : Likewise. * except.h : Likewise. * explow.c : Likewise. * expmed.c : Likewise. * expr.c : Likewise. * final.c : Likewise. * fixed-value.c : Likewise. * fold-const.c : Likewise. * function.c : Likewise. * fwprop.c : Likewise. * gcc-plugin.h : Likewise. * gcc.c : Likewise. * gcse-common.c : Likewise. * gcse.c : Likewise. * genattrtab.c : Likewise. * genautomata.c : Likewise. * genconditions.c : Likewise. * genemit.c : Likewise. * generic-match-head.c : Likewise. * genextract.c : Likewise. * gengtype-state.c : Likewise. * gengtype.c : Likewise. * genhooks.c : Likewise. * genmatch.c : Likewise. * genmodes.c : Likewise. * genrecog.c : Likewise. * gensupport.c : Likewise. * ggc-common.c : Likewise. * ggc-internal.h : Likewise. * ggc-none.c : Likewise. * ggc-page.c : Likewise. * gimple-builder.c : Likewise. * gimple-expr.c : Likewise. * gimple-fold.c : Likewise. * gimple-iterator.c : Likewise. * gimple-low.c : Likewise. * gimple-match-head.c : Likewise. * gimple-pretty-print.c : Likewise. * gimple-ssa-isolate-paths.c : Likewise. * gimple-ssa-strength-reduction.c : Likewise. * gimple-ssa.h : Likewise. * gimple-streamer-in.c : Likewise. * gimple-streamer-out.c : Likewise. * gimple-streamer.h : Likewise. * gimple-walk.c : Likewise. * gimple.c : Likewise. * gimplify-me.c : Likewise. * gimplify.c : Likewise. * godump.c : Likewise. * graph.c : Likewise. * graphds.c : Likewise. * graphite-blocking.c : Likewise. * graphite-dependences.c : Likewise. * graphite-interchange.c : Likewise. * graphite-isl-ast-to-gimple.c : Likewise. * graphite-optimize-isl.c : Likewise. * graphite-poly.c : Likewise. * graphite-scop-detection.c : Likewise. * graphite-sese-to-poly.c : Likewise. * graphite.c : Likewise. * haifa-sched.c : Likewise. * hard-reg-set.h : Likewise. * hw-doloop.c : Likewise. * ifcvt.c : Likewise. * inchash.c : Likewise. * incpath.c : Likewise. * init-regs.c : Likewise. * input.c : Likewise. * internal-fn.c : Likewise. * ipa-chkp.c : Likewise. * ipa-comdats.c : Likewise. * ipa-cp.c : Likewise. * ipa-devirt.c : Likewise. * ipa-icf-gimple.c : Likewise. * ipa-icf.c : Likewise. * ipa-inline-analysis.c : Likewise. * ipa-inline-transform.c : Likewise. * ipa-inline.c : Likewise. * ipa-polymorphic-call.c : Likewise. * ipa-profile.c : Likewise. * ipa-prop.c : Likewise. * ipa-pure-const.c : Likewise. * ipa-ref.c : Likewise. * ipa-reference.c : Likewise. * ipa-split.c : Likewise. * ipa-utils.c : Likewise. * ipa-visibility.c : Likewise. * ipa.c : Likewise. * ira-build.c : Likewise. * ira-color.c : Likewise. * ira-conflicts.c : Likewise. * ira-costs.c : Likewise. * ira-emit.c : Likewise. * ira-lives.c : Likewise. * ira.c : Likewise. * jump.c : Likewise. * langhooks.c : Likewise. * lcm.c : Likewise. * libfuncs.h : Likewise. * lists.c : Likewise. * loop-doloop.c : Likewise. * loop-init.c : Likewise. * loop-invariant.c : Likewise. * loop-iv.c : Likewise. * loop-unroll.c : Likewise. * lower-subreg.c : Likewise. * lra-assigns.c : Likewise. * lra-coalesce.c : Likewise. * lra-constraints.c : Likewise. * lra-eliminations.c : Likewise. * lra-lives.c : Likewise. * lra-remat.c : Likewise. * lra-spills.c : Likewise. * lra.c : Likewise. * lto-cgraph.c : Likewise. * lto-compress.c : Likewise. * lto-opts.c : Likewise. * lto-section-in.c : Likewise. * lto-section-out.c : Likewise. * lto-streamer-in.c : Likewise. * lto-streamer-out.c : Likewise. * lto-streamer.c : Likewise. * lto-streamer.h : Likewise. * mcf.c : Likewise. * mode-switching.c : Likewise. * modulo-sched.c : Likewise. * omega.c : Likewise. * omp-low.c : Likewise. * optabs.c : Likewise. * opts-global.c : Likewise. * opts.h : Likewise. * passes.c : Likewise. * plugin.c : Likewise. * postreload-gcse.c : Likewise. * postreload.c : Likewise. * predict.c : Likewise. * print-rtl.c : Likewise. * print-tree.c : Likewise. * profile.c : Likewise. * read-md.c : Likewise. * read-md.h : Likewise. * read-rtl.c : Likewise. * real.c : Likewise. * realmpfr.c : Likewise. * recog.c : Likewise. * ree.c : Likewise. * reg-stack.c : Likewise. * regcprop.c : Likewise. * reginfo.c : Likewise. * regrename.c : Likewise. * regstat.c : Likewise. * reload.c : Likewise. * reload1.c : Likewise. * reorg.c : Likewise. * resource.c : Likewise. * rtl-chkp.c : Likewise. * rtl.c : Likewise. * rtl.h : Likewise. * rtlanal.c : Likewise. * rtlhash.c : Likewise. * rtlhash.h : Likewise. * rtlhooks.c : Likewise. * sanopt.c : Likewise. * sched-deps.c : Likewise. * sched-ebb.c : Likewise. * sched-rgn.c : Likewise. * sched-vis.c : Likewise. * sdbout.c : Likewise. * sel-sched-dump.c : Likewise. * sel-sched-ir.c : Likewise. * sel-sched-ir.h : Likewise. * sel-sched.c : Likewise. * sese.c : Likewise. * shrink-wrap.c : Likewise. * shrink-wrap.h : Likewise. * simplify-rtx.c : Likewise. * stack-ptr-mod.c : Likewise. * statistics.c : Likewise. * stmt.c : Likewise. * stor-layout.c : Likewise. * store-motion.c : Likewise. * stringpool.c : Likewise. * symtab.c : Likewise. * target-globals.c : Likewise. * targhooks.c : Likewise. * tlink.c : Likewise. * toplev.c : Likewise. * tracer.c : Likewise. * trans-mem.c : Likewise. * tree-affine.c : Likewise. * tree-affine.h : Likewise. * tree-browser.c : Likewise. * tree-call-cdce.c : Likewise. * tree-cfg.c : Likewise. * tree-cfgcleanup.c : Likewise. * tree-chkp-opt.c : Likewise. * tree-chkp.c : Likewise. * tree-chrec.c : Likewise. * tree-complex.c : Likewise. * tree-data-ref.c : Likewise. * tree-dfa.c : Likewise. * tree-diagnostic.c : Likewise. * tree-dump.c : Likewise. * tree-eh.c : Likewise. * tree-eh.h : Likewise. * tree-emutls.c : Likewise. * tree-hasher.h : Likewise. * tree-if-conv.c : Likewise. * tree-inline.c : Likewise. * tree-inline.h : Likewise. * tree-into-ssa.c : Likewise. * tree-iterator.c : Likewise. * tree-loop-distribution.c : Likewise. * tree-nested.c : Likewise. * tree-nrv.c : Likewise. * tree-object-size.c : Likewise. * tree-outof-ssa.c : Likewise. * tree-parloops.c : Likewise. * tree-phinodes.c : Likewise. * tree-predcom.c : Likewise. * tree-pretty-print.c : Likewise. * tree-profile.c : Likewise. * tree-scalar-evolution.c : Likewise. * tree-sra.c : Likewise. * tree-ssa-address.c : Likewise. * tree-ssa-alias.c : Likewise. * tree-ssa-ccp.c : Likewise. * tree-ssa-coalesce.c : Likewise. * tree-ssa-copy.c : Likewise. * tree-ssa-copyrename.c : Likewise. * tree-ssa-dce.c : Likewise. * tree-ssa-dom.c : Likewise. * tree-ssa-dse.c : Likewise. * tree-ssa-forwprop.c : Likewise. * tree-ssa-ifcombine.c : Likewise. * tree-ssa-live.c : Likewise. * tree-ssa-loop-ch.c : Likewise. * tree-ssa-loop-im.c : Likewise. * tree-ssa-loop-ivcanon.c : Likewise. * tree-ssa-loop-ivopts.c : Likewise. * tree-ssa-loop-manip.c : Likewise. * tree-ssa-loop-niter.c : Likewise. * tree-ssa-loop-prefetch.c : Likewise. * tree-ssa-loop-unswitch.c : Likewise. * tree-ssa-loop.c : Likewise. * tree-ssa-math-opts.c : Likewise. * tree-ssa-operands.c : Likewise. * tree-ssa-phiopt.c : Likewise. * tree-ssa-phiprop.c : Likewise. * tree-ssa-pre.c : Likewise. * tree-ssa-propagate.c : Likewise. * tree-ssa-reassoc.c : Likewise. * tree-ssa-sccvn.c : Likewise. * tree-ssa-scopedtables.c : Likewise. * tree-ssa-sink.c : Likewise. * tree-ssa-strlen.c : Likewise. * tree-ssa-structalias.c : Likewise. * tree-ssa-tail-merge.c : Likewise. * tree-ssa-ter.c : Likewise. * tree-ssa-threadedge.c : Likewise. * tree-ssa-threadupdate.c : Likewise. * tree-ssa-uncprop.c : Likewise. * tree-ssa-uninit.c : Likewise. * tree-ssa.c : Likewise. * tree-ssanames.c : Likewise. * tree-stdarg.c : Likewise. * tree-streamer-in.c : Likewise. * tree-streamer-out.c : Likewise. * tree-streamer.c : Likewise. * tree-streamer.h : Likewise. * tree-switch-conversion.c : Likewise. * tree-tailcall.c : Likewise. * tree-vect-data-refs.c : Likewise. * tree-vect-generic.c : Likewise. * tree-vect-loop-manip.c : Likewise. * tree-vect-loop.c : Likewise. * tree-vect-patterns.c : Likewise. * tree-vect-slp.c : Likewise. * tree-vect-stmts.c : Likewise. * tree-vectorizer.c : Likewise. * tree-vectorizer.h : Likewise. * tree-vrp.c : Likewise. * tree.c : Likewise. * tsan.c : Likewise. * ubsan.c : Likewise. * valtrack.c : Likewise. * valtrack.h : Likewise. * value-prof.c : Likewise. * var-tracking.c : Likewise. * varasm.c : Likewise. * varpool.c : Likewise. * vec.c: Likewise. * vmsdbgout.c : Likewise. * vtable-verify.c : Likewise. * vtable-verify.h : Likewise. * web.c : Likewise. * wide-int.cc : Likewise. * xcoffout.c : Likewise. * config/aarch64/aarch64-builtins.c : Likewise. * config/aarch64/aarch64.c : Likewise. * config/aarch64/cortex-a57-fma-steering.c : Likewise. * config/alpha/alpha.c : Likewise. * config/arc/arc.c : Likewise. * config/arm/aarch-common.c : Likewise. * config/arm/arm-builtins.c : Likewise. * config/arm/arm-c.c : Likewise. * config/arm/arm.c : Likewise. * config/avr/avr-c.c : Likewise. * config/avr/avr-log.c : Likewise. * config/avr/avr.c : Likewise. * config/bfin/bfin.c : Likewise. * config/c6x/c6x.c : Likewise. * config/cr16/cr16.c : Likewise. * config/cris/cris.c : Likewise. * config/darwin-c.c : Likewise. * config/darwin.c : Likewise. * config/default-c.c : Likewise. * config/epiphany/epiphany.c : Likewise. * config/epiphany/mode-switch-use.c : Likewise. * config/epiphany/resolve-sw-modes.c : Likewise. * config/fr30/fr30.c : Likewise. * config/frv/frv.c : Likewise. * config/ft32/ft32.c : Likewise. * config/glibc-c.c : Likewise. * config/h8300/h8300.c : Likewise. * config/i386/i386-c.c : Likewise. * config/i386/i386.c : Likewise. * config/i386/msformat-c.c : Likewise. * config/i386/winnt-cxx.c : Likewise. * config/i386/winnt-stubs.c : Likewise. * config/i386/winnt.c : Likewise. * config/ia64/ia64-c.c : Likewise. * config/ia64/ia64.c : Likewise. * config/iq2000/iq2000.c : Likewise. * config/lm32/lm32.c : Likewise. * config/m32c/m32c-pragma.c : Likewise. * config/m32c/m32c.c : Likewise. * config/m32r/m32r.c : Likewise. * config/m68k/m68k.c : Likewise. * config/mcore/mcore.c : Likewise. * config/mep/mep-pragma.c : Likewise. * config/mep/mep.c : Likewise. * config/microblaze/microblaze-c.c : Likewise. * config/microblaze/microblaze.c : Likewise. * config/mips/mips.c : Likewise. * config/mmix/mmix.c : Likewise. * config/mn10300/mn10300.c : Likewise. * config/moxie/moxie.c : Likewise. * config/msp430/msp430-c.c : Likewise. * config/msp430/msp430.c : Likewise. * config/nds32/nds32-cost.c : Likewise. * config/nds32/nds32-fp-as-gp.c : Likewise. * config/nds32/nds32-intrinsic.c : Likewise. * config/nds32/nds32-isr.c : Likewise. * config/nds32/nds32-md-auxiliary.c : Likewise. * config/nds32/nds32-memory-manipulation.c : Likewise. * config/nds32/nds32-pipelines-auxiliary.c : Likewise. * config/nds32/nds32-predicates.c : Likewise. * config/nds32/nds32.c : Likewise. * config/nios2/nios2.c : Likewise. * config/nvptx/nvptx.c : Likewise. * config/pa/pa.c : Likewise. * config/pdp11/pdp11.c : Likewise. * config/rl78/rl78-c.c : Likewise. * config/rl78/rl78.c : Likewise. * config/rs6000/rs6000-c.c : Likewise. * config/rs6000/rs6000.c : Likewise. * config/rx/rx.c : Likewise. * config/s390/s390-c.c : Likewise. * config/s390/s390.c : Likewise. * config/sh/sh-c.c : Likewise. * config/sh/sh-mem.cc : Likewise. * config/sh/sh.c : Likewise. * config/sh/sh_optimize_sett_clrt.cc : Likewise. * config/sh/sh_treg_combine.cc : Likewise. * config/sol2-c.c : Likewise. * config/sol2-cxx.c : Likewise. * config/sol2-stubs.c : Likewise. * config/sol2.c : Likewise. * config/sparc/sparc-c.c : Likewise. * config/sparc/sparc.c : Likewise. * config/spu/spu-c.c : Likewise. * config/spu/spu.c : Likewise. * config/stormy16/stormy16.c : Likewise. * config/tilegx/mul-tables.c : Likewise. * config/tilegx/tilegx-c.c : Likewise. * config/tilegx/tilegx.c : Likewise. * config/tilepro/mul-tables.c : Likewise. * config/tilepro/tilepro-c.c : Likewise. * config/tilepro/tilepro.c : Likewise. * config/v850/v850-c.c : Likewise. * config/v850/v850.c : Likewise. * config/vax/vax.c : Likewise. * config/visium/visium.c : Likewise. * config/vms/vms-c.c : Likewise. * config/vms/vms.c : Likewise. * config/vxworks.c : Likewise. * config/winnt-c.c : Likewise. * config/xtensa/xtensa.c : Likewise. ada 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c : Adjust include files. * gcc-interface/decl.c : Likewise. * gcc-interface/misc.c : Likewise. * gcc-interface/targtyps.c : Likewise. * gcc-interface/trans.c : Likewise. * gcc-interface/utils.c : Likewise. * gcc-interface/utils2.c : Likewise. c 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c : Adjust include files. * c-aux-info.c : Likewise. * c-convert.c : Likewise. * c-decl.c : Likewise. * c-errors.c : Likewise. * c-lang.c : Likewise. * c-lang.h : Likewise. * c-objc-common.c : Likewise. * c-parser.c : Likewise. * c-typeck.c : Likewise. cfamily 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c : Adjust include files. * c-ada-spec.c : Likewise. * c-cilkplus.c : Likewise. * c-common.c : Likewise. * c-common.h : Likewise. * c-cppbuiltin.c : Likewise. * c-dump.c : Likewise. * c-format.c : Likewise. * c-gimplify.c : Likewise. * c-indentation.c : Likewise. * c-lex.c : Likewise. * c-omp.c : Likewise. * c-opts.c : Likewise. * c-pch.c : Likewise. * c-ppoutput.c : Likewise. * c-pragma.c : Likewise. * c-pretty-print.c : Likewise. * c-semantics.c : Likewise. * c-ubsan.c : Likewise. * cilk.c : Likewise. * stub-objc.c : Likewise. cp 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * call.c : Adjust include files. * class.c : Likewise. * constexpr.c : Likewise. * cp-array-notation.c : Likewise. * cp-cilkplus.c : Likewise. * cp-gimplify.c : Likewise. * cp-lang.c : Likewise. * cp-objcp-common.c : Likewise. * cp-tree.h : Likewise. * cp-ubsan.c : Likewise. * cvt.c : Likewise. * decl.c : Likewise. * decl2.c : Likewise. * dump.c : Likewise. * error.c : Likewise. * except.c : Likewise. * expr.c : Likewise. * friend.c : Likewise. * init.c : Likewise. * lambda.c : Likewise. * lex.c : Likewise. * mangle.c : Likewise. * method.c : Likewise. * name-lookup.c : Likewise. * optimize.c : Likewise. * parser.c : Likewise. * pt.c : Likewise. * ptree.c : Likewise. * repo.c : Likewise. * rtti.c : Likewise. * search.c : Likewise. * semantics.c : Likewise. * tree.c : Likewise. * typeck.c : Likewise. * typeck2.c : Likewise. * vtable-class-hierarchy.c : Likewise. fortran 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * convert.c : Adjust include files. * cpp.c : Likewise. * decl.c : Likewise. * f95-lang.c : Likewise. * gfortran.h : Likewise. * iresolve.c : Likewise. * match.c : Likewise. * module.c : Likewise. * openmp.c : Likewise. * options.c : Likewise. * target-memory.c : Likewise. * trans-array.c : Likewise. * trans-common.c : Likewise. * trans-const.c : Likewise. * trans-decl.c : Likewise. * trans-expr.c : Likewise. * trans-intrinsic.c : Likewise. * trans-io.c : Likewise. * trans-openmp.c : Likewise. * trans-stmt.c : Likewise. * trans-types.c : Likewise. * trans.c : Likewise. go 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * go-backend.c : Adjust include files. * go-gcc.cc : Likewise. * go-lang.c : Likewise. java 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * boehm.c : Adjust include files. * builtins.c : Likewise. * class.c : Likewise. * constants.c : Likewise. * decl.c : Likewise. * except.c : Likewise. * expr.c : Likewise. * java-gimplify.c : Likewise. * java-tree.h : Likewise. * jcf-dump.c : Likewise. * jcf-io.c : Likewise. * jcf-parse.c : Likewise. * jcf-reader.c : Likewise. * jvgenmain.c : Likewise. * lang.c : Likewise. * mangle.c : Likewise. * mangle_name.c : Likewise. * resource.c : Likewise. * typeck.c : Likewise. * verify-glue.c : Likewise. * verify-impl.c : Likewise. jit 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c : Adjust include files. * jit-common.h : Likewise. * jit-playback.c : Likewise. lto 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c : Adjust include files. * lto-object.c : Likewise. * lto-partition.c : Likewise. * lto-partition.h : Likewise. * lto-symtab.c : Likewise. * lto.c : Likewise. * lto.h : Likewise. objc 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * objc-act.c : Adjust include files. * objc-encoding.c : Likewise. * objc-gnu-runtime-abi-01.c : Likewise. * objc-lang.c : Likewise. * objc-map.c : Likewise. * objc-next-runtime-abi-01.c : Likewise. * objc-next-runtime-abi-02.c : Likewise. * objc-runtime-shared-support.c : Likewise. objcp 2015-06-08 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c : Adjust include files. * objcp-lang.c : Likewise. From-SVN: r224250
2015-05-19Use std::swap instead of explicit swapsMikhail Maltsev
gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-01-05Update copyright years.Jakub Jelinek
From-SVN: r219188
2014-11-05ipa-chkp.c: New.Ilya Enkovich
gcc/ 2014-11-05 Ilya Enkovich <ilya.enkovich@intel.com> * ipa-chkp.c: New. * ipa-chkp.h: New. * tree-chkp.c: New. * tree-chkp.h: New. * tree-chkp-opt.c: New. * rtl-chkp.c: New. * rtl-chkp.h: New. * Makefile.in (OBJS): Add ipa-chkp.o, rtl-chkp.o, tree-chkp.o tree-chkp-opt.o. (GTFILES): Add tree-chkp.c. * mode-classes.def (MODE_POINTER_BOUNDS): New. * tree.def (POINTER_BOUNDS_TYPE): New. * genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS. (POINTER_BOUNDS_MODE): New. (make_pointer_bounds_mode): New. * machmode.h (POINTER_BOUNDS_MODE_P): New. * stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS. (layout_type): Support POINTER_BOUNDS_TYPE. * tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE. * tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE. * tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE. (type_contains_placeholder_1): Likewise. (build_common_tree_nodes): Initialize pointer_bounds_type_node. * tree.h (POINTER_BOUNDS_TYPE_P): New. (pointer_bounds_type_node): New. (POINTER_BOUNDS_P): New. (BOUNDED_TYPE_P): New. (BOUNDED_P): New. (CALL_WITH_BOUNDS_P): New. * gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS. (gimple_call_with_bounds_p): New. (gimple_call_set_with_bounds): New. (gimple_return_retbnd): New. (gimple_return_set_retbnd): New * gimple.c (gimple_build_return): Increase number of ops for return statement. (gimple_build_call_from_tree): Propagate CALL_WITH_BOUNDS_P flag. * gimple-pretty-print.c (dump_gimple_return): Print second op. * rtl.h (CALL_EXPR_WITH_BOUNDS_P): New. * gimplify.c (gimplify_init_constructor): Avoid infinite loop during gimplification of bounds initializer. * calls.c: Include tree-chkp.h, rtl-chkp.h, bitmap.h. (special_function_p): Use original decl name when analyzing instrumentation clone. (arg_data): Add fields special_slot, pointer_arg and pointer_offset. (store_bounds): New. (emit_call_1): Propagate instrumentation flag for CALL. (initialize_argument_information): Compute pointer_arg, pointer_offset and special_slot for pointer bounds arguments. (finalize_must_preallocate): Preallocate when storing bounds in bounds table. (compute_argument_addresses): Skip pointer bounds. (expand_call): Store bounds into tables separately. Return result joined with resulting bounds. * cfgexpand.c: Include tree-chkp.h, rtl-chkp.h. (expand_call_stmt): Propagate bounds flag for CALL_EXPR. (expand_return): Add returned bounds arg. Handle returned bounds. (expand_gimple_stmt_1): Adjust to new expand_return signature. (gimple_expand_cfg): Reset rtx bounds map. * expr.c: Include tree-chkp.h, rtl-chkp.h. (expand_assignment): Handle returned bounds. (store_expr_with_bounds): New. Replaces store_expr with new bounds target argument. Handle bounds returned by calls. (store_expr): Now wraps store_expr_with_bounds. * expr.h (store_expr_with_bounds): New. * function.c: Include tree-chkp.h, rtl-chkp.h. (bounds_parm_data): New. (use_register_for_decl): Do not registerize decls used for bounds stores and loads. (assign_parms_augmented_arg_list): Add bounds of the result structure pointer as the second argument. (assign_parm_find_entry_rtl): Mark bounds are never passed on the stack. (assign_parm_is_stack_parm): Likewise. (assign_parm_load_bounds): New. (assign_bounds): New. (assign_parms): Load bounds and determine a location for returned bounds. (diddle_return_value_1): New. (diddle_return_value): Handle returned bounds. * function.h (rtl_data): Add field for returned bounds. * varasm.c: Include tree-chkp.h. (output_constant): Support POINTER_BOUNDS_TYPE. (output_constant_pool_2): Support MODE_POINTER_BOUNDS. (ultimate_transparent_alias_target): Move up. (make_decl_rtl): For instrumented function use name of the original decl. (assemble_start_function): Mark function as global in case it is instrumentation clone of the global function. (do_assemble_alias): Follow transparent alias chain for identifier. Check if original alias is public. (maybe_assemble_visibility): Use visibility of the original function for instrumented version. (default_unique_section): Likewise. * emit-rtl.c (immed_double_const): Support MODE_POINTER_BOUNDS. (init_emit_once): Build pointer bounds zero constants. * explow.c (trunc_int_for_mode): Support MODE_POINTER_BOUNDS. * target.def (builtin_chkp_function): New. (chkp_bound_type): New. (chkp_bound_mode): New. (chkp_make_bounds_constant): New. (chkp_initialize_bounds): New. (load_bounds_for_arg): New. (store_bounds_for_arg): New. (load_returned_bounds): New. (store_returned_bounds): New. (chkp_function_value_bounds): New. (setup_incoming_vararg_bounds): New. (function_arg): Update hook description with new possible return value CONST_INT. * targhooks.h (default_load_bounds_for_arg): New. (default_store_bounds_for_arg): New. (default_load_returned_bounds): New. (default_store_returned_bounds): New. (default_chkp_bound_type): New. (default_chkp_bound_mode): New. (default_builtin_chkp_function): New. (default_chkp_function_value_bounds): New. (default_chkp_make_bounds_constant): New. (default_chkp_initialize_bounds): New. (default_setup_incoming_vararg_bounds): New. * targhooks.c (default_load_bounds_for_arg): New. (default_store_bounds_for_arg): New. (default_load_returned_bounds): New. (default_store_returned_bounds): New. (default_chkp_bound_type): New. (default_chkp_bound_mode); New. (default_builtin_chkp_function): New. (default_chkp_function_value_bounds): New. (default_chkp_make_bounds_constant): New. (default_chkp_initialize_bounds): New. (default_setup_incoming_vararg_bounds): New. * builtin-types.def (BT_BND): New. (BT_FN_PTR_CONST_PTR): New. (BT_FN_CONST_PTR_CONST_PTR): New. (BT_FN_BND_CONST_PTR): New. (BT_FN_CONST_PTR_BND): New. (BT_FN_PTR_CONST_PTR_SIZE): New. (BT_FN_PTR_CONST_PTR_CONST_PTR): New. (BT_FN_VOID_PTRPTR_CONST_PTR): New. (BT_FN_VOID_CONST_PTR_SIZE): New. (BT_FN_VOID_PTR_BND): New. (BT_FN_CONST_PTR_CONST_PTR_CONST_PTR): New. (BT_FN_BND_CONST_PTR_SIZE): New. (BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New. (BT_FN_VOID_CONST_PTR_BND_CONST_PTR): New. * chkp-builtins.def: New. * builtins.def: include chkp-builtins.def. (DEF_CHKP_BUILTIN): New. * builtins.c: Include tree-chkp.h and rtl-chkp.h. (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS, BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS, BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS, BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS, BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS, BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND, BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL, BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET, BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_NARROW, BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER. (std_expand_builtin_va_start): Init bounds for va_list. * cppbuiltin.c (define_builtin_macros_for_compilation_flags): Add __CHKP__ macro when Pointer Bounds Checker is on. * params.def (PARAM_CHKP_MAX_CTOR_SIZE): New. * passes.def (pass_ipa_chkp_versioning): New. (pass_early_local_passes): Renamed to pass_build_ssa_passes. (pass_fixup_cfg): Moved to pass_chkp_instrumentation_passes. (pass_chkp_instrumentation_passes): New. (pass_ipa_chkp_produce_thunks): New. (pass_local_optimization_passes): New. (pass_chkp_opt): New. * tree-pass.h (make_pass_ipa_chkp_versioning): New. (make_pass_ipa_chkp_produce_thunks): New. (make_pass_chkp): New. (make_pass_chkp_opt): New. (make_pass_early_local_passes): Renamed to ... (make_pass_build_ssa_passes): This. (make_pass_chkp_instrumentation_passes): New. (make_pass_local_optimization_passes): New. * passes.c (pass_manager::execute_early_local_passes): Execute early passes in three steps. (execute_all_early_local_passes): Renamed to ... (execute_build_ssa_passes): This. (pass_data_early_local_passes): Renamed to ... (pass_data_build_ssa_passes): This. (pass_early_local_passes): Renamed to ... (pass_build_ssa_passes): This. (pass_data_chkp_instrumentation_passes): New. (pass_chkp_instrumentation_passes): New. (pass_data_local_optimization_passes): New. (pass_local_optimization_passes): New. (make_pass_early_local_passes): Renamed to ... (make_pass_build_ssa_passes): This. (make_pass_chkp_instrumentation_passes): New. (make_pass_local_optimization_passes): New. * c-family/c.opt (fcheck-pointer-bounds): New. (fchkp-check-incomplete-type): New. (fchkp-zero-input-bounds-for-main): New. (fchkp-first-field-has-own-bounds): New. (fchkp-narrow-bounds): New. (fchkp-narrow-to-innermost-array): New. (fchkp-optimize): New. (fchkp-use-fast-string-functions): New. (fchkp-use-nochk-string-functions): New. (fchkp-use-static-bounds): New. (fchkp-use-static-const-bounds): New. (fchkp-treat-zero-dynamic-size-as-infinite): New. (fchkp-check-read): New. (fchkp-check-write): New. (fchkp-store-bounds): New. (fchkp-instrument-calls): New. (fchkp-instrument-marked-only): New. (Wchkp): New. * c-family/c-common.c (handle_bnd_variable_size_attribute): New. (handle_bnd_legacy): New. (handle_bnd_instrument): New. (c_common_attribute_table): Add bnd_variable_size, bnd_legacy and bnd_instrument. Fix documentation. (c_common_format_attribute_table): Likewsie. * toplev.c: include tree-chkp.h. (process_options): Check Pointer Bounds Checker is supported. (compile_file): Add chkp_finish_file call. * ipa-cp.c (initialize_node_lattices): Use cgraph_local_p to handle instrumentation clones properly. (propagate_constants_accross_call): Do not propagate through instrumentation thunks. * ipa-pure-const.c (propagate_pure_const): Support IPA_REF_CHKP. * ipa-inline.c (early_inliner): Check edge has summary allocated. * ipa-split.c: Include tree-chkp.h. (find_retbnd): New. (split_part_set_ssa_name_p): New. (consider_split): Do not split retbnd and retval producers. (insert_bndret_call_after): new. (split_function): Propagate Pointer Bounds Checker instrumentation marks and handle returned bounds. * tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode into bit field and add with_bounds field. * tree-ssa-sccvn.c (copy_reference_ops_from_call): Set with_bounds field for instrumented calls. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore CALL_WITH_BOUNDS_P flag for calls. * tree-ssa-ccp.c: Include tree-chkp.h. (insert_clobber_before_stack_restore): Handle BUILT_IN_CHKP_BNDRET calls. * tree-ssa-dce.c: Include tree-chkp.h. (propagate_necessity): For free call fed by alloc check bounds are also provided by the same alloc. (eliminate_unnecessary_stmts): Handle BUILT_IN_CHKP_BNDRET used by free calls. * tree-inline.c: Include tree-chkp.h. (declare_return_variable): Add arg holding returned bounds slot. Create and initialize returned bounds var. (remap_gimple_stmt): Handle returned bounds. Return sequence of statements instead of a single statement. (insert_init_stmt): Add declaration. (remap_gimple_seq): Adjust to new remap_gimple_stmt signature. (copy_bb): Adjust to changed return type of remap_gimple_stmt. Properly handle bounds in va_arg_pack and va_arg_pack_len. (expand_call_inline): Handle returned bounds. Add bounds copy for generated mem to mem assignments. * tree-inline.h (copy_body_data): Add fields retbnd and assign_stmts. * value-prof.c: Include tree-chkp.h. (gimple_ic): Support returned bounds. * ipa.c (cgraph_build_static_cdtor_1): Support contructors with "chkp ctor" and "bnd_legacy" attributes. (symtab_remove_unreachable_nodes): Keep initial values for pointer bounds to be used for checks eliminations. (process_references): Handle IPA_REF_CHKP. (walk_polymorphic_call_targets): Likewise. * ipa-visibility.c (cgraph_externally_visible_p): Mark instrumented 'main' as externally visible. (function_and_variable_visibility): Filter instrumentation thunks. * cgraph.h (cgraph_thunk_info): Add add_pointer_bounds_args field. (cgraph_node): Add instrumented_version, orig_decl and instrumentation_clone fields. (symtab_node::get_alias_target): Allow IPA_REF_CHKP reference. (varpool_node): Add need_bounds_init field. (cgraph_local_p): New. * cgraph.c: Include tree-chkp.h. (cgraph_node::remove): Fix instrumented_version of the referenced node if any. (cgraph_node::dump): Dump instrumentation_clone and instrumented_version fields. (cgraph_node::verify_node): Check correctness of IPA_REF_CHKP references and instrumentation thunks. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Keep all not instrumented instrumentation clones alive. (cgraph_redirect_edge_call_stmt_to_callee): Support returned bounds. * cgraphbuild.c (rebuild_cgraph_edges): Rebuild IPA_REF_CHKP reference. (cgraph_rebuild_references): Likewise. * cgraphunit.c: Include tree-chkp.h. (assemble_thunks_and_aliases): Skip thunks calling instrumneted function version. (varpool_finalize_decl): Register statically initialized decls in Pointer Bounds Checker. (walk_polymorphic_call_targets): Do not mark generated call to __builtin_unreachable as with_bounds. (output_weakrefs): If there are both instrumented and original versions, output only one of them. (cgraph_node::expand_thunk): Set with_bounds flag for created call statement. * ipa-ref.h (ipa_ref_use): Add IPA_REF_CHKP. (ipa_ref): increase size of use field. * symtab.c (ipa_ref_use_name): Add element for IPA_REF_CHKP. * varpool.c (dump_varpool_node): Dump need_bounds_init field. (ctor_for_folding): Do not fold constant bounds vars. * lto-streamer.h (LTO_minor_version): Change minor version from 0 to 1. * lto-cgraph.c (compute_ltrans_boundary): Keep initial values for pointer bounds. (lto_output_node): Output instrumentation_clone, thunk.add_pointer_bounds_args and orig_decl field. (lto_output_ref): Adjust to new ipa_ref::use field size. (input_overwrite_node): Read instrumentation_clone field. (input_node): Read thunk.add_pointer_bounds_args and orig_decl fields. (input_ref): Adjust to new ipa_ref::use field size. (input_cgraph_1): Compute instrumented_version fields and restore IDENTIFIER_TRANSPARENT_ALIAS chains. (lto_output_varpool_node): Output need_bounds_init value. (input_varpool_node): Read need_bounds_init value. * lto-partition.c (add_symbol_to_partition_1): Keep original and instrumented versions together. (privatize_symbol_name): Restore transparent alias chain if required. (add_references_to_partition): Add references to pointer bounds vars. * dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE. * dwarf2out.c (gen_subprogram_die): Ignore bound args. (gen_type_die_with_usage): Skip pointer bounds. (dwarf2out_global_decl): Likewise. (is_base_type): Support POINTER_BOUNDS_TYPE. (gen_formal_types_die): Skip pointer bounds. (gen_decl_die): Likewise. * var-tracking.c (vt_add_function_parameters): Skip bounds parameters. * ipa-icf.c (sem_function::merge): Do not merge when instrumentation thunk still exists. (sem_variable::merge): Reset need_bounds_init flag. * doc/extend.texi: Document Pointer Bounds Checker built-in functions and attributes. * doc/tm.texi.in (TARGET_LOAD_BOUNDS_FOR_ARG): New. (TARGET_STORE_BOUNDS_FOR_ARG): New. (TARGET_LOAD_RETURNED_BOUNDS): New. (TARGET_STORE_RETURNED_BOUNDS): New. (TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New. (TARGET_SETUP_INCOMING_VARARG_BOUNDS): New. (TARGET_BUILTIN_CHKP_FUNCTION): New. (TARGET_CHKP_BOUND_TYPE): New. (TARGET_CHKP_BOUND_MODE): New. (TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New. (TARGET_CHKP_INITIALIZE_BOUNDS): New. * doc/tm.texi: Regenerated. * doc/rtl.texi (MODE_POINTER_BOUNDS): New. (BND32mode): New. (BND64mode): New. * doc/invoke.texi (-mmpx): New. (-mno-mpx): New. (chkp-max-ctor-size): New. * config/i386/constraints.md (w): New. (Ti): New. (Tb): New. * config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__. * config/i386/i386-modes.def (BND32): New. (BND64): New. * config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New. * config/i386/i386.c: Include tree-chkp.h, rtl-chkp.h, tree-iterator.h. (regclass_map): Add bound registers. (dbx_register_map): Likewise. (dbx64_register_map): Likewise. (svr4_dbx_register_map): Likewise. (isa_opts): Add -mmpx. (PTA_MPX): New. (ix86_option_override_internal): Support MPX ISA. (ix86_conditional_register_usage): Support bound registers. (ix86_code_end): Add MPX bnd prefix. (output_set_got): Likewise. (print_reg): Avoid prefixes for bound registers. (ix86_print_operand): Add '!' (MPX bnd) print prefix support. (ix86_print_operand_punct_valid_p): Likewise. (ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and UNSPEC_BNDLDX_ADDR. (ix86_output_call_insn): Add MPX bnd prefix to branch instructions. (ix86_class_likely_spilled_p): Add bound regs support. (ix86_hard_regno_mode_ok): Likewise. (x86_order_regs_for_local_alloc): Likewise. (ix86_bnd_prefixed_insn_p): New. (ix86_builtins): Add IX86_BUILTIN_BNDMK, IX86_BUILTIN_BNDSTX, IX86_BUILTIN_BNDLDX, IX86_BUILTIN_BNDCL, IX86_BUILTIN_BNDCU, IX86_BUILTIN_BNDRET, IX86_BUILTIN_BNDNARROW, IX86_BUILTIN_BNDINT, IX86_BUILTIN_SIZEOF, IX86_BUILTIN_BNDLOWER, IX86_BUILTIN_BNDUPPER. (builtin_isa): Add leaf_p and nothrow_p fields. (def_builtin): Initialize leaf_p and nothrow_p. (ix86_add_new_builtins): Handle leaf_p and nothrow_p flags. (bdesc_mpx): New. (bdesc_mpx_const): New. (ix86_init_mpx_builtins): New. (ix86_init_builtins): Call ix86_init_mpx_builtins. (ix86_emit_cmove): New. (ix86_emit_move_max): New. (ix86_expand_builtin): Expand IX86_BUILTIN_BNDMK, IX86_BUILTIN_BNDSTX, IX86_BUILTIN_BNDLDX, IX86_BUILTIN_BNDCL, IX86_BUILTIN_BNDCU, IX86_BUILTIN_BNDRET, IX86_BUILTIN_BNDNARROW, IX86_BUILTIN_BNDINT, IX86_BUILTIN_SIZEOF, IX86_BUILTIN_BNDLOWER, IX86_BUILTIN_BNDUPPER. (ix86_function_value_bounds): New. (ix86_builtin_mpx_function): New. (ix86_get_arg_address_for_bt): New. (ix86_load_bounds): New. (ix86_store_bounds): New. (ix86_load_returned_bounds): New. (ix86_store_returned_bounds): New. (ix86_mpx_bound_mode): New. (ix86_make_bounds_constant): New. (ix86_initialize_bounds): (TARGET_LOAD_BOUNDS_FOR_ARG): New. (TARGET_STORE_BOUNDS_FOR_ARG): New. (TARGET_LOAD_RETURNED_BOUNDS): New. (TARGET_STORE_RETURNED_BOUNDS): New. (TARGET_CHKP_BOUND_MODE): New. (TARGET_BUILTIN_CHKP_FUNCTION): New. (TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New. (TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New. (TARGET_CHKP_INITIALIZE_BOUNDS): New. (ix86_option_override_internal): Do not support x32 with MPX. (init_cumulative_args): Init stdarg, bnd_regno, bnds_in_bt and force_bnd_pass. (function_arg_advance_32): Return number of used integer registers. (function_arg_advance_64): Likewise. (function_arg_advance_ms_64): Likewise. (ix86_function_arg_advance): Handle pointer bounds. (ix86_function_arg): Likewise. (ix86_function_value_regno_p): Mark fisrt bounds registers as possible function value. (ix86_function_value_1): Handle pointer bounds type/mode (ix86_return_in_memory): Likewise. (ix86_print_operand): Analyse insn to decide abounf "bnd" prefix. (ix86_expand_call): Generate returned bounds. (ix86_setup_incoming_vararg_bounds): New. (ix86_va_start): Initialize bounds for pointers in va_list. (TARGET_SETUP_INCOMING_VARARG_BOUNDS): New. * config/i386/i386.h (TARGET_MPX): New. (TARGET_MPX_P): New. (FIRST_PSEUDO_REGISTER): Fix to new value. (FIXED_REGISTERS): Add bound registers. (CALL_USED_REGISTERS): Likewise. (REG_ALLOC_ORDER): Likewise. (HARD_REGNO_NREGS): Likewise. (VALID_BND_REG_MODE): New. (FIRST_BND_REG): New. (LAST_BND_REG): New. (reg_class): Add BND_REGS. (REG_CLASS_NAMES): Likewise. (REG_CLASS_CONTENTS): Likewise. (BND_REGNO_P): New. (ANY_BND_REG_P): New. (BNDmode): New. (HI_REGISTER_NAMES): Add bound registers. (ix86_args): Add bnd_regno, bnds_in_bt, force_bnd_pass and stdarg fields. * config/i386/i386.md (UNSPEC_BNDMK): New. (UNSPEC_BNDMK_ADDR): New. (UNSPEC_BNDSTX): New. (UNSPEC_BNDLDX): New. (UNSPEC_BNDLDX_ADDR): New. (UNSPEC_BNDCL): New. (UNSPEC_BNDCU): New. (UNSPEC_BNDCN): New. (UNSPEC_MPX_FENCE): New. (UNSPEC_SIZEOF): New. (BND0_REG): New. (BND1_REG): New. (type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst. (length_immediate): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst. (prefix_rep): Check for bnd prefix. (prefix_0f): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst. (length_nobnd): New. (length): Use length_nobnd when specified. (memory): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst. (BND): New. (bnd_ptr): New. (BNDCHECK): New. (bndcheck): New. (*jcc_1): Add MPX bnd prefix. (*jcc_2): Likewise. (jump): Likewise. (*indirect_jump): Likewise. (*tablejump_1): Likewise. (simple_return_internal): Likewise. (simple_return_internal_long): Likewise. (simple_return_pop_internal): Likewise. (simple_return_indirect_internal): Likewise. (<mode>_mk): New. (*<mode>_mk): New. (mov<mode>): New. (*mov<mode>_internal_mpx): New. (<mode>_<bndcheck>): New. (*<mode>_<bndcheck>): New. (<mode>_ldx): New. (*<mode>_ldx): New. (<mode>_stx): New. (*<mode>_stx): New. move_size_reloc_<mode>): New. * config/i386/predicates.md (address_mpx_no_base_operand): New. (address_mpx_no_index_operand): New. (bnd_mem_operator): New. (symbol_operand): New. (x86_64_immediate_size_operand): New. * config/i386/i386.opt (mmpx): New. * config/i386/i386-builtin-types.def (BND): New. (ULONG): New. (BND_FTYPE_PCVOID_ULONG): New. (VOID_FTYPE_BND_PCVOID): New. (VOID_FTYPE_PCVOID_PCVOID_BND): New. (BND_FTYPE_PCVOID_PCVOID): New. (BND_FTYPE_PCVOID): New. (BND_FTYPE_BND_BND): New. (PVOID_FTYPE_PVOID_PVOID_ULONG): New. (PVOID_FTYPE_PCVOID_BND_ULONG): New. (ULONG_FTYPE_VOID): New. (PVOID_FTYPE_BND): New. gcc/testsuite/ 2014-11-05 Ilya Enkovich <ilya.enkovich@intel.com> * gcc.target/i386/chkp-builtins-1.c: New. * gcc.target/i386/chkp-builtins-2.c: New. * gcc.target/i386/chkp-builtins-3.c: New. * gcc.target/i386/chkp-builtins-4.c: New. * gcc.target/i386/chkp-remove-bndint-1.c: New. * gcc.target/i386/chkp-remove-bndint-2.c: New. * gcc.target/i386/chkp-const-check-1.c: New. * gcc.target/i386/chkp-const-check-2.c: New. * gcc.target/i386/chkp-lifetime-1.c: New. * gcc.dg/pr37858.c: Replace early_local_cleanups pass name with build_ssa_passes. From-SVN: r217125
2014-10-29decl.c, [...]: Remove redundant enum from machine_mode.Richard Sandiford
gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-14machmode.h (int_n_data_t): New.DJ Delorie
* machmode.h (int_n_data_t): New. (int_n_enabled_p): New. (int_n_data): New. * tree.c (int_n_enabled_p): New. (int_n_trees): New. (make_or_reuse_type): Check for all __intN types, not just __int128. (build_common_tree_nodes): Likewise. Also fill in integer_typs[] entries. * tree.h (int128_integer_type_node): Remove. (int128_unsigned_type_node): Remove. (int_n_trees_t): New. (int_n_enabled_p): New. (int_n_trees): New. * toplev.c (standard_type_bitsize): New. (do_compile): Check which __intN types are enabled for the current run. * builtin-types.def (BT_INT128): Remove. (BT_UINT128): Remove. * machmode.def: Add macro to create __int128 for all targets. * stor-layout.c (mode_for_size): Support __intN types. (smallest_mode_for_size): Likewise. (initialize_sizetypes): Support __intN types. * genmodes.c (struct mode_data): Add int_n field. (blank_mode): Likewise. (INT_N): New. (make_int_n): New. (emit_insn_modes_h): Count __intN entries and define NUM_INT_N_ENTS. (emit_mode_int_n): New. (emit_insn_modes_c): Call it. * gimple.c (gimple_signed_or_unsigned_type): Check for all __intN types, not just __int128. * tree-core.h (integer_type_kind): Remove __int128-specific entries, reserve spots for __intN entries. libstdc++-v3/ * src/c++11/limits.cc: Add support for __intN types. * include/std/type_traits: Likewise. * include/std/limits: Likewise. * include/c_std/cstdlib: Likewise. * include/bits/cpp_type_traits.h: Likewise. * include/c_global/cstdlib: Likewise. c-family/ * c-pretty-print.c (pp_c_integer_constant): Check for all __intN types, not just __int128. * c-cppbuiltin.c (c_cpp_builtins): Add builtins for all __intN types, not just __int128. (cpp_atomic_builtins): Round pointer sizes up. (type_suffix): Use type precision, not specific types. * c-common.c (c_common_reswords): Remove __int128 special case. (c_common_type_for_size): Check for all __intN types, not just __int128. (c_common_type_for_mode): Likewise. (c_common_signed_or_unsigned_type): Likewise. (c_build_bitfield_integer_type): Likewise. (c_common_nodes_and_builtins): Likewise. (keyword_begins_type_specifier): Likewise. * c-common.h (rid): Remove RID_INT128 and add RID_INT_N_* for all __intN variants. c/ * c-parser.c (c_parse_init): Add RID entries for each __intN. (c_token_starts_typename): Check all __intN, not just __int128. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_attribute_any_word): Likewise. (c_parser_objc_selector): Likewise. * c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n. (struct c_declspecs): Add int_n_idx field to record *which* __intN is specified. * c-decl.c (declspecs_add_type): Check for all __intN, not just __int128. (finish_declspecs): Likewise. testsuite/ * g++.dg/abi/mangle64.C: New. cp/ * typeck.c (cp_common_type): Check for all __intN types, not just __int128. * decl.c (grokdeclarator): Likewise. * rtti.c (emit_support_tinfos): Check for all __intN types, not just __int128. * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check for all __intN types, not just __int128. (cp_parser_simple_type_specifier): Likewise. * mangle.c (integer_type_codes): Remove int128-specific codes. * cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which __intN was specified. * lex.c (init_reswords): Reserve all __intN keywords. lto/ * lto-lang.c (lto_build_c_type_nodes): Check intN types for size-type as well. (lto_init): Initialize all intN types, not just int128. From-SVN: r216220
2014-09-12Remove LIBGCC2_HAS_?F_MODE target macros.Joseph Myers
This patch removes the LIBGCC2_HAS_{SF,DF,XF,TF}_MODE target macros, replacing them by predefines with -fbuilding-libgcc, together with a target hook that can influence those predefines when needed. The new default is that a floating-point mode is supported in libgcc if (a) it passes the scalar_mode_supported_p hook (otherwise it's not plausible for it to be supported in libgcc) and (b) it's one of those four modes (since those are the modes for which libgcc hardcodes the possibility of support). The target hook can override the default choice (in either direction) for modes that pass scalar_mode_supported_p (although overriding in the direction of returning true when the default would return false only makes sense if all relevant functions are specially defined in libgcc for that particular target). The previous default settings depended on various settings such as LIBGCC2_LONG_DOUBLE_TYPE_SIZE, as well as targets defining the above target macros if the default wasn't correct. The default scalar_mode_supported_p only declares a floating-point mode to be supported if it matches one of float / double / long double. This means that in most cases where a mode is only supported conditionally in libgcc (TFmode only supported if it's the mode of long double, most commonly), the default gets things right. Overrides were needed in the following cases: * SFmode would always have been supported in libgcc (the condition was BITS_PER_UNIT == 8, true for all current targets), but pdp11 defaults to 64-bit float, and in that case SFmode would fail scalar_mode_supported_p. I don't know if libgcc actually built for pdp11 (and the port may well no longer be being used), but this patch adds a scalar_mode_supported_p hook to it to ensure SFmode is treated as supported. * Certain i386 and ia64 targets need the new hook to match the existing cases for when XFmode or TFmode support is present in libgcc. For i386, the hook can always declare XFmode to be supported - the cases where it's not are the cases where long double is TFmode, in which case XFmode fails scalar_mode_supported_p[*] - but TFmode support needs to be conditional. (And of the targets not defining LIBGCC2_HAS_TF_MODE before this patch, some defined LONG_DOUBLE_TYPE_SIZE to 64, so ensuring LIBGCC2_HAS_TF_MODE would always be false, while others did not define it, so allowing it to be true in the -mlong-double-128 case. This patch matches that logic, although I suspect all the latter targets would have been broken if you tried to enable -mlong-double-128 by default, for lack of the soft-fp TFmode support in libgcc, which is separately configured.) [*] I don't know if it's deliberate not to support __float80 at all with -mlong-double-128. In order to implement the default version of the new hook, insn-modes.h was made to contain macros such as HAVE_TFmode for each machine mode, so the default hook can contain conditionals on whether XFmode and TFmode exist (to match the hardcoding of a list of modes in libgcc). This is also used in fortran/trans-types.c; previously it had a conditional on defined(LIBGCC2_HAS_TF_MODE) (a bit dubious, since it ignored the value of the macro), which is replaced by testing defined(HAVE_TFmode), in conjunction with requiring targetm.libgcc_floating_mode_supported_p. (Fortran is testing something stronger than that hook: not only is libgcc support required, but also libm or equivalent. Thus, it has a test for ENABLE_LIBQUADMATH_SUPPORT in the case that the mode is TFmode and that's not the same as any of the three standard types. The old and new tests are intended to accept exactly the same set of modes for all targets.) Apart from the four target macros eliminated by this patch, it gets us closer to eliminating LIBGCC2_LONG_DOUBLE_TYPE_SIZE as well, though a few more places using that macro need changing first. Bootstrapped with no regressions on x86_64-unknown-linux-gnu; also built cc1 for crosses to ia64-elf and pdp11-none as a minimal test of changes for those targets. gcc: * target.def (libgcc_floating_mode_supported_p): New hook. * targhooks.c (default_libgcc_floating_mode_supported_p): New function. * targhooks.h (default_libgcc_floating_mode_supported_p): Declare. * doc/tm.texi.in (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_XF_MODE) (LIBGCC2_HAS_TF_MODE): Remove. (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): New @hook. * doc/tm.texi: Regenerate. * genmodes.c (emit_insn_modes_h): Define HAVE_%smode for each machine mode. * system.h (LIBGCC2_HAS_SF_MODE, LIBGCC2_HAS_DF_MODE) (LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE): Poison. * config/i386/cygming.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/darwin.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/djgpp.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/dragonfly.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/freebsd.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/gnu-user-common.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/i386-interix.h (IX86_NO_LIBGCC_TFMODE): Define. * config/i386/i386.c (ix86_libgcc_floating_mode_supported_p): New function. (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Define. * config/i386/i386elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/lynx.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/netbsd-elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/netbsd64.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/nto.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/openbsd.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/openbsdelf.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/rtemself.h (IX86_NO_LIBGCC_TFMODE): Define. * config/i386/sol2.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/vx-common.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/ia64/elf.h (IA64_NO_LIBGCC_TFMODE): Define. * config/ia64/freebsd.h (IA64_NO_LIBGCC_TFMODE): Define. * config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE): Remove. * config/ia64/ia64.c (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): New macro. (ia64_libgcc_floating_mode_supported_p): New function. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): Remove. * config/ia64/vms.h (IA64_NO_LIBGCC_XFMODE) (IA64_NO_LIBGCC_TFMODE): Define. * config/msp430/msp430.h (LIBGCC2_HAS_DF_MODE): Remove. * config/pdp11/pdp11.c (TARGET_SCALAR_MODE_SUPPORTED_P): New macro. (pdp11_scalar_mode_supported_p): New function. * config/rl78/rl78.h (LIBGCC2_HAS_DF_MODE): Remove. * config/rx/rx.h (LIBGCC2_HAS_DF_MODE): Remove. gcc/c-family: * c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_HAS_%s_MODE__ macros for floating-point modes. gcc/fortran: * trans-types.c (gfc_init_kinds): Check targetm.libgcc_floating_mode_supported_p for floating-point modes. Check HAVE_TFmode instead of LIBGCC2_HAS_TF_MODE. libgcc: * libgcc2.h (LIBGCC2_HAS_SF_MODE): Define using __LIBGCC_HAS_SF_MODE__. (LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__. (LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__. (LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__. * config/libbid/bid_gcc_intrinsics.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define. (LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__. (LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__. * fixed-bit.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define. (LIBGCC2_HAS_SF_MODE): Define using __LIBGCC_HAS_SF_MODE__. (LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__. From-SVN: r215215
2014-04-17genmodes.c (struct mode_data): Add need_bytesize_adj field.Jakub Jelinek
* genmodes.c (struct mode_data): Add need_bytesize_adj field. (blank_mode): Initialize it. (emit_mode_size_inline, emit_mode_nunits_inline, emit_mode_inner_inline): New functions. (emit_insn_modes_h): Call them and surround their output with #if GCC_VERSION >= 4001 ... #endif. * machmode.h (GET_MODE_SIZE, GET_MODE_NUNITS, GET_MODE_INNER): For GCC_VERSION >= 4001 use mode_*_inline routines instead of mode_* arrays if the argument is __builtin_constant_p. * lower-subreg.c (dump_choices): Make sure GET_MODE_SIZE argument is enum machine_mode. fortran/ * trans-types.c (gfc_init_kinds): Make sure GET_MODE_BITSIZE argument is enum machine_mode. From-SVN: r209484
2014-01-02Update copyright years in gcc/Richard Sandiford
From-SVN: r206289
2013-12-13genmodes.c (emit_max_int): Fixed missing parens.Kenneth Zadeck
2013-12-13 Kenneth Zadeck <zadeck@naturalbridge.com> * genmodes.c (emit_max_int): Fixed missing parens. From-SVN: r205970
2013-12-13arc.h (BITS_PER_UNIT): Removed.Kenneth Zadeck
2013-12-13 Kenneth Zadeck <zadeck@naturalbridge.com> * config/arc/arc.h (BITS_PER_UNIT): Removed. * config/bfin/bfin.h (BITS_PER_UNIT): Removed. * config/lm32/lm32.h (BITS_PER_UNIT): Removed. * config/m32c/m32c.h (BITS_PER_UNIT): Removed. * config/microblaze/microblaze.h (BITS_PER_UNIT): Removed. * config/picochip/picochip.h (BITS_PER_UNIT): Removed. * config/spu/spu.h (BITS_PER_UNIT): Removed. * defaults.h (BITS_PER_UNIT): Removed. * config/i386/i386-modes.def (MAX_BITSIZE_MODE_ANY_INT): New. * doc/rtl (BITS_PER_UNIT): Moved from tm.texi. (MAX_BITSIZE_MODE_ANY_INT): Updated. * doc/tm.texi (BITS_PER_UNIT): Removed. * doc/tm.texi.in (BITS_PER_UNIT): Removed. * genmodes.c (bits_per_unit, max_bitsize_mode_any_int): New. (create_modes): Added code to set bits_per_unit and max_bitsize_mode_any_int. (emit_max_int): Changed code generation. * mkconfig.sh: Added insn-modes.h. From-SVN: r205964
2013-11-29revert: cgraph.h (varpool_node): Add need_bounds_init field.Ilya Enkovich
Reverted: 2013-11-20 Ilya Enkovich <ilya.enkovich@intel.com> * cgraph.h (varpool_node): Add need_bounds_init field. * lto-cgraph.c (lto_output_varpool_node): Output need_bounds_init value. (input_varpool_node): Read need_bounds_init value. * varpool.c (dump_varpool_node): Dump need_bounds_init field. Reverted: 2013-11-20 Ilya Enkovich <ilya.enkovich@intel.com> * dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE. * dwarf2out.c (gen_subprogram_die): Ignore bound args. (gen_type_die_with_usage): Skip pointer bounds. (dwarf2out_global_decl): Likewise. Reverted: 2013-11-18 Ilya Enkovich <ilya.enkovich@intel.com> * builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New. * chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New. * cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS. * gimple.c (gimple_call_get_nobnd_arg_index): Remove. * gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS. (gimple_call_with_bounds_p): New. (gimple_call_set_with_bounds): New. (gimple_call_num_nobnd_args): Remove. (gimple_call_nobnd_arg): Remove. * tree.h (CALL_WITH_BOUNDS_P): New. * rtl.h (CALL_EXPR_WITH_BOUNDS_P): New. Reverted: 2013-11-08 Ilya Enkovich <ilya.enkovich@intel.com> * common.opt (fcheck-pointer-bounds): Move to ... * c-family/c.opt: ... here. * langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): Remove. (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_CHKP_SUPPORTED. * langhooks.h (lang_hooks): Remove chkp_supported field. * toplev.c (process_options): Remove chkp_supported check. Reverted: 2013-10-30 Ilya Enkovich <ilya.enkovich@intel.com> * tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE. * tree.h (POINTER_BOUNDS_P): New. (BOUNDED_TYPE_P): New. (BOUNDED_P): New. (pointer_bounds_type_node): New. * tree.c (build_common_tree_nodes): Initialize pointer_bounds_type_node. * gimple.h (gimple_call_get_nobnd_arg_index): New. (gimple_call_num_nobnd_args): New. (gimple_call_nobnd_arg): New. (gimple_return_retbnd): New. (gimple_return_set_retbnd): New * gimple.c (gimple_build_return): Increase number of ops for return statement. (gimple_call_get_nobnd_arg_index): New. * gimple-pretty-print.c (dump_gimple_return): Print second op. Reverted: 2013-10-30 Ilya Enkovich <ilya.enkovich@intel.com> * ipa.c (cgraph_build_static_cdtor_1): Support contructors with "chkp ctor" and "bnd_legacy" attributes. * gimplify.c (gimplify_init_constructor): Avoid infinite loop during gimplification of bounds initializer. Reverted: 2013-10-30 Ilya Enkovich <ilya.enkovich@intel.com> * c-family/c-common.c (handle_bnd_variable_size_attribute): New. (handle_bnd_legacy): New. (c_common_attribute_table): Add bnd_variable_size and bnd_legacy. * doc/extend.texi: Document bnd_variable_size and bnd_legacy attributes. Reverted: 2013-10-29 Ilya Enkovich <ilya.enkovich@intel.com> * builtin-types.def (BT_FN_VOID_CONST_PTR): New. (BT_FN_PTR_CONST_PTR): New. (BT_FN_CONST_PTR_CONST_PTR): New. (BT_FN_PTR_CONST_PTR_SIZE): New. (BT_FN_PTR_CONST_PTR_CONST_PTR): New. (BT_FN_VOID_PTRPTR_CONST_PTR): New. (BT_FN_VOID_CONST_PTR_SIZE): New. (BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New. * chkp-builtins.def: New. * builtins.def: include chkp-builtins.def. (DEF_CHKP_BUILTIN): New. * builtins.c (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS, BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS, BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS, BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS, BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS, BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND, BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL, BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET, BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_ARG_BND, BUILT_IN_CHKP_NARROW, BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER. * common.opt (fcheck-pointer-bounds): New. * toplev.c (process_options): Check Pointer Bounds Checker is supported. * doc/extend.texi: Document Pointer Bounds Checker built-in functions. Reverted: 2013-10-30 Ilya Enkovich <ilya.enkovich@intel.com> * target.def (builtin_chkp_function): New. (chkp_bound_type): New. (chkp_bound_mode): New. (fn_abi_va_list_bounds_size): New. (load_bounds_for_arg): New. (store_bounds_for_arg): New. * targhooks.h (default_load_bounds_for_arg): New. (default_store_bounds_for_arg): New. (default_fn_abi_va_list_bounds_size): New. (default_chkp_bound_type): New. (default_chkp_bound_mode): New. (default_builtin_chkp_function): New. * targhooks.c (default_load_bounds_for_arg): New. (default_store_bounds_for_arg): New. (default_fn_abi_va_list_bounds_size): New. (default_chkp_bound_type): New. (default_chkp_bound_mode); New. (default_builtin_chkp_function): New. * doc/tm.texi.in (TARGET_FN_ABI_VA_LIST_BOUNDS_SIZE): New. (TARGET_LOAD_BOUNDS_FOR_ARG): New. (TARGET_STORE_BOUNDS_FOR_ARG): New. (TARGET_BUILTIN_CHKP_FUNCTION): New. (TARGET_CHKP_BOUND_TYPE): New. (TARGET_CHKP_BOUND_MODE): New. * doc/tm.texi: Regenerated. * langhooks.h (lang_hooks): Add chkp_supported field. * langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): New. (LANG_HOOKS_INITIALIZER); Add LANG_HOOKS_CHKP_SUPPORTED. Reverted: 2013-10-24 Ilya Enkovich <ilya.enkovich@intel.com> * config/i386/constraints.md (B): New. (Ti): New. (Tb): New. * config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__. * config/i386/i386-modes.def (BND32): New. (BND64): New. * config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New. * config/i386/i386.c (isa_opts): Add mmpx. (regclass_map): Add bound registers. (dbx_register_map): Likewise. (dbx64_register_map): Likewise. (svr4_dbx_register_map): Likewise. (PTA_MPX): New. (ix86_option_override_internal): Support MPX ISA. (ix86_conditional_register_usage): Support bound registers. (print_reg): Likewise. (ix86_code_end): Add MPX bnd prefix. (output_set_got): Likewise. (ix86_output_call_insn): Likewise. (ix86_print_operand): Add '!' (MPX bnd) print prefix support. (ix86_print_operand_punct_valid_p): Likewise. (ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and UNSPEC_BNDMK_ADDR. (ix86_class_likely_spilled_p): Add bound regs support. (ix86_hard_regno_mode_ok): Likewise. (x86_order_regs_for_local_alloc): Likewise. (ix86_bnd_prefixed_insn_p): New. * config/i386/i386.h (FIRST_PSEUDO_REGISTER): Fix to new value. (FIXED_REGISTERS): Add bound registers. (CALL_USED_REGISTERS): Likewise. (REG_ALLOC_ORDER): Likewise. (HARD_REGNO_NREGS): Likewise. (TARGET_MPX): New. (VALID_BND_REG_MODE): New. (FIRST_BND_REG): New. (LAST_BND_REG): New. (reg_class): Add BND_REGS. (REG_CLASS_NAMES): Likewise. (REG_CLASS_CONTENTS): Likewise. (BND_REGNO_P): New. (ANY_BND_REG_P): New. (BNDmode): New. (HI_REGISTER_NAMES): Add bound registers. * config/i386/i386.md (UNSPEC_BNDMK): New. (UNSPEC_BNDMK_ADDR): New. (UNSPEC_BNDSTX): New. (UNSPEC_BNDLDX): New. (UNSPEC_BNDLDX_ADDR): New. (UNSPEC_BNDCL): New. (UNSPEC_BNDCU): New. (UNSPEC_BNDCN): New. (UNSPEC_MPX_FENCE): New. (BND0_REG): New. (BND1_REG): New. (type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst. (length_immediate): Likewise. (prefix_0f): Likewise. (memory): Likewise. (prefix_rep): Check for bnd prefix. (length_nobnd): New. (length): Use length_nobnd if specified. (BND): New. (bnd_ptr): New. (BNDCHECK): New. (bndcheck): New. (*jcc_1): Add bnd prefix and rename length attr to length_nobnd. (*jcc_2): Likewise. (jump): Likewise. (simple_return_internal): Likewise. (simple_return_pop_internal): Likewise. (*indirect_jump): Add MPX bnd prefix. (*tablejump_1): Likewise. (simple_return_internal_long): Likewise. (simple_return_indirect_internal): Likewise. (<mode>_mk): New. (*<mode>_mk): New. (mov<mode>): New. (*mov<mode>_internal_mpx): New. (<mode>_<bndcheck>): New. (*<mode>_<bndcheck>): New. (<mode>_ldx): New. (*<mode>_ldx): New. (<mode>_stx): New. (*<mode>_stx): New. * config/i386/predicates.md (lea_address_operand): Rename to... (address_no_seg_operand): ... this. (address_mpx_no_base_operand): New. (address_mpx_no_index_operand): New. (bnd_mem_operator): New. * config/i386/i386.opt (mmpx): New. * doc/invoke.texi: Add documentation for the flags -mmpx, -mno-mpx. * doc/rtl.texi Add documentation for BND32mode and BND64mode. Reverted: 2013-10-24 Ilya Enkovich <ilya.enkovich@intel.com> * mode-classes.def (MODE_POINTER_BOUNDS): New. * tree.def (POINTER_BOUNDS_TYPE): New. * genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS. (POINTER_BOUNDS_MODE): New. (make_pointer_bounds_mode): New. * machmode.h (POINTER_BOUNDS_MODE_P): New. * stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS. (layout_type): Support POINTER_BOUNDS_TYPE. * tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE. * tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE. (type_contains_placeholder_1): Likewise. * tree.h (POINTER_BOUNDS_TYPE_P): New. * varasm.c (output_constant): Support POINTER_BOUNDS_TYPE. * doc/rtl.texi (MODE_POINTER_BOUNDS): New. From-SVN: r205522
2013-10-30machmode.def (PARTIAL_INT_MODE): Add precision and name.Mike Stump
* machmode.def (PARTIAL_INT_MODE): Add precision and name. * genmodes.c (PARTIAL_INT_MODE): Add precision and name. (make_vector_mode): Increase namebuf to 16. (emit_insn_modes_h): When processing BImode, don't also match partial int modes. (emit_class_narrowest_mode): Likewise. * config/bfin/bfin-modes.def: Add precision to PDI. * config/m32c/m32c-modes.def: Add precision to PSI. * config/msp430/msp430-modes.def: Add precision to PSI. * config/rs6000/rs6000-modes.def: Add precision to PTI. * config/sh/sh-modes.def: Add precision to PSI and PDI. From-SVN: r204193
2013-10-25mode-classes.def (MODE_POINTER_BOUNDS): New.Ilya Enkovich
* mode-classes.def (MODE_POINTER_BOUNDS): New. * tree.def (POINTER_BOUNDS_TYPE): New. * genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS. (POINTER_BOUNDS_MODE): New. (make_pointer_bounds_mode): New. * machmode.h (POINTER_BOUNDS_MODE_P): New. * stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS. (layout_type): Support POINTER_BOUNDS_TYPE. * tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE. * tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE. (type_contains_placeholder_1): Likewise. * tree.h (POINTER_BOUNDS_TYPE_P): New. * varasm.c (output_constant): Support POINTER_BOUNDS_TYPE. * doc/rtl.texi (MODE_POINTER_BOUNDS): New. From-SVN: r204045
2013-09-28alloc-pool.c, [...]: Add missing whitespace before "(".Richard Sandiford
gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004