Remove MPX
2018-06-08 Martin Liska <mliska@suse.cz> * MAINTAINERS: Remove MPX-related entries. * Makefile.def: Remove libmpx support. * Makefile.in: Likewise. * configure: Remove removed files. * configure.ac: Likewise. * libmpx/ChangeLog: Remove. * libmpx/Makefile.am: Remove. * libmpx/Makefile.in: Remove. * libmpx/acinclude.m4: Remove. * libmpx/aclocal.m4: Remove. * libmpx/config.h.in: Remove. * libmpx/configure: Remove. * libmpx/configure.ac: Remove. * libmpx/configure.tgt: Remove. * libmpx/libmpx.spec.in: Remove. * libmpx/mpxrt/Makefile.am: Remove. * libmpx/mpxrt/Makefile.in: Remove. * libmpx/mpxrt/libmpx.map: Remove. * libmpx/mpxrt/libtool-version: Remove. * libmpx/mpxrt/mpxrt-utils.c: Remove. * libmpx/mpxrt/mpxrt-utils.h: Remove. * libmpx/mpxrt/mpxrt.c: Remove. * libmpx/mpxrt/mpxrt.h: Remove. * libmpx/mpxwrap/Makefile.am: Remove. * libmpx/mpxwrap/Makefile.in: Remove. * libmpx/mpxwrap/libmpxwrappers.map: Remove. * libmpx/mpxwrap/libtool-version: Remove. * libmpx/mpxwrap/mpx_wrappers.c: Remove. 2018-06-08 Martin Liska <mliska@suse.cz> * bootstrap-mpx.mk: Remove. 2018-06-08 Martin Liska <mliska@suse.cz> * Makefile.in: Remove support for MPX (macros, related functions, fields in cgraph_node, ...). * builtin-types.def (BT_BND): Likewise. (BT_FN_BND_CONST_PTR): Likewise. (BT_FN_CONST_PTR_BND): Likewise. (BT_FN_VOID_PTR_BND): Likewise. (BT_FN_BND_CONST_PTR_SIZE): Likewise. (BT_FN_VOID_CONST_PTR_BND_CONST_PTR): Likewise. * builtins.c (expand_builtin_memcpy_with_bounds): Likewise. (expand_builtin_mempcpy_with_bounds): Likewise. (expand_builtin_memset_with_bounds): Likewise. (expand_builtin_memset_args): Likewise. (std_expand_builtin_va_start): Likewise. (expand_builtin): Likewise. (expand_builtin_with_bounds): Likewise. * builtins.def (DEF_BUILTIN_CHKP): Likewise. (DEF_LIB_BUILTIN_CHKP): Likewise. (DEF_EXT_LIB_BUILTIN_CHKP): Likewise. (DEF_CHKP_BUILTIN): Likewise. (BUILT_IN_MEMCPY): Likewise. (BUILT_IN_MEMMOVE): Likewise. (BUILT_IN_MEMPCPY): Likewise. (BUILT_IN_MEMSET): Likewise. (BUILT_IN_STPCPY): Likewise. (BUILT_IN_STRCAT): Likewise. (BUILT_IN_STRCHR): Likewise. (BUILT_IN_STRCPY): Likewise. (BUILT_IN_STRLEN): Likewise. (BUILT_IN_MEMCPY_CHK): Likewise. (BUILT_IN_MEMMOVE_CHK): Likewise. (BUILT_IN_MEMPCPY_CHK): Likewise. (BUILT_IN_MEMSET_CHK): Likewise. (BUILT_IN_STPCPY_CHK): Likewise. (BUILT_IN_STRCAT_CHK): Likewise. (BUILT_IN_STRCPY_CHK): Likewise. * calls.c (store_bounds): Likewise. (emit_call_1): Likewise. (special_function_p): Likewise. (maybe_warn_nonstring_arg): Likewise. (initialize_argument_information): Likewise. (finalize_must_preallocate): Likewise. (compute_argument_addresses): Likewise. (expand_call): Likewise. * cfgexpand.c (expand_call_stmt): Likewise. (expand_return): Likewise. (expand_gimple_stmt_1): Likewise. (pass_expand::execute): Likewise. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise. (cgraph_node::remove): Likewise. (cgraph_node::dump): Likewise. (cgraph_node::verify_node): Likewise. * cgraph.h (chkp_function_instrumented_p): Likewise. (symtab_node::get_alias_target): Likewise. (cgraph_node::can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_local_p): Likewise. * cgraphbuild.c (cgraph_edge::rebuild_edges): Likewise. (cgraph_edge::rebuild_references): Likewise. * cgraphunit.c (varpool_node::finalize_decl): Likewise. (walk_polymorphic_call_targets): Likewise. (cgraph_node::expand_thunk): Likewise. (symbol_table::output_weakrefs): Likewise. * common/config/i386/i386-common.c (OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET): Likewise. (ix86_handle_option): Likewise. * config/i386/constraints.md: Likewise. * config/i386/i386-builtin-types.def (BND): Likewise. (VOID): Likewise. (PVOID): Likewise. (ULONG): Likewise. * config/i386/i386-builtin.def (BDESC_END): Likewise. (BDESC_FIRST): Likewise. (BDESC): Likewise. * config/i386/i386-c.c (ix86_target_macros_internal): Likewise. * config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): Likewise. * config/i386/i386.c (enum reg_class): Likewise. (ix86_target_string): Likewise. (ix86_option_override_internal): Likewise. (ix86_conditional_register_usage): Likewise. (ix86_valid_target_attribute_inner_p): Likewise. (ix86_set_indirect_branch_type): Likewise. (ix86_set_current_function): Likewise. (ix86_function_arg_regno_p): Likewise. (init_cumulative_args): Likewise. (ix86_function_arg_advance): Likewise. (ix86_function_arg): Likewise. (ix86_pass_by_reference): Likewise. (ix86_function_value_regno_p): Likewise. (ix86_function_value_1): Likewise. (ix86_function_value_bounds): Likewise. (ix86_return_in_memory): Likewise. (ix86_setup_incoming_vararg_bounds): Likewise. (ix86_va_start): Likewise. (indirect_thunk_need_prefix): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_expand_call): Likewise. (ix86_output_function_return): Likewise. (reg_encoded_number): Likewise. (BDESC_VERIFYS): Likewise. (ix86_init_mpx_builtins): Likewise. (ix86_init_builtins): Likewise. (ix86_emit_cmove): Likewise. (ix86_emit_move_max): Likewise. (ix86_expand_builtin): Likewise. (ix86_builtin_mpx_function): Likewise. (ix86_get_arg_address_for_bt): Likewise. (ix86_load_bounds): Likewise. (ix86_store_bounds): Likewise. (ix86_load_returned_bounds): Likewise. (ix86_store_returned_bounds): Likewise. (ix86_class_likely_spilled_p): Likewise. (ix86_hard_regno_mode_ok): Likewise. (x86_order_regs_for_local_alloc): Likewise. (ix86_mitigate_rop): Likewise. (ix86_bnd_prefixed_insn_p): Likewise. (ix86_mpx_bound_mode): Likewise. (ix86_make_bounds_constant): Likewise. (ix86_initialize_bounds): Likewise. (TARGET_LOAD_BOUNDS_FOR_ARG): Likewise. (TARGET_STORE_BOUNDS_FOR_ARG): Likewise. (TARGET_LOAD_RETURNED_BOUNDS): Likewise. (TARGET_STORE_RETURNED_BOUNDS): Likewise. (TARGET_CHKP_BOUND_MODE): Likewise. (TARGET_BUILTIN_CHKP_FUNCTION): Likewise. (TARGET_CHKP_FUNCTION_VALUE_BOUNDS): Likewise. (TARGET_CHKP_MAKE_BOUNDS_CONSTANT): Likewise. (TARGET_CHKP_INITIALIZE_BOUNDS): Likewise. * config/i386/i386.h (TARGET_MPX): Likewise. (TARGET_MPX_P): Likewise. (VALID_BND_REG_MODE): Likewise. (FIRST_BND_REG): Likewise. (LAST_BND_REG): Likewise. (enum reg_class): Likewise. (BND_REG_P): Likewise. (BND_REGNO_P): Likewise. (BNDmode): Likewise. (ADJUST_INSN_LENGTH): Likewise. * config/i386/i386.md: Likewise. * config/i386/i386.opt: Likewise. * config/i386/linux-common.h (LIBMPX_LIBS): Likewise. (defined): Likewise. (LINK_MPX): Likewise. (MPX_SPEC): Likewise. (LIBMPX_SPEC): Likewise. (LIBMPXWRAPPERS_SPEC): Likewise. (CHKP_SPEC): Likewise. * config/i386/predicates.md: Likewise. * dbxout.c (dbxout_type): Likewise. * doc/extend.texi: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * doc/tm.texi: Likewise. * doc/tm.texi.in: Likewise. * dwarf2out.c (is_base_type): Likewise. (gen_formal_types_die): Likewise. (gen_subprogram_die): Likewise. (gen_type_die_with_usage): Likewise. (gen_decl_die): Likewise. (dwarf2out_late_global_decl): Likewise. * expr.c (expand_assignment): Likewise. (emit_storent_insn): Likewise. (store_expr_with_bounds): Likewise. (store_expr): Likewise. (expand_expr_real_1): Likewise. * expr.h (store_expr_with_bounds): Likewise. * function.c (use_register_for_decl): Likewise. (struct bounds_parm_data): Likewise. (assign_parms_augmented_arg_list): Likewise. (assign_parm_find_entry_rtl): Likewise. (assign_parm_is_stack_parm): Likewise. (assign_parm_load_bounds): Likewise. (assign_bounds): Likewise. (assign_parms): Likewise. (expand_function_start): Likewise. * gcc.c (CHKP_SPEC): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op): Likewise. * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Likewise. (wrestrict_dom_walker::check_call): Likewise. * gimple.c (gimple_build_call_from_tree): Likewise. * gimple.h (enum gf_mask): Likewise. (gimple_call_with_bounds_p): Likewise. (gimple_call_set_with_bounds): Likewise. * gimplify.c (gimplify_init_constructor): Likewise. * ipa-cp.c (initialize_node_lattices): Likewise. (propagate_constants_across_call): Likewise. (find_more_scalar_values_for_callers_subset): Likewise. * ipa-hsa.c (process_hsa_functions): Likewise. * ipa-icf-gimple.c (func_checker::compare_gimple_call): Likewise. * ipa-icf.c (sem_function::merge): Likewise. * ipa-inline.c (early_inliner): Likewise. * ipa-pure-const.c (warn_function_noreturn): Likewise. (warn_function_cold): Likewise. (propagate_pure_const): Likewise. * ipa-ref.h (enum GTY): Likewise. * ipa-split.c (find_retbnd): Likewise. (consider_split): Likewise. (split_function): Likewise. * ipa-visibility.c (cgraph_externally_visible_p): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. (symbol_table::remove_unreachable_nodes): Likewise. (process_references): Likewise. (cgraph_build_static_cdtor_1): Likewise. * lto-cgraph.c (lto_output_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Likewise. (input_overwrite_node): Likewise. (input_node): Likewise. (input_cgraph_1): Likewise. * params.def (PARAM_CHKP_MAX_CTOR_SIZE): Likewise. * passes.c (pass_manager::execute_early_local_passes): Likewise. (class pass_chkp_instrumentation_passes): Likewise. (make_pass_chkp_instrumentation_passes): Likewise. * passes.def: Likewise. * rtl.h (struct GTY): Likewise. (CALL_EXPR_WITH_BOUNDS_P): Likewise. * stor-layout.c (layout_type): Likewise. * symtab.c: Likewise. * target.def: Likewise. * targhooks.c (default_chkp_bound_type): Likewise. (default_chkp_bound_mode): Likewise. (default_builtin_chkp_function): Likewise. (default_chkp_function_value_bounds): Likewise. (default_chkp_make_bounds_constant): Likewise. (default_chkp_initialize_bounds): Likewise. * targhooks.h (default_chkp_bound_type): Likewise. (default_chkp_bound_mode): Likewise. (default_builtin_chkp_function): Likewise. (default_chkp_function_value_bounds): Likewise. (default_chkp_make_bounds_constant): Likewise. (default_chkp_initialize_bounds): Likewise. * toplev.c (compile_file): Likewise. (process_options): Likewise. * tree-core.h (DEF_BUILTIN): Likewise. (DEF_BUILTIN_CHKP): Likewise. * tree-inline.c (declare_return_variable): Likewise. (remap_gimple_stmt): Likewise. (copy_bb): Likewise. (initialize_inlined_parameters): Likewise. (expand_call_inline): Likewise. * tree-pass.h (make_pass_ipa_chkp_versioning): Likewise. (make_pass_ipa_chkp_early_produce_thunks): Likewise. (make_pass_ipa_chkp_produce_thunks): Likewise. (make_pass_chkp): Likewise. (make_pass_chkp_opt): Likewise. (make_pass_chkp_instrumentation_passes): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise. * tree-ssa-dce.c (propagate_necessity): Likewise. (eliminate_unnecessary_stmts): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_call): Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c (get_string_length): Likewise. (valid_builtin_call): Likewise. (adjust_last_stmt): Likewise. (handle_builtin_strchr): Likewise. (handle_builtin_strcpy): Likewise. (handle_builtin_stxncpy): Likewise. (handle_builtin_memcpy): Likewise. (handle_builtin_strcat): Likewise. (strlen_check_and_optimize_stmt): Likewise. * tree-stdarg.c (expand_ifn_va_arg_1): Likewise. * tree-streamer-in.c: Likewise. * tree-streamer.c (record_common_node): Likewise. * tree.c (tree_code_size): Likewise. (wide_int_to_tree_1): Likewise. (type_contains_placeholder_1): Likewise. (build_common_tree_nodes): Likewise. * tree.def (POINTER_BOUNDS_TYPE): Likewise. * tree.h (POINTER_BOUNDS_TYPE_P): Likewise. (POINTER_BOUNDS_P): Likewise. (BOUNDED_TYPE_P): Likewise. (BOUNDED_P): Likewise. (CALL_WITH_BOUNDS_P): Likewise. (pointer_bounds_type_node): Likewise. * value-prof.c (gimple_ic): Likewise. * var-tracking.c (vt_add_function_parameters): Likewise. * varasm.c (make_decl_rtl): Likewise. (assemble_start_function): Likewise. (output_constant): Likewise. (maybe_assemble_visibility): Likewise. * varpool.c (ctor_for_folding): Likewise. * chkp-builtins.def: Remove. * ipa-chkp.c: Remove. * ipa-chkp.h: Remove. * rtl-chkp.c: Remove. * rtl-chkp.h: Remove. * tree-chkp-opt.c: Remove. * tree-chkp.c: Remove. * tree-chkp.h: Remove. 2018-06-08 Martin Liska <mliska@suse.cz> * c-attribs.c (handle_bnd_variable_size_attribute): Remove support for MPX (macros, related functions, fields in cgraph_node, ...). (handle_bnd_legacy): Likewise. (handle_bnd_instrument): Likewise. * c.opt: Likewise. 2018-06-08 Martin Liska <mliska@suse.cz> * lto-partition.c (add_references_to_partition): Remove support for MPX (macros, related functions, fields in cgraph_node, ...). (add_symbol_to_partition_1): Likewise. (privatize_symbol_name): Likewise. * lto-symtab.c (lto_cgraph_replace_node): Likewise. 2018-06-08 Martin Liska <mliska@suse.cz> * g++.dg/dg.exp: Do not use mpx.exp. * g++.dg/lto/lto.exp: Likewise. * g++.dg/lto/pr69729_0.C: Remove. * g++.dg/opt/pr71529.C: Remove. * g++.dg/pr63995-1.C: Remove. * g++.dg/pr68270.C: Remove. * g++.dg/pr71624.C: Remove. * g++.dg/pr71633.C: Remove. * g++.dg/pr79761.C: Remove. * g++.dg/pr79764.C: Remove. * g++.dg/pr79769.C: Remove. * gcc.dg/lto/chkp-privatize-1_0.c: Remove. * gcc.dg/lto/chkp-privatize-2_0.c: Remove. * gcc.dg/lto/chkp-privatize_0.c: Remove. * gcc.dg/lto/chkp-removed-alias_0.c: Remove. * gcc.dg/lto/chkp-static-bounds_0.c: Remove. * gcc.dg/lto/chkp-wrap-asm-name_0.c: Remove. * gcc.dg/lto/lto.exp: Do not use mpx.exp. * gcc.dg/lto/pr66221_0.c: Remove. * gcc.target/i386/chkp-always_inline.c: Remove. * gcc.target/i386/chkp-bndret.c: Remove. * gcc.target/i386/chkp-builtins-1.c: Remove. * gcc.target/i386/chkp-builtins-2.c: Remove. * gcc.target/i386/chkp-builtins-3.c: Remove. * gcc.target/i386/chkp-builtins-4.c: Remove. * gcc.target/i386/chkp-const-check-1.c: Remove. * gcc.target/i386/chkp-const-check-2.c: Remove. * gcc.target/i386/chkp-hidden-def.c: Remove. * gcc.target/i386/chkp-label-address.c: Remove. * gcc.target/i386/chkp-lifetime-1.c: Remove. * gcc.target/i386/chkp-narrow-bounds.c: Remove. * gcc.target/i386/chkp-pr69044.c: Remove. * gcc.target/i386/chkp-remove-bndint-1.c: Remove. * gcc.target/i386/chkp-remove-bndint-2.c: Remove. * gcc.target/i386/chkp-strchr.c: Remove. * gcc.target/i386/chkp-strlen-1.c: Remove. * gcc.target/i386/chkp-strlen-2.c: Remove. * gcc.target/i386/chkp-strlen-3.c: Remove. * gcc.target/i386/chkp-strlen-4.c: Remove. * gcc.target/i386/chkp-strlen-5.c: Remove. * gcc.target/i386/chkp-stropt-1.c: Remove. * gcc.target/i386/chkp-stropt-10.c: Remove. * gcc.target/i386/chkp-stropt-11.c: Remove. * gcc.target/i386/chkp-stropt-12.c: Remove. * gcc.target/i386/chkp-stropt-13.c: Remove. * gcc.target/i386/chkp-stropt-14.c: Remove. * gcc.target/i386/chkp-stropt-15.c: Remove. * gcc.target/i386/chkp-stropt-16.c: Remove. * gcc.target/i386/chkp-stropt-17.c: Remove. * gcc.target/i386/chkp-stropt-2.c: Remove. * gcc.target/i386/chkp-stropt-3.c: Remove. * gcc.target/i386/chkp-stropt-4.c: Remove. * gcc.target/i386/chkp-stropt-5.c: Remove. * gcc.target/i386/chkp-stropt-6.c: Remove. * gcc.target/i386/chkp-stropt-7.c: Remove. * gcc.target/i386/chkp-stropt-8.c: Remove. * gcc.target/i386/chkp-stropt-9.c: Remove. * gcc.target/i386/i386.exp: Do not use mpx.exp. * gcc.target/i386/indirect-thunk-11.c: Remove. * gcc.target/i386/indirect-thunk-12.c: Remove. * gcc.target/i386/indirect-thunk-attr-12.c: Remove. * gcc.target/i386/indirect-thunk-attr-13.c: Remove. * gcc.target/i386/indirect-thunk-bnd-1.c: Remove. * gcc.target/i386/indirect-thunk-bnd-2.c: Remove. * gcc.target/i386/indirect-thunk-bnd-3.c: Remove. * gcc.target/i386/indirect-thunk-bnd-4.c: Remove. * gcc.target/i386/interrupt-bnd-err-1.c: Remove. * gcc.target/i386/interrupt-bnd-err-2.c: Remove. * gcc.target/i386/mpx/alloca-1-lbv.c: Remove. * gcc.target/i386/mpx/alloca-1-nov.c: Remove. * gcc.target/i386/mpx/alloca-1-ubv.c: Remove. * gcc.target/i386/mpx/arg-addr-1-lbv.c: Remove. * gcc.target/i386/mpx/arg-addr-1-nov.c: Remove. * gcc.target/i386/mpx/arg-addr-1-ubv.c: Remove. * gcc.target/i386/mpx/bitfields-1-lbv.c: Remove. * gcc.target/i386/mpx/bitfields-1-nov.c: Remove. * gcc.target/i386/mpx/bitfields-1-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-2.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-1-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-1-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-2.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-1-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-1-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-2.c: Remove. * gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-3.c: Remove. * gcc.target/i386/mpx/builtin-bnd-get-ptr-lbound-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-get-ptr-lbound-2.c: Remove. * gcc.target/i386/mpx/builtin-bnd-get-ptr-ubound-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-get-ptr-ubound-2.c: Remove. * gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-2-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-3.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-4.c: Remove. * gcc.target/i386/mpx/builtin-bnd-null-ptr-bounds-1-bbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-1.c: Remove. * gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-3.c: Remove. * gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-lbv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-nov.c: Remove. * gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-ubv.c: Remove. * gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-2.c: Remove. * gcc.target/i386/mpx/calloc-1-lbv.c: Remove. * gcc.target/i386/mpx/calloc-1-nov.c: Remove. * gcc.target/i386/mpx/calloc-1-ubv.c: Remove. * gcc.target/i386/mpx/chkp-fix-calls-1.c: Remove. * gcc.target/i386/mpx/chkp-fix-calls-2.c: Remove. * gcc.target/i386/mpx/chkp-fix-calls-3.c: Remove. * gcc.target/i386/mpx/chkp-fix-calls-4.c: Remove. * gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: Remove. * gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: Remove. * gcc.target/i386/mpx/chkp-thunk-comdat-3.c: Remove. * gcc.target/i386/mpx/fastcall-1-lbv.c: Remove. * gcc.target/i386/mpx/fastcall-1-nov.c: Remove. * gcc.target/i386/mpx/fastcall-1-ubv.c: Remove. * gcc.target/i386/mpx/fastcall-2-lbv.c: Remove. * gcc.target/i386/mpx/fastcall-2-nov.c: Remove. * gcc.target/i386/mpx/fastcall-2-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-1-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-1-nov.c: Remove. * gcc.target/i386/mpx/field-addr-1-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-10-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-10-nov.c: Remove. * gcc.target/i386/mpx/field-addr-10-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-2-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-2-nov.c: Remove. * gcc.target/i386/mpx/field-addr-2-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-3-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-3-nov.c: Remove. * gcc.target/i386/mpx/field-addr-3-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-4-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-4-nov.c: Remove. * gcc.target/i386/mpx/field-addr-4-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-5-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-5-nov.c: Remove. * gcc.target/i386/mpx/field-addr-5-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-6-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-6-nov.c: Remove. * gcc.target/i386/mpx/field-addr-6-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-7-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-7-nov.c: Remove. * gcc.target/i386/mpx/field-addr-7-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-8-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-8-nov.c: Remove. * gcc.target/i386/mpx/field-addr-8-ubv.c: Remove. * gcc.target/i386/mpx/field-addr-9-lbv.c: Remove. * gcc.target/i386/mpx/field-addr-9-nov.c: Remove. * gcc.target/i386/mpx/field-addr-9-ubv.c: Remove. * gcc.target/i386/mpx/frame-address-1-nov.c: Remove. * gcc.target/i386/mpx/hard-reg-1-nov.c: Remove. * gcc.target/i386/mpx/hard-reg-2-lbv.c: Remove. * gcc.target/i386/mpx/hard-reg-2-nov.c: Remove. * gcc.target/i386/mpx/hard-reg-2-ubv.c: Remove. * gcc.target/i386/mpx/if-stmt-1-lbv.c: Remove. * gcc.target/i386/mpx/if-stmt-1-nov.c: Remove. * gcc.target/i386/mpx/if-stmt-1-ubv.c: Remove. * gcc.target/i386/mpx/if-stmt-2-lbv.c: Remove. * gcc.target/i386/mpx/if-stmt-2-nov.c: Remove. * gcc.target/i386/mpx/if-stmt-2-ubv.c: Remove. * gcc.target/i386/mpx/label-address-1.c: Remove. * gcc.target/i386/mpx/legacy-1-nov.c: Remove. * gcc.target/i386/mpx/macro.c: Remove. * gcc.target/i386/mpx/malloc-1-lbv.c: Remove. * gcc.target/i386/mpx/malloc-1-nov.c: Remove. * gcc.target/i386/mpx/malloc-1-ubv.c: Remove. * gcc.target/i386/mpx/memcpy-1.c: Remove. * gcc.target/i386/mpx/memmove-1.c: Remove. * gcc.target/i386/mpx/memmove-2.c: Remove. * gcc.target/i386/mpx/memmove-zero-length.c: Remove. * gcc.target/i386/mpx/mpx-check.h: Remove. * gcc.target/i386/mpx/mpx-os-support.h: Remove. * gcc.target/i386/mpx/mpx.exp: Remove. * gcc.target/i386/mpx/nested-function-1-lbv.c: Remove. * gcc.target/i386/mpx/nested-function-1-nov.c: Remove. * gcc.target/i386/mpx/nested-function-1-ubv.c: Remove. * gcc.target/i386/mpx/pointer-arg-1-lbv.c: Remove. * gcc.target/i386/mpx/pointer-arg-1-nov.c: Remove. * gcc.target/i386/mpx/pointer-arg-1-ubv.c: Remove. * gcc.target/i386/mpx/pointer-arg-2-lbv.c: Remove. * gcc.target/i386/mpx/pointer-arg-2-nov.c: Remove. * gcc.target/i386/mpx/pointer-arg-2-ubv.c: Remove. * gcc.target/i386/mpx/pointer-arg-3-lbv.c: Remove. * gcc.target/i386/mpx/pointer-arg-3-nov.c: Remove. * gcc.target/i386/mpx/pointer-arg-3-ubv.c: Remove. * gcc.target/i386/mpx/pointer-arg-4-lbv.c: Remove. * gcc.target/i386/mpx/pointer-arg-4-nov.c: Remove. * gcc.target/i386/mpx/pointer-arg-4-ubv.c: Remove. * gcc.target/i386/mpx/pointer-arg-5-lbv.c: Remove. * gcc.target/i386/mpx/pointer-arg-5-nov.c: Remove. * gcc.target/i386/mpx/pointer-arg-5-ubv.c: Remove. * gcc.target/i386/mpx/pointer-diff-1.c: Remove. * gcc.target/i386/mpx/pointer-store-1-lbv.c: Remove. * gcc.target/i386/mpx/pointer-store-1-nov.c: Remove. * gcc.target/i386/mpx/pointer-store-1-ubv.c: Remove. * gcc.target/i386/mpx/pr65508.c: Remove. * gcc.target/i386/mpx/pr65531.cc: Remove. * gcc.target/i386/mpx/pr66048.cc: Remove. * gcc.target/i386/mpx/pr66134.c: Remove. * gcc.target/i386/mpx/pr66566.c: Remove. * gcc.target/i386/mpx/pr66567.c: Remove. * gcc.target/i386/mpx/pr66568.c: Remove. * gcc.target/i386/mpx/pr66569.c: Remove. * gcc.target/i386/mpx/pr66581.c: Remove. * gcc.target/i386/mpx/pr68337-1.c: Remove. * gcc.target/i386/mpx/pr68337-2.c: Remove. * gcc.target/i386/mpx/pr68416.c: Remove. * gcc.target/i386/mpx/pr78339.c: Remove. * gcc.target/i386/mpx/pr79631.c: Remove. * gcc.target/i386/mpx/pr79633.c: Remove. * gcc.target/i386/mpx/pr79753.c: Remove. * gcc.target/i386/mpx/pr79770.c: Remove. * gcc.target/i386/mpx/pr79987.c: Remove. * gcc.target/i386/mpx/pr79988.c: Remove. * gcc.target/i386/mpx/realloc-1-lbv.c: Remove. * gcc.target/i386/mpx/realloc-1-nov.c: Remove. * gcc.target/i386/mpx/realloc-1-ubv.c: Remove. * gcc.target/i386/mpx/realloc-2-lbv.c: Remove. * gcc.target/i386/mpx/realloc-2-nov.c: Remove. * gcc.target/i386/mpx/realloc-2-ubv.c: Remove. * gcc.target/i386/mpx/reference-1-lbv.cpp: Remove. * gcc.target/i386/mpx/reference-1-nov.cpp: Remove. * gcc.target/i386/mpx/reference-1-ubv.cpp: Remove. * gcc.target/i386/mpx/reference-2-lbv.cpp: Remove. * gcc.target/i386/mpx/reference-2-nov.cpp: Remove. * gcc.target/i386/mpx/reference-2-ubv.cpp: Remove. * gcc.target/i386/mpx/reference-3-lbv.cpp: Remove. * gcc.target/i386/mpx/reference-3-nov.cpp: Remove. * gcc.target/i386/mpx/reference-3-ubv.cpp: Remove. * gcc.target/i386/mpx/reference-4-lbv.cpp: Remove. * gcc.target/i386/mpx/reference-4-nov.cpp: Remove. * gcc.target/i386/mpx/reference-4-ubv.cpp: Remove. * gcc.target/i386/mpx/return-pointer-1-lbv.c: Remove. * gcc.target/i386/mpx/return-pointer-1-nov.c: Remove. * gcc.target/i386/mpx/return-pointer-1-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-1-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-1-nov.c: Remove. * gcc.target/i386/mpx/return-struct-1-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-2-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-2-nov.c: Remove. * gcc.target/i386/mpx/return-struct-2-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-3-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-3-nov.c: Remove. * gcc.target/i386/mpx/return-struct-3-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-4-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-4-nov.c: Remove. * gcc.target/i386/mpx/return-struct-4-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-5-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-5-nov.c: Remove. * gcc.target/i386/mpx/return-struct-5-ubv.c: Remove. * gcc.target/i386/mpx/return-struct-6-lbv.c: Remove. * gcc.target/i386/mpx/return-struct-6-nov.c: Remove. * gcc.target/i386/mpx/return-struct-6-ubv.c: Remove. * gcc.target/i386/mpx/sincos-1-nov.c: Remove. * gcc.target/i386/mpx/static-array-1-lbv.c: Remove. * gcc.target/i386/mpx/static-array-1-nov.c: Remove. * gcc.target/i386/mpx/static-array-1-ubv.c: Remove. * gcc.target/i386/mpx/static-init-1-lbv.c: Remove. * gcc.target/i386/mpx/static-init-1-nov.c: Remove. * gcc.target/i386/mpx/static-init-1-ubv.c: Remove. * gcc.target/i386/mpx/static-init-2-lbv.c: Remove. * gcc.target/i386/mpx/static-init-2-nov.c: Remove. * gcc.target/i386/mpx/static-init-2-ubv.c: Remove. * gcc.target/i386/mpx/static-init-3-lbv.c: Remove. * gcc.target/i386/mpx/static-init-3-nov.c: Remove. * gcc.target/i386/mpx/static-init-3-ubv.c: Remove. * gcc.target/i386/mpx/static-init-4-lbv.c: Remove. * gcc.target/i386/mpx/static-init-4-nov.c: Remove. * gcc.target/i386/mpx/static-init-4-ubv.c: Remove. * gcc.target/i386/mpx/static-init-5-lbv.c: Remove. * gcc.target/i386/mpx/static-init-5-nov.c: Remove. * gcc.target/i386/mpx/static-init-5-ubv.c: Remove. * gcc.target/i386/mpx/static-init-6-lbv.c: Remove. * gcc.target/i386/mpx/static-init-6-nov.c: Remove. * gcc.target/i386/mpx/static-init-6-ubv.c: Remove. * gcc.target/i386/mpx/static-string-1-lbv.c: Remove. * gcc.target/i386/mpx/static-string-1-nov.c: Remove. * gcc.target/i386/mpx/static-string-1-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-1-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-1-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-1-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-10-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-10-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-10-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-2-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-2-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-2-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-3-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-3-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-3-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-4-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-4-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-4-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-5-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-5-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-5-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-6-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-6-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-6-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-7-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-7-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-7-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-8-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-8-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-8-ubv.c: Remove. * gcc.target/i386/mpx/struct-arg-9-lbv.c: Remove. * gcc.target/i386/mpx/struct-arg-9-nov.c: Remove. * gcc.target/i386/mpx/struct-arg-9-ubv.c: Remove. * gcc.target/i386/mpx/struct-copy-1-lbv.c: Remove. * gcc.target/i386/mpx/struct-copy-1-nov.c: Remove. * gcc.target/i386/mpx/struct-copy-1-ubv.c: Remove. * gcc.target/i386/mpx/struct-copy-2-lbv.c: Remove. * gcc.target/i386/mpx/struct-copy-2-nov.c: Remove. * gcc.target/i386/mpx/struct-copy-2-ubv.c: Remove. * gcc.target/i386/mpx/thread-local-var-1-lbv.c: Remove. * gcc.target/i386/mpx/thread-local-var-1-nov.c: Remove. * gcc.target/i386/mpx/thread-local-var-1-ubv.c: Remove. * gcc.target/i386/mpx/union-arg-1-lbv.c: Remove. * gcc.target/i386/mpx/union-arg-1-nov.c: Remove. * gcc.target/i386/mpx/union-arg-1-ubv.c: Remove. * gcc.target/i386/mpx/va-arg-pack-1-lbv.c: Remove. * gcc.target/i386/mpx/va-arg-pack-1-nov.c: Remove. * gcc.target/i386/mpx/va-arg-pack-1-ubv.c: Remove. * gcc.target/i386/mpx/va-arg-pack-2-lbv.c: Remove. * gcc.target/i386/mpx/va-arg-pack-2-nov.c: Remove. * gcc.target/i386/mpx/va-arg-pack-2-ubv.c: Remove. * gcc.target/i386/mpx/vararg-1-lbv.c: Remove. * gcc.target/i386/mpx/vararg-1-nov.c: Remove. * gcc.target/i386/mpx/vararg-1-ubv.c: Remove. * gcc.target/i386/mpx/vararg-2-lbv.c: Remove. * gcc.target/i386/mpx/vararg-2-nov.c: Remove. * gcc.target/i386/mpx/vararg-2-ubv.c: Remove. * gcc.target/i386/mpx/vararg-3-lbv.c: Remove. * gcc.target/i386/mpx/vararg-3-nov.c: Remove. * gcc.target/i386/mpx/vararg-3-ubv.c: Remove. * gcc.target/i386/mpx/vararg-4-lbv.c: Remove. * gcc.target/i386/mpx/vararg-4-nov.c: Remove. * gcc.target/i386/mpx/vararg-4-ubv.c: Remove. * gcc.target/i386/mpx/vararg-5-lbv.c: Remove. * gcc.target/i386/mpx/vararg-5-nov.c: Remove. * gcc.target/i386/mpx/vararg-5-ubv.c: Remove. * gcc.target/i386/mpx/vararg-6-lbv.c: Remove. * gcc.target/i386/mpx/vararg-6-nov.c: Remove. * gcc.target/i386/mpx/vararg-6-ubv.c: Remove. * gcc.target/i386/mpx/vararg-7-lbv.c: Remove. * gcc.target/i386/mpx/vararg-7-nov.c: Remove. * gcc.target/i386/mpx/vararg-7-ubv.c: Remove. * gcc.target/i386/mpx/vararg-8-lbv.c: Remove. * gcc.target/i386/mpx/vararg-8-nov.c: Remove. * gcc.target/i386/mpx/vararg-8-ubv.c: Remove. * gcc.target/i386/mpx/vla-1-lbv.c: Remove. * gcc.target/i386/mpx/vla-1-nov.c: Remove. * gcc.target/i386/mpx/vla-1-ubv.c: Remove. * gcc.target/i386/mpx/vla-2-lbv.c: Remove. * gcc.target/i386/mpx/vla-2-nov.c: Remove. * gcc.target/i386/mpx/vla-2-ubv.c: Remove. * gcc.target/i386/mpx/vla-trailing-1-lbv.c: Remove. * gcc.target/i386/mpx/vla-trailing-1-nov.c: Remove. * gcc.target/i386/mpx/vla-trailing-1-ubv.c: Remove. * gcc.target/i386/pr63995-2.c: Remove. * gcc.target/i386/pr64805.c: Remove. * gcc.target/i386/pr65044.c: Remove. * gcc.target/i386/pr65167.c: Remove. * gcc.target/i386/pr65183.c: Remove. * gcc.target/i386/pr65184.c: Remove. * gcc.target/i386/pr65523.c: Remove. * gcc.target/i386/pr70876.c: Remove. * gcc.target/i386/pr70877.c: Remove. * gcc.target/i386/pr71458.c: Remove. * gcc.target/i386/pr80880.c: Remove. * gcc.target/i386/ret-thunk-25.c: Remove. * gcc.target/i386/thunk-retbnd.c: Remove. * lib/mpx-dg.exp: Remove. * gcc.target/i386/funcspec-56.inc: Adjust test case. From-SVN: r261304
This commit is contained in:
parent
c71f71f8bd
commit
31db0fe044
514 changed files with 923 additions and 42014 deletions
31
ChangeLog
31
ChangeLog
|
@ -1,3 +1,34 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* MAINTAINERS: Remove MPX-related entries.
|
||||
* Makefile.def: Remove libmpx support.
|
||||
* Makefile.in: Likewise.
|
||||
* configure: Remove removed files.
|
||||
* configure.ac: Likewise.
|
||||
* libmpx/ChangeLog: Remove.
|
||||
* libmpx/Makefile.am: Remove.
|
||||
* libmpx/Makefile.in: Remove.
|
||||
* libmpx/acinclude.m4: Remove.
|
||||
* libmpx/aclocal.m4: Remove.
|
||||
* libmpx/config.h.in: Remove.
|
||||
* libmpx/configure: Remove.
|
||||
* libmpx/configure.ac: Remove.
|
||||
* libmpx/configure.tgt: Remove.
|
||||
* libmpx/libmpx.spec.in: Remove.
|
||||
* libmpx/mpxrt/Makefile.am: Remove.
|
||||
* libmpx/mpxrt/Makefile.in: Remove.
|
||||
* libmpx/mpxrt/libmpx.map: Remove.
|
||||
* libmpx/mpxrt/libtool-version: Remove.
|
||||
* libmpx/mpxrt/mpxrt-utils.c: Remove.
|
||||
* libmpx/mpxrt/mpxrt-utils.h: Remove.
|
||||
* libmpx/mpxrt/mpxrt.c: Remove.
|
||||
* libmpx/mpxrt/mpxrt.h: Remove.
|
||||
* libmpx/mpxwrap/Makefile.am: Remove.
|
||||
* libmpx/mpxwrap/Makefile.in: Remove.
|
||||
* libmpx/mpxwrap/libmpxwrappers.map: Remove.
|
||||
* libmpx/mpxwrap/libtool-version: Remove.
|
||||
* libmpx/mpxwrap/mpx_wrappers.c: Remove.
|
||||
|
||||
2018-06-04 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* MAINTAINERS: Add myself as gcov maintainer.
|
||||
|
|
|
@ -168,7 +168,6 @@ libgomp Jakub Jelinek <jakub@redhat.com>
|
|||
libiberty DJ Delorie <dj@redhat.com>
|
||||
libiberty Ian Lance Taylor <ian@airs.com>
|
||||
libitm Torvald Riegel <triegel@redhat.com>
|
||||
libmpx Ilya Enkovich <enkovich.gnu@gmail.com>
|
||||
libobjc Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
libobjc Andrew Pinski <pinskia@gmail.com>
|
||||
libquadmath Tobias Burnus <burnus@net-b.de>
|
||||
|
@ -247,8 +246,6 @@ register allocation Vladimir Makarov <vmakarov@redhat.com>
|
|||
gdbhooks.py David Malcolm <dmalcolm@redhat.com>
|
||||
SLSR Bill Schmidt <wschmidt@linux.ibm.com>
|
||||
jit David Malcolm <dmalcolm@redhat.com>
|
||||
pointer bounds checker Ilya Enkovich <enkovich.gnu@gmail.com>
|
||||
i386 MPX Ilya Enkovich <enkovich.gnu@gmail.com>
|
||||
gen* on machine desc Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
Note that individuals who maintain parts of the compiler need approval to
|
||||
|
|
|
@ -137,9 +137,6 @@ target_modules = { module= libsanitizer;
|
|||
bootstrap=true;
|
||||
lib_path=.libs;
|
||||
raw_cxx=true; };
|
||||
target_modules = { module= libmpx;
|
||||
bootstrap=true;
|
||||
lib_path=.libs; };
|
||||
target_modules = { module= libvtv;
|
||||
bootstrap=true;
|
||||
lib_path=.libs;
|
||||
|
|
1291
Makefile.in
1291
Makefile.in
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,7 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* bootstrap-mpx.mk: Remove.
|
||||
|
||||
2018-05-10 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR bootstrap/64914
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# This option enables -fcheck-pointer-bounds -mmpx for stage2 and stage3.
|
||||
|
||||
STAGE2_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
|
||||
STAGE3_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
|
||||
POSTSTAGE1_LDFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1 \
|
||||
-static-libmpx -static-libmpxwrappers \
|
||||
-B$$r/prev-$(TARGET_SUBDIR)/libmpx \
|
||||
-B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxrt/.libs \
|
||||
-B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxwrap/.libs
|
32
configure
vendored
32
configure
vendored
|
@ -2758,7 +2758,6 @@ target_libraries="target-libgcc \
|
|||
target-libstdc++-v3 \
|
||||
target-libsanitizer \
|
||||
target-libvtv \
|
||||
target-libmpx \
|
||||
target-libssp \
|
||||
target-libquadmath \
|
||||
target-libgfortran \
|
||||
|
@ -3264,25 +3263,6 @@ $as_echo "yes" >&6; }
|
|||
fi
|
||||
|
||||
|
||||
# Enable libmpx on supported systems by request.
|
||||
if test -d ${srcdir}/libmpx; then
|
||||
if test x$enable_libmpx = x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmpx support" >&5
|
||||
$as_echo_n "checking for libmpx support... " >&6; }
|
||||
if (srcdir=${srcdir}/libmpx; \
|
||||
. ${srcdir}/configure.tgt; \
|
||||
test "$LIBMPX_SUPPORTED" != "yes")
|
||||
then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disable libhsail-rt on unsupported systems.
|
||||
if test -d ${srcdir}/libhsail-rt; then
|
||||
if test x$enable_libhsail_rt = x; then
|
||||
|
@ -6656,7 +6636,7 @@ fi
|
|||
# Check whether --with-gcc-major-version-only was given.
|
||||
if test "${with_gcc_major_version_only+set}" = set; then :
|
||||
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
|
||||
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
|
||||
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
@ -7110,16 +7090,6 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
|
|||
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
|
||||
fi
|
||||
|
||||
# If we are building libmpx and $BUILD_CONFIG contains bootstrap-mpx,
|
||||
# bootstrap it.
|
||||
if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
|
||||
case "$BUILD_CONFIG" in
|
||||
*bootstrap-mpx* )
|
||||
bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Determine whether gdb needs tk/tcl or not.
|
||||
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
|
||||
# and in that case we want gdb to be built without tk. Ugh!
|
||||
|
|
27
configure.ac
27
configure.ac
|
@ -157,7 +157,6 @@ target_libraries="target-libgcc \
|
|||
target-libstdc++-v3 \
|
||||
target-libsanitizer \
|
||||
target-libvtv \
|
||||
target-libmpx \
|
||||
target-libssp \
|
||||
target-libquadmath \
|
||||
target-libgfortran \
|
||||
|
@ -601,22 +600,6 @@ if test -d ${srcdir}/libvtv; then
|
|||
fi
|
||||
|
||||
|
||||
# Enable libmpx on supported systems by request.
|
||||
if test -d ${srcdir}/libmpx; then
|
||||
if test x$enable_libmpx = x; then
|
||||
AC_MSG_CHECKING([for libmpx support])
|
||||
if (srcdir=${srcdir}/libmpx; \
|
||||
. ${srcdir}/configure.tgt; \
|
||||
test "$LIBMPX_SUPPORTED" != "yes")
|
||||
then
|
||||
AC_MSG_RESULT([no])
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disable libhsail-rt on unsupported systems.
|
||||
if test -d ${srcdir}/libhsail-rt; then
|
||||
if test x$enable_libhsail_rt = x; then
|
||||
|
@ -2696,16 +2679,6 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
|
|||
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
|
||||
fi
|
||||
|
||||
# If we are building libmpx and $BUILD_CONFIG contains bootstrap-mpx,
|
||||
# bootstrap it.
|
||||
if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
|
||||
case "$BUILD_CONFIG" in
|
||||
*bootstrap-mpx* )
|
||||
bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Determine whether gdb needs tk/tcl or not.
|
||||
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
|
||||
# and in that case we want gdb to be built without tk. Ugh!
|
||||
|
|
292
gcc/ChangeLog
292
gcc/ChangeLog
|
@ -1,3 +1,295 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* Makefile.in: Remove support for MPX (macros, related functions,
|
||||
fields in cgraph_node, ...).
|
||||
* builtin-types.def (BT_BND): Likewise.
|
||||
(BT_FN_BND_CONST_PTR): Likewise.
|
||||
(BT_FN_CONST_PTR_BND): Likewise.
|
||||
(BT_FN_VOID_PTR_BND): Likewise.
|
||||
(BT_FN_BND_CONST_PTR_SIZE): Likewise.
|
||||
(BT_FN_VOID_CONST_PTR_BND_CONST_PTR): Likewise.
|
||||
* builtins.c (expand_builtin_memcpy_with_bounds): Likewise.
|
||||
(expand_builtin_mempcpy_with_bounds): Likewise.
|
||||
(expand_builtin_memset_with_bounds): Likewise.
|
||||
(expand_builtin_memset_args): Likewise.
|
||||
(std_expand_builtin_va_start): Likewise.
|
||||
(expand_builtin): Likewise.
|
||||
(expand_builtin_with_bounds): Likewise.
|
||||
* builtins.def (DEF_BUILTIN_CHKP): Likewise.
|
||||
(DEF_LIB_BUILTIN_CHKP): Likewise.
|
||||
(DEF_EXT_LIB_BUILTIN_CHKP): Likewise.
|
||||
(DEF_CHKP_BUILTIN): Likewise.
|
||||
(BUILT_IN_MEMCPY): Likewise.
|
||||
(BUILT_IN_MEMMOVE): Likewise.
|
||||
(BUILT_IN_MEMPCPY): Likewise.
|
||||
(BUILT_IN_MEMSET): Likewise.
|
||||
(BUILT_IN_STPCPY): Likewise.
|
||||
(BUILT_IN_STRCAT): Likewise.
|
||||
(BUILT_IN_STRCHR): Likewise.
|
||||
(BUILT_IN_STRCPY): Likewise.
|
||||
(BUILT_IN_STRLEN): Likewise.
|
||||
(BUILT_IN_MEMCPY_CHK): Likewise.
|
||||
(BUILT_IN_MEMMOVE_CHK): Likewise.
|
||||
(BUILT_IN_MEMPCPY_CHK): Likewise.
|
||||
(BUILT_IN_MEMSET_CHK): Likewise.
|
||||
(BUILT_IN_STPCPY_CHK): Likewise.
|
||||
(BUILT_IN_STRCAT_CHK): Likewise.
|
||||
(BUILT_IN_STRCPY_CHK): Likewise.
|
||||
* calls.c (store_bounds): Likewise.
|
||||
(emit_call_1): Likewise.
|
||||
(special_function_p): Likewise.
|
||||
(maybe_warn_nonstring_arg): Likewise.
|
||||
(initialize_argument_information): Likewise.
|
||||
(finalize_must_preallocate): Likewise.
|
||||
(compute_argument_addresses): Likewise.
|
||||
(expand_call): Likewise.
|
||||
* cfgexpand.c (expand_call_stmt): Likewise.
|
||||
(expand_return): Likewise.
|
||||
(expand_gimple_stmt_1): Likewise.
|
||||
(pass_expand::execute): Likewise.
|
||||
* cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise.
|
||||
(cgraph_node::remove): Likewise.
|
||||
(cgraph_node::dump): Likewise.
|
||||
(cgraph_node::verify_node): Likewise.
|
||||
* cgraph.h (chkp_function_instrumented_p): Likewise.
|
||||
(symtab_node::get_alias_target): Likewise.
|
||||
(cgraph_node::can_remove_if_no_direct_calls_and_refs_p): Likewise.
|
||||
(cgraph_local_p): Likewise.
|
||||
* cgraphbuild.c (cgraph_edge::rebuild_edges): Likewise.
|
||||
(cgraph_edge::rebuild_references): Likewise.
|
||||
* cgraphunit.c (varpool_node::finalize_decl): Likewise.
|
||||
(walk_polymorphic_call_targets): Likewise.
|
||||
(cgraph_node::expand_thunk): Likewise.
|
||||
(symbol_table::output_weakrefs): Likewise.
|
||||
* common/config/i386/i386-common.c (OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET): Likewise.
|
||||
(ix86_handle_option): Likewise.
|
||||
* config/i386/constraints.md: Likewise.
|
||||
* config/i386/i386-builtin-types.def (BND): Likewise.
|
||||
(VOID): Likewise.
|
||||
(PVOID): Likewise.
|
||||
(ULONG): Likewise.
|
||||
* config/i386/i386-builtin.def (BDESC_END): Likewise.
|
||||
(BDESC_FIRST): Likewise.
|
||||
(BDESC): Likewise.
|
||||
* config/i386/i386-c.c (ix86_target_macros_internal): Likewise.
|
||||
* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): Likewise.
|
||||
* config/i386/i386.c (enum reg_class): Likewise.
|
||||
(ix86_target_string): Likewise.
|
||||
(ix86_option_override_internal): Likewise.
|
||||
(ix86_conditional_register_usage): Likewise.
|
||||
(ix86_valid_target_attribute_inner_p): Likewise.
|
||||
(ix86_set_indirect_branch_type): Likewise.
|
||||
(ix86_set_current_function): Likewise.
|
||||
(ix86_function_arg_regno_p): Likewise.
|
||||
(init_cumulative_args): Likewise.
|
||||
(ix86_function_arg_advance): Likewise.
|
||||
(ix86_function_arg): Likewise.
|
||||
(ix86_pass_by_reference): Likewise.
|
||||
(ix86_function_value_regno_p): Likewise.
|
||||
(ix86_function_value_1): Likewise.
|
||||
(ix86_function_value_bounds): Likewise.
|
||||
(ix86_return_in_memory): Likewise.
|
||||
(ix86_setup_incoming_vararg_bounds): Likewise.
|
||||
(ix86_va_start): Likewise.
|
||||
(indirect_thunk_need_prefix): Likewise.
|
||||
(print_reg): Likewise.
|
||||
(ix86_print_operand): Likewise.
|
||||
(ix86_expand_call): Likewise.
|
||||
(ix86_output_function_return): Likewise.
|
||||
(reg_encoded_number): Likewise.
|
||||
(BDESC_VERIFYS): Likewise.
|
||||
(ix86_init_mpx_builtins): Likewise.
|
||||
(ix86_init_builtins): Likewise.
|
||||
(ix86_emit_cmove): Likewise.
|
||||
(ix86_emit_move_max): Likewise.
|
||||
(ix86_expand_builtin): Likewise.
|
||||
(ix86_builtin_mpx_function): Likewise.
|
||||
(ix86_get_arg_address_for_bt): Likewise.
|
||||
(ix86_load_bounds): Likewise.
|
||||
(ix86_store_bounds): Likewise.
|
||||
(ix86_load_returned_bounds): Likewise.
|
||||
(ix86_store_returned_bounds): Likewise.
|
||||
(ix86_class_likely_spilled_p): Likewise.
|
||||
(ix86_hard_regno_mode_ok): Likewise.
|
||||
(x86_order_regs_for_local_alloc): Likewise.
|
||||
(ix86_mitigate_rop): Likewise.
|
||||
(ix86_bnd_prefixed_insn_p): Likewise.
|
||||
(ix86_mpx_bound_mode): Likewise.
|
||||
(ix86_make_bounds_constant): Likewise.
|
||||
(ix86_initialize_bounds): Likewise.
|
||||
(TARGET_LOAD_BOUNDS_FOR_ARG): Likewise.
|
||||
(TARGET_STORE_BOUNDS_FOR_ARG): Likewise.
|
||||
(TARGET_LOAD_RETURNED_BOUNDS): Likewise.
|
||||
(TARGET_STORE_RETURNED_BOUNDS): Likewise.
|
||||
(TARGET_CHKP_BOUND_MODE): Likewise.
|
||||
(TARGET_BUILTIN_CHKP_FUNCTION): Likewise.
|
||||
(TARGET_CHKP_FUNCTION_VALUE_BOUNDS): Likewise.
|
||||
(TARGET_CHKP_MAKE_BOUNDS_CONSTANT): Likewise.
|
||||
(TARGET_CHKP_INITIALIZE_BOUNDS): Likewise.
|
||||
* config/i386/i386.h (TARGET_MPX): Likewise.
|
||||
(TARGET_MPX_P): Likewise.
|
||||
(VALID_BND_REG_MODE): Likewise.
|
||||
(FIRST_BND_REG): Likewise.
|
||||
(LAST_BND_REG): Likewise.
|
||||
(enum reg_class): Likewise.
|
||||
(BND_REG_P): Likewise.
|
||||
(BND_REGNO_P): Likewise.
|
||||
(BNDmode): Likewise.
|
||||
(ADJUST_INSN_LENGTH): Likewise.
|
||||
* config/i386/i386.md: Likewise.
|
||||
* config/i386/i386.opt: Likewise.
|
||||
* config/i386/linux-common.h (LIBMPX_LIBS): Likewise.
|
||||
(defined): Likewise.
|
||||
(LINK_MPX): Likewise.
|
||||
(MPX_SPEC): Likewise.
|
||||
(LIBMPX_SPEC): Likewise.
|
||||
(LIBMPXWRAPPERS_SPEC): Likewise.
|
||||
(CHKP_SPEC): Likewise.
|
||||
* config/i386/predicates.md: Likewise.
|
||||
* dbxout.c (dbxout_type): Likewise.
|
||||
* doc/extend.texi: Likewise.
|
||||
* doc/invoke.texi: Likewise.
|
||||
* doc/md.texi: Likewise.
|
||||
* doc/tm.texi: Likewise.
|
||||
* doc/tm.texi.in: Likewise.
|
||||
* dwarf2out.c (is_base_type): Likewise.
|
||||
(gen_formal_types_die): Likewise.
|
||||
(gen_subprogram_die): Likewise.
|
||||
(gen_type_die_with_usage): Likewise.
|
||||
(gen_decl_die): Likewise.
|
||||
(dwarf2out_late_global_decl): Likewise.
|
||||
* expr.c (expand_assignment): Likewise.
|
||||
(emit_storent_insn): Likewise.
|
||||
(store_expr_with_bounds): Likewise.
|
||||
(store_expr): Likewise.
|
||||
(expand_expr_real_1): Likewise.
|
||||
* expr.h (store_expr_with_bounds): Likewise.
|
||||
* function.c (use_register_for_decl): Likewise.
|
||||
(struct bounds_parm_data): Likewise.
|
||||
(assign_parms_augmented_arg_list): Likewise.
|
||||
(assign_parm_find_entry_rtl): Likewise.
|
||||
(assign_parm_is_stack_parm): Likewise.
|
||||
(assign_parm_load_bounds): Likewise.
|
||||
(assign_bounds): Likewise.
|
||||
(assign_parms): Likewise.
|
||||
(expand_function_start): Likewise.
|
||||
* gcc.c (CHKP_SPEC): Likewise.
|
||||
* gimple-fold.c (gimple_fold_builtin_memory_op): Likewise.
|
||||
* gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Likewise.
|
||||
(wrestrict_dom_walker::check_call): Likewise.
|
||||
* gimple.c (gimple_build_call_from_tree): Likewise.
|
||||
* gimple.h (enum gf_mask): Likewise.
|
||||
(gimple_call_with_bounds_p): Likewise.
|
||||
(gimple_call_set_with_bounds): Likewise.
|
||||
* gimplify.c (gimplify_init_constructor): Likewise.
|
||||
* ipa-cp.c (initialize_node_lattices): Likewise.
|
||||
(propagate_constants_across_call): Likewise.
|
||||
(find_more_scalar_values_for_callers_subset): Likewise.
|
||||
* ipa-hsa.c (process_hsa_functions): Likewise.
|
||||
* ipa-icf-gimple.c (func_checker::compare_gimple_call): Likewise.
|
||||
* ipa-icf.c (sem_function::merge): Likewise.
|
||||
* ipa-inline.c (early_inliner): Likewise.
|
||||
* ipa-pure-const.c (warn_function_noreturn): Likewise.
|
||||
(warn_function_cold): Likewise.
|
||||
(propagate_pure_const): Likewise.
|
||||
* ipa-ref.h (enum GTY): Likewise.
|
||||
* ipa-split.c (find_retbnd): Likewise.
|
||||
(consider_split): Likewise.
|
||||
(split_function): Likewise.
|
||||
* ipa-visibility.c (cgraph_externally_visible_p): Likewise.
|
||||
* ipa.c (walk_polymorphic_call_targets): Likewise.
|
||||
(symbol_table::remove_unreachable_nodes): Likewise.
|
||||
(process_references): Likewise.
|
||||
(cgraph_build_static_cdtor_1): Likewise.
|
||||
* lto-cgraph.c (lto_output_node): Likewise.
|
||||
(output_refs): Likewise.
|
||||
(compute_ltrans_boundary): Likewise.
|
||||
(input_overwrite_node): Likewise.
|
||||
(input_node): Likewise.
|
||||
(input_cgraph_1): Likewise.
|
||||
* params.def (PARAM_CHKP_MAX_CTOR_SIZE): Likewise.
|
||||
* passes.c (pass_manager::execute_early_local_passes): Likewise.
|
||||
(class pass_chkp_instrumentation_passes): Likewise.
|
||||
(make_pass_chkp_instrumentation_passes): Likewise.
|
||||
* passes.def: Likewise.
|
||||
* rtl.h (struct GTY): Likewise.
|
||||
(CALL_EXPR_WITH_BOUNDS_P): Likewise.
|
||||
* stor-layout.c (layout_type): Likewise.
|
||||
* symtab.c: Likewise.
|
||||
* target.def: Likewise.
|
||||
* targhooks.c (default_chkp_bound_type): Likewise.
|
||||
(default_chkp_bound_mode): Likewise.
|
||||
(default_builtin_chkp_function): Likewise.
|
||||
(default_chkp_function_value_bounds): Likewise.
|
||||
(default_chkp_make_bounds_constant): Likewise.
|
||||
(default_chkp_initialize_bounds): Likewise.
|
||||
* targhooks.h (default_chkp_bound_type): Likewise.
|
||||
(default_chkp_bound_mode): Likewise.
|
||||
(default_builtin_chkp_function): Likewise.
|
||||
(default_chkp_function_value_bounds): Likewise.
|
||||
(default_chkp_make_bounds_constant): Likewise.
|
||||
(default_chkp_initialize_bounds): Likewise.
|
||||
* toplev.c (compile_file): Likewise.
|
||||
(process_options): Likewise.
|
||||
* tree-core.h (DEF_BUILTIN): Likewise.
|
||||
(DEF_BUILTIN_CHKP): Likewise.
|
||||
* tree-inline.c (declare_return_variable): Likewise.
|
||||
(remap_gimple_stmt): Likewise.
|
||||
(copy_bb): Likewise.
|
||||
(initialize_inlined_parameters): Likewise.
|
||||
(expand_call_inline): Likewise.
|
||||
* tree-pass.h (make_pass_ipa_chkp_versioning): Likewise.
|
||||
(make_pass_ipa_chkp_early_produce_thunks): Likewise.
|
||||
(make_pass_ipa_chkp_produce_thunks): Likewise.
|
||||
(make_pass_chkp): Likewise.
|
||||
(make_pass_chkp_opt): Likewise.
|
||||
(make_pass_chkp_instrumentation_passes): Likewise.
|
||||
* tree-pretty-print.c (dump_generic_node): Likewise.
|
||||
* tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise.
|
||||
* tree-ssa-dce.c (propagate_necessity): Likewise.
|
||||
(eliminate_unnecessary_stmts): Likewise.
|
||||
* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
|
||||
* tree-ssa-sccvn.c (copy_reference_ops_from_call): Likewise.
|
||||
* tree-ssa-sccvn.h: Likewise.
|
||||
* tree-ssa-strlen.c (get_string_length): Likewise.
|
||||
(valid_builtin_call): Likewise.
|
||||
(adjust_last_stmt): Likewise.
|
||||
(handle_builtin_strchr): Likewise.
|
||||
(handle_builtin_strcpy): Likewise.
|
||||
(handle_builtin_stxncpy): Likewise.
|
||||
(handle_builtin_memcpy): Likewise.
|
||||
(handle_builtin_strcat): Likewise.
|
||||
(strlen_check_and_optimize_stmt): Likewise.
|
||||
* tree-stdarg.c (expand_ifn_va_arg_1): Likewise.
|
||||
* tree-streamer-in.c: Likewise.
|
||||
* tree-streamer.c (record_common_node): Likewise.
|
||||
* tree.c (tree_code_size): Likewise.
|
||||
(wide_int_to_tree_1): Likewise.
|
||||
(type_contains_placeholder_1): Likewise.
|
||||
(build_common_tree_nodes): Likewise.
|
||||
* tree.def (POINTER_BOUNDS_TYPE): Likewise.
|
||||
* tree.h (POINTER_BOUNDS_TYPE_P): Likewise.
|
||||
(POINTER_BOUNDS_P): Likewise.
|
||||
(BOUNDED_TYPE_P): Likewise.
|
||||
(BOUNDED_P): Likewise.
|
||||
(CALL_WITH_BOUNDS_P): Likewise.
|
||||
(pointer_bounds_type_node): Likewise.
|
||||
* value-prof.c (gimple_ic): Likewise.
|
||||
* var-tracking.c (vt_add_function_parameters): Likewise.
|
||||
* varasm.c (make_decl_rtl): Likewise.
|
||||
(assemble_start_function): Likewise.
|
||||
(output_constant): Likewise.
|
||||
(maybe_assemble_visibility): Likewise.
|
||||
* varpool.c (ctor_for_folding): Likewise.
|
||||
* chkp-builtins.def: Remove.
|
||||
* ipa-chkp.c: Remove.
|
||||
* ipa-chkp.h: Remove.
|
||||
* rtl-chkp.c: Remove.
|
||||
* rtl-chkp.h: Remove.
|
||||
* tree-chkp-opt.c: Remove.
|
||||
* tree-chkp.c: Remove.
|
||||
* tree-chkp.h: Remove.
|
||||
|
||||
2018-06-07 Carl Love <cel@us.ibm.com>
|
||||
|
||||
* gcc/config/rs6000/vsx.md (vextract_fp_from_shorth,
|
||||
|
|
|
@ -1355,7 +1355,6 @@ OBJS = \
|
|||
incpath.o \
|
||||
init-regs.o \
|
||||
internal-fn.o \
|
||||
ipa-chkp.o \
|
||||
ipa-cp.o \
|
||||
ipa-devirt.o \
|
||||
ipa-fnsummary.o \
|
||||
|
@ -1452,7 +1451,6 @@ OBJS = \
|
|||
reload1.o \
|
||||
reorg.o \
|
||||
resource.o \
|
||||
rtl-chkp.o \
|
||||
rtl-error.o \
|
||||
rtl-tests.o \
|
||||
rtl.o \
|
||||
|
@ -1518,8 +1516,6 @@ OBJS = \
|
|||
tree-outof-ssa.o \
|
||||
tree-parloops.o \
|
||||
tree-phinodes.o \
|
||||
tree-chkp.o \
|
||||
tree-chkp-opt.o \
|
||||
tree-predcom.o \
|
||||
tree-pretty-print.o \
|
||||
tree-profile.o \
|
||||
|
@ -2552,7 +2548,6 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
|
|||
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
|
||||
$(srcdir)/gimple.h \
|
||||
$(srcdir)/gimple-ssa.h \
|
||||
$(srcdir)/tree-chkp.c \
|
||||
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
|
||||
$(srcdir)/tree-cfg.c $(srcdir)/tree-ssa-loop-ivopts.c \
|
||||
$(srcdir)/tree-dfa.c \
|
||||
|
@ -3512,7 +3507,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
|||
tree-ssa-loop-niter.h tree-ssa-ter.h tree-ssa-threadedge.h \
|
||||
tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \
|
||||
hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \
|
||||
lcm.h cfgloopmanip.h file-prefix-map.h builtins.def chkp-builtins.def \
|
||||
lcm.h cfgloopmanip.h file-prefix-map.h builtins.def \
|
||||
pass-instances.def params.list
|
||||
|
||||
# generate the 'build fragment' b-header-vars
|
||||
|
|
|
@ -152,8 +152,6 @@ DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1))
|
|||
DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1))
|
||||
DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_BND, pointer_bounds_type_node)
|
||||
|
||||
/* The C type `char * const *'. */
|
||||
DEF_PRIMITIVE_TYPE (BT_PTR_CONST_STRING,
|
||||
build_pointer_type
|
||||
|
@ -300,8 +298,6 @@ DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_FLOAT, BT_UINT64, BT_FLOAT)
|
|||
DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_CONST_PTR, BT_PTR, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_CONST_PTR_CONST_PTR, BT_CONST_PTR, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_BND_CONST_PTR, BT_BND, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_CONST_PTR_BND, BT_CONST_PTR, BT_BND)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_UINT16_UINT32, BT_UINT16, BT_UINT32)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT16, BT_UINT32, BT_UINT16)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_FENV_T_PTR, BT_INT, BT_FENV_T_PTR)
|
||||
|
@ -487,9 +483,7 @@ DEF_FUNCTION_TYPE_2 (BT_FN_PTR_CONST_PTR_SIZE, BT_PTR, BT_CONST_PTR, BT_SIZE)
|
|||
DEF_FUNCTION_TYPE_2 (BT_FN_PTR_CONST_PTR_CONST_PTR, BT_PTR, BT_CONST_PTR, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTRPTR_CONST_PTR, BT_VOID, BT_PTR_PTR, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_CONST_PTR_SIZE, BT_VOID, BT_CONST_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_BND, BT_VOID, BT_PTR, BT_BND)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_CONST_PTR_CONST_PTR_CONST_PTR, BT_CONST_PTR, BT_CONST_PTR, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_BND_CONST_PTR_SIZE, BT_BND, BT_CONST_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_UINT32_UINT64_PTR,
|
||||
BT_UINT32, BT_UINT64, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_FEXCEPT_T_PTR_INT, BT_INT, BT_FEXCEPT_T_PTR,
|
||||
|
@ -607,7 +601,6 @@ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT
|
|||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_PTRPTR_SIZE_SIZE, BT_INT, BT_PTR_PTR, BT_SIZE, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE, BT_PTR, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_CONST_PTR_BND_CONST_PTR, BT_VOID, BT_CONST_PTR, BT_BND, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_INT_INT_INTPTR, BT_BOOL, BT_INT, BT_INT,
|
||||
BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_LONG_LONG_LONGPTR, BT_BOOL, BT_LONG, BT_LONG,
|
||||
|
|
236
gcc/builtins.c
236
gcc/builtins.c
|
@ -64,8 +64,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
#include "asan.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "rtl-chkp.h"
|
||||
#include "internal-fn.h"
|
||||
#include "case-cfn-macros.h"
|
||||
#include "gimple-fold.h"
|
||||
|
@ -125,12 +123,10 @@ static rtx expand_builtin_strncmp (tree, rtx, machine_mode);
|
|||
static rtx builtin_memcpy_read_str (void *, HOST_WIDE_INT, scalar_int_mode);
|
||||
static rtx expand_builtin_memchr (tree, rtx);
|
||||
static rtx expand_builtin_memcpy (tree, rtx);
|
||||
static rtx expand_builtin_memcpy_with_bounds (tree, rtx);
|
||||
static rtx expand_builtin_memory_copy_args (tree dest, tree src, tree len,
|
||||
rtx target, tree exp, int endp);
|
||||
static rtx expand_builtin_memmove (tree, rtx);
|
||||
static rtx expand_builtin_mempcpy (tree, rtx);
|
||||
static rtx expand_builtin_mempcpy_with_bounds (tree, rtx);
|
||||
static rtx expand_builtin_mempcpy_args (tree, tree, tree, rtx, tree, int);
|
||||
static rtx expand_builtin_strcat (tree, rtx);
|
||||
static rtx expand_builtin_strcpy (tree, rtx);
|
||||
|
@ -141,7 +137,6 @@ static rtx expand_builtin_strncat (tree, rtx);
|
|||
static rtx expand_builtin_strncpy (tree, rtx);
|
||||
static rtx builtin_memset_gen_str (void *, HOST_WIDE_INT, scalar_int_mode);
|
||||
static rtx expand_builtin_memset (tree, rtx, machine_mode);
|
||||
static rtx expand_builtin_memset_with_bounds (tree, rtx, machine_mode);
|
||||
static rtx expand_builtin_memset_args (tree, tree, tree, rtx, machine_mode, tree);
|
||||
static rtx expand_builtin_bzero (tree);
|
||||
static rtx expand_builtin_strlen (tree, rtx, machine_mode);
|
||||
|
@ -3479,38 +3474,6 @@ expand_builtin_memmove (tree exp, rtx)
|
|||
return NULL_RTX;
|
||||
}
|
||||
|
||||
/* Expand an instrumented call EXP to the memcpy builtin.
|
||||
Return NULL_RTX if we failed, the caller should emit a normal call,
|
||||
otherwise try to get the result in TARGET, if convenient (and in
|
||||
mode MODE if that's convenient). */
|
||||
|
||||
static rtx
|
||||
expand_builtin_memcpy_with_bounds (tree exp, rtx target)
|
||||
{
|
||||
if (!validate_arglist (exp,
|
||||
POINTER_TYPE, POINTER_BOUNDS_TYPE,
|
||||
POINTER_TYPE, POINTER_BOUNDS_TYPE,
|
||||
INTEGER_TYPE, VOID_TYPE))
|
||||
return NULL_RTX;
|
||||
else
|
||||
{
|
||||
tree dest = CALL_EXPR_ARG (exp, 0);
|
||||
tree src = CALL_EXPR_ARG (exp, 2);
|
||||
tree len = CALL_EXPR_ARG (exp, 4);
|
||||
rtx res = expand_builtin_memory_copy_args (dest, src, len, target, exp,
|
||||
/*end_p=*/ 0);
|
||||
|
||||
/* Return src bounds with the result. */
|
||||
if (res)
|
||||
{
|
||||
rtx bnd = force_reg (targetm.chkp_bound_mode (),
|
||||
expand_normal (CALL_EXPR_ARG (exp, 1)));
|
||||
res = chkp_join_splitted_slot (res, bnd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* Expand a call EXP to the mempcpy builtin.
|
||||
Return NULL_RTX if we failed; the caller should emit a normal call,
|
||||
otherwise try to get the result in TARGET, if convenient (and in
|
||||
|
@ -3553,38 +3516,6 @@ expand_builtin_mempcpy (tree exp, rtx target)
|
|||
target, exp, /*endp=*/ 1);
|
||||
}
|
||||
|
||||
/* Expand an instrumented call EXP to the mempcpy builtin.
|
||||
Return NULL_RTX if we failed, the caller should emit a normal call,
|
||||
otherwise try to get the result in TARGET, if convenient (and in
|
||||
mode MODE if that's convenient). */
|
||||
|
||||
static rtx
|
||||
expand_builtin_mempcpy_with_bounds (tree exp, rtx target)
|
||||
{
|
||||
if (!validate_arglist (exp,
|
||||
POINTER_TYPE, POINTER_BOUNDS_TYPE,
|
||||
POINTER_TYPE, POINTER_BOUNDS_TYPE,
|
||||
INTEGER_TYPE, VOID_TYPE))
|
||||
return NULL_RTX;
|
||||
else
|
||||
{
|
||||
tree dest = CALL_EXPR_ARG (exp, 0);
|
||||
tree src = CALL_EXPR_ARG (exp, 2);
|
||||
tree len = CALL_EXPR_ARG (exp, 4);
|
||||
rtx res = expand_builtin_mempcpy_args (dest, src, len, target,
|
||||
exp, 1);
|
||||
|
||||
/* Return src bounds with the result. */
|
||||
if (res)
|
||||
{
|
||||
rtx bnd = force_reg (targetm.chkp_bound_mode (),
|
||||
expand_normal (CALL_EXPR_ARG (exp, 1)));
|
||||
res = chkp_join_splitted_slot (res, bnd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper function to do the actual work for expand of memory copy family
|
||||
functions (memcpy, mempcpy, stpcpy). Expansing should assign LEN bytes
|
||||
of memory from SRC to DEST and assign to TARGET if convenient.
|
||||
|
@ -4205,36 +4136,6 @@ expand_builtin_memset (tree exp, rtx target, machine_mode mode)
|
|||
return expand_builtin_memset_args (dest, val, len, target, mode, exp);
|
||||
}
|
||||
|
||||
/* Expand expression EXP, which is an instrumented call to the memset builtin.
|
||||
Return NULL_RTX if we failed the caller should emit a normal call, otherwise
|
||||
try to get the result in TARGET, if convenient (and in mode MODE if that's
|
||||
convenient). */
|
||||
|
||||
static rtx
|
||||
expand_builtin_memset_with_bounds (tree exp, rtx target, machine_mode mode)
|
||||
{
|
||||
if (!validate_arglist (exp,
|
||||
POINTER_TYPE, POINTER_BOUNDS_TYPE,
|
||||
INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE))
|
||||
return NULL_RTX;
|
||||
else
|
||||
{
|
||||
tree dest = CALL_EXPR_ARG (exp, 0);
|
||||
tree val = CALL_EXPR_ARG (exp, 2);
|
||||
tree len = CALL_EXPR_ARG (exp, 3);
|
||||
rtx res = expand_builtin_memset_args (dest, val, len, target, mode, exp);
|
||||
|
||||
/* Return src bounds with the result. */
|
||||
if (res)
|
||||
{
|
||||
rtx bnd = force_reg (targetm.chkp_bound_mode (),
|
||||
expand_normal (CALL_EXPR_ARG (exp, 1)));
|
||||
res = chkp_join_splitted_slot (res, bnd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper function to do the actual work for expand_builtin_memset. The
|
||||
arguments to the builtin_memset call DEST, VAL, and LEN are broken out
|
||||
so that this can also be called without constructing an actual CALL_EXPR.
|
||||
|
@ -4363,8 +4264,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
|
|||
do_libcall:
|
||||
fndecl = get_callee_fndecl (orig_exp);
|
||||
fcode = DECL_FUNCTION_CODE (fndecl);
|
||||
if (fcode == BUILT_IN_MEMSET
|
||||
|| fcode == BUILT_IN_CHKP_MEMSET_NOBND_NOCHK_CHKP)
|
||||
if (fcode == BUILT_IN_MEMSET)
|
||||
fn = build_call_nofold_loc (EXPR_LOCATION (orig_exp), fndecl, 3,
|
||||
dest, val, len);
|
||||
else if (fcode == BUILT_IN_BZERO)
|
||||
|
@ -4889,13 +4789,6 @@ std_expand_builtin_va_start (tree valist, rtx nextarg)
|
|||
{
|
||||
rtx va_r = expand_expr (valist, NULL_RTX, VOIDmode, EXPAND_WRITE);
|
||||
convert_move (va_r, nextarg, 0);
|
||||
|
||||
/* We do not have any valid bounds for the pointer, so
|
||||
just store zero bounds for it. */
|
||||
if (chkp_function_instrumented_p (current_function_decl))
|
||||
chkp_expand_bounds_reset_for_mem (valist,
|
||||
make_tree (TREE_TYPE (valist),
|
||||
nextarg));
|
||||
}
|
||||
|
||||
/* Expand EXP, a call to __builtin_va_start. */
|
||||
|
@ -6766,19 +6659,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode,
|
|||
&& fcode != BUILT_IN_EXECVP
|
||||
&& fcode != BUILT_IN_EXECVE
|
||||
&& !ALLOCA_FUNCTION_CODE_P (fcode)
|
||||
&& fcode != BUILT_IN_FREE
|
||||
&& fcode != BUILT_IN_CHKP_SET_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_INIT_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_NULL_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_COPY_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_NARROW_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_STORE_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_CHECK_PTR_LBOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_CHECK_PTR_UBOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_CHECK_PTR_BOUNDS
|
||||
&& fcode != BUILT_IN_CHKP_GET_PTR_LBOUND
|
||||
&& fcode != BUILT_IN_CHKP_GET_PTR_UBOUND
|
||||
&& fcode != BUILT_IN_CHKP_BNDRET)
|
||||
&& fcode != BUILT_IN_FREE)
|
||||
return expand_call (exp, target, ignore);
|
||||
|
||||
/* The built-in function expanders test for target == const0_rtx
|
||||
|
@ -6812,10 +6693,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode,
|
|||
}
|
||||
}
|
||||
|
||||
/* expand_builtin_with_bounds is supposed to be used for
|
||||
instrumented builtin calls. */
|
||||
gcc_assert (!CALL_WITH_BOUNDS_P (exp));
|
||||
|
||||
switch (fcode)
|
||||
{
|
||||
CASE_FLT_FN (BUILT_IN_FABS):
|
||||
|
@ -7840,51 +7717,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode,
|
|||
expand_builtin_set_thread_pointer (exp);
|
||||
return const0_rtx;
|
||||
|
||||
case BUILT_IN_CHKP_INIT_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_NULL_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_COPY_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_CHECK_PTR_LBOUNDS:
|
||||
case BUILT_IN_CHKP_CHECK_PTR_UBOUNDS:
|
||||
case BUILT_IN_CHKP_CHECK_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_SET_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_NARROW_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_STORE_PTR_BOUNDS:
|
||||
case BUILT_IN_CHKP_GET_PTR_LBOUND:
|
||||
case BUILT_IN_CHKP_GET_PTR_UBOUND:
|
||||
/* We allow user CHKP builtins if Pointer Bounds
|
||||
Checker is off. */
|
||||
if (!chkp_function_instrumented_p (current_function_decl))
|
||||
{
|
||||
if (fcode == BUILT_IN_CHKP_SET_PTR_BOUNDS
|
||||
|| fcode == BUILT_IN_CHKP_NARROW_PTR_BOUNDS
|
||||
|| fcode == BUILT_IN_CHKP_INIT_PTR_BOUNDS
|
||||
|| fcode == BUILT_IN_CHKP_NULL_PTR_BOUNDS
|
||||
|| fcode == BUILT_IN_CHKP_COPY_PTR_BOUNDS)
|
||||
return expand_normal (CALL_EXPR_ARG (exp, 0));
|
||||
else if (fcode == BUILT_IN_CHKP_GET_PTR_LBOUND)
|
||||
return expand_normal (size_zero_node);
|
||||
else if (fcode == BUILT_IN_CHKP_GET_PTR_UBOUND)
|
||||
return expand_normal (size_int (-1));
|
||||
else
|
||||
return const0_rtx;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case BUILT_IN_CHKP_BNDMK:
|
||||
case BUILT_IN_CHKP_BNDSTX:
|
||||
case BUILT_IN_CHKP_BNDCL:
|
||||
case BUILT_IN_CHKP_BNDCU:
|
||||
case BUILT_IN_CHKP_BNDLDX:
|
||||
case BUILT_IN_CHKP_BNDRET:
|
||||
case BUILT_IN_CHKP_INTERSECT:
|
||||
case BUILT_IN_CHKP_NARROW:
|
||||
case BUILT_IN_CHKP_EXTRACT_LOWER:
|
||||
case BUILT_IN_CHKP_EXTRACT_UPPER:
|
||||
/* Software implementation of Pointer Bounds Checker is NYI.
|
||||
Target support is required. */
|
||||
error ("Your target platform does not support -fcheck-pointer-bounds");
|
||||
break;
|
||||
|
||||
case BUILT_IN_ACC_ON_DEVICE:
|
||||
/* Do library call, if we failed to expand the builtin when
|
||||
folding. */
|
||||
|
@ -7903,70 +7735,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode,
|
|||
return expand_call (exp, target, ignore);
|
||||
}
|
||||
|
||||
/* Similar to expand_builtin but is used for instrumented calls. */
|
||||
|
||||
rtx
|
||||
expand_builtin_with_bounds (tree exp, rtx target,
|
||||
rtx subtarget ATTRIBUTE_UNUSED,
|
||||
machine_mode mode, int ignore)
|
||||
{
|
||||
tree fndecl = get_callee_fndecl (exp);
|
||||
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
|
||||
|
||||
gcc_assert (CALL_WITH_BOUNDS_P (exp));
|
||||
|
||||
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
|
||||
return targetm.expand_builtin (exp, target, subtarget, mode, ignore);
|
||||
|
||||
gcc_assert (fcode > BEGIN_CHKP_BUILTINS
|
||||
&& fcode < END_CHKP_BUILTINS);
|
||||
|
||||
switch (fcode)
|
||||
{
|
||||
case BUILT_IN_CHKP_MEMCPY_NOBND_NOCHK_CHKP:
|
||||
target = expand_builtin_memcpy_with_bounds (exp, target);
|
||||
if (target)
|
||||
return target;
|
||||
break;
|
||||
|
||||
case BUILT_IN_CHKP_MEMPCPY_NOBND_NOCHK_CHKP:
|
||||
target = expand_builtin_mempcpy_with_bounds (exp, target);
|
||||
if (target)
|
||||
return target;
|
||||
break;
|
||||
|
||||
case BUILT_IN_CHKP_MEMSET_NOBND_NOCHK_CHKP:
|
||||
target = expand_builtin_memset_with_bounds (exp, target, mode);
|
||||
if (target)
|
||||
return target;
|
||||
break;
|
||||
|
||||
case BUILT_IN_MEMCPY_CHKP:
|
||||
case BUILT_IN_MEMMOVE_CHKP:
|
||||
case BUILT_IN_MEMPCPY_CHKP:
|
||||
if (call_expr_nargs (exp) > 3)
|
||||
{
|
||||
/* memcpy_chkp (void *dst, size_t dstbnd,
|
||||
const void *src, size_t srcbnd, size_t n)
|
||||
and others take a pointer bound argument just after each
|
||||
pointer argument. */
|
||||
tree dest = CALL_EXPR_ARG (exp, 0);
|
||||
tree src = CALL_EXPR_ARG (exp, 2);
|
||||
tree len = CALL_EXPR_ARG (exp, 4);
|
||||
|
||||
check_memop_access (exp, dest, src, len);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* The switch statement above can drop through to cause the function
|
||||
to be called normally. */
|
||||
return expand_call (exp, target, ignore);
|
||||
}
|
||||
|
||||
/* Determine whether a tree node represents a call to a built-in
|
||||
function. If the tree T is a call to a built-in function with
|
||||
the right number of arguments of the appropriate types, return
|
||||
|
|
|
@ -63,16 +63,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
|
||||
The builtins is registered only if COND is true. */
|
||||
|
||||
/* A macro for builtins where the
|
||||
BUILT_IN_*_CHKP = BUILT_IN_* + BEGIN_CHKP_BUILTINS + 1
|
||||
enums should be defined too. */
|
||||
#ifndef DEF_BUILTIN_CHKP
|
||||
#define DEF_BUILTIN_CHKP(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, \
|
||||
FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT, COND) \
|
||||
DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \
|
||||
NONANSI_P, ATTRS, IMPLICIT, COND)
|
||||
#endif
|
||||
|
||||
/* A GCC builtin (like __builtin_saveregs) is provided by the
|
||||
compiler, but does not correspond to a function in the standard
|
||||
library. */
|
||||
|
@ -110,10 +100,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, false, ATTRS, true, true)
|
||||
#undef DEF_LIB_BUILTIN_CHKP
|
||||
#define DEF_LIB_BUILTIN_CHKP(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, \
|
||||
TYPE, true, true, false, ATTRS, true, true)
|
||||
|
||||
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
|
||||
specified by ANSI/ISO C. So, when we're being fully conformant we
|
||||
|
@ -123,10 +109,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, true, ATTRS, false, true)
|
||||
#undef DEF_EXT_LIB_BUILTIN_CHKP
|
||||
#define DEF_EXT_LIB_BUILTIN_CHKP(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, \
|
||||
TYPE, true, true, true, ATTRS, false, true)
|
||||
|
||||
/* A set of GCC builtins for _FloatN and _FloatNx types. TYPE_MACRO is called
|
||||
with an argument such as FLOAT32 to produce the enum value for the type. If
|
||||
|
@ -259,12 +241,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
| SANITIZE_UNDEFINED_NONDEFAULT) \
|
||||
|| flag_sanitize_coverage))
|
||||
|
||||
/* Builtin used by the implementation of Pointer Bounds Checker. */
|
||||
#undef DEF_CHKP_BUILTIN
|
||||
#define DEF_CHKP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, \
|
||||
TYPE, true, true, false, ATTRS, true, true)
|
||||
|
||||
/* Define an attribute list for math functions that are normally
|
||||
"impure" because some of them may write into global memory for
|
||||
`errno'. If !flag_errno_math they are instead "const". */
|
||||
|
@ -713,22 +689,22 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHR
|
|||
DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCHR, "memchr", BT_FN_PTR_CONST_PTR_INT_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN_CHKP (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
|
@ -978,14 +954,14 @@ DEF_BUILTIN_STUB (BUILT_IN_STRNCMP_EQ, "__builtin_strncmp_eq")
|
|||
|
||||
/* Object size checking builtins. */
|
||||
DEF_GCC_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY_CHK, "__stpncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_RETNONNULL_NOTHROW_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SNPRINTF_CHK, "__snprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_NOTHROW_5_6)
|
||||
|
@ -1053,9 +1029,6 @@ DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
|
|||
/* Sanitizer builtins. */
|
||||
#include "sanitizer.def"
|
||||
|
||||
/* Pointer Bounds Checker builtins. */
|
||||
#include "chkp-builtins.def"
|
||||
|
||||
/* Do not expose the BRIG builtins by default gcc-wide, but only privately in
|
||||
the BRIG FE as long as there are no references for them in the middle end
|
||||
or any of the upstream backends. */
|
||||
|
@ -1099,5 +1072,4 @@ DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
|
|||
/* HSAIL/BRIG frontend builtins. */
|
||||
#include "brig-builtins.def"
|
||||
|
||||
#undef DEF_BUILTIN_CHKP
|
||||
#undef DEF_BUILTIN
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* c-attribs.c (handle_bnd_variable_size_attribute): Remove support
|
||||
for MPX (macros, related functions, fields in cgraph_node, ...).
|
||||
(handle_bnd_legacy): Likewise.
|
||||
(handle_bnd_instrument): Likewise.
|
||||
* c.opt: Likewise.
|
||||
|
||||
2018-06-06 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/86068
|
||||
|
|
|
@ -143,9 +143,6 @@ static tree handle_simd_attribute (tree *, tree, tree, int, bool *);
|
|||
static tree handle_omp_declare_target_attribute (tree *, tree, tree, int,
|
||||
bool *);
|
||||
static tree handle_designated_init_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_bnd_variable_size_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_bnd_legacy (tree *, tree, tree, int, bool *);
|
||||
static tree handle_bnd_instrument (tree *, tree, tree, int, bool *);
|
||||
static tree handle_fallthrough_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_patchable_function_entry_attribute (tree *, tree, tree,
|
||||
int, bool *);
|
||||
|
@ -239,9 +236,6 @@ static const struct attribute_spec::exclusions attr_const_pure_exclusions[] =
|
|||
|
||||
/* Table of machine-independent attributes common to all C-like languages.
|
||||
|
||||
All attributes referencing arguments should be additionally processed
|
||||
in chkp_copy_function_type_adding_bounds for correct instrumentation
|
||||
by Pointer Bounds Checker.
|
||||
Current list of processed common attributes: nonnull. */
|
||||
const struct attribute_spec c_common_attribute_table[] =
|
||||
{
|
||||
|
@ -452,12 +446,6 @@ const struct attribute_spec c_common_attribute_table[] =
|
|||
handle_assume_aligned_attribute, NULL },
|
||||
{ "designated_init", 0, 0, false, true, false, false,
|
||||
handle_designated_init_attribute, NULL },
|
||||
{ "bnd_variable_size", 0, 0, true, false, false, false,
|
||||
handle_bnd_variable_size_attribute, NULL },
|
||||
{ "bnd_legacy", 0, 0, true, false, false, false,
|
||||
handle_bnd_legacy, NULL },
|
||||
{ "bnd_instrument", 0, 0, true, false, false, false,
|
||||
handle_bnd_instrument, NULL },
|
||||
{ "fallthrough", 0, 0, false, false, false, false,
|
||||
handle_fallthrough_attribute, NULL },
|
||||
{ "patchable_function_entry", 1, 2, true, false, false, false,
|
||||
|
@ -471,9 +459,6 @@ const struct attribute_spec c_common_attribute_table[] =
|
|||
/* Give the specifications for the format attributes, used by C and all
|
||||
descendants.
|
||||
|
||||
All attributes referencing arguments should be additionally processed
|
||||
in chkp_copy_function_type_adding_bounds for correct instrumentation
|
||||
by Pointer Bounds Checker.
|
||||
Current list of processed format attributes: format, format_arg. */
|
||||
const struct attribute_spec c_common_format_attribute_table[] =
|
||||
{
|
||||
|
@ -2489,54 +2474,6 @@ handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name),
|
|||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "bnd_variable_size" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_bnd_variable_size_attribute (tree *node, tree name, tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
if (TREE_CODE (*node) != FIELD_DECL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "bnd_legacy" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_bnd_legacy (tree *node, tree name, tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
if (TREE_CODE (*node) != FUNCTION_DECL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "bnd_instrument" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_bnd_instrument (tree *node, tree name, tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
if (TREE_CODE (*node) != FUNCTION_DECL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "warn_unused" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ Warn about subscripts whose type is \"char\".
|
|||
|
||||
Wchkp
|
||||
C ObjC C++ ObjC++ Var(warn_chkp) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
|
||||
Warn about memory access errors found by Pointer Bounds Checker.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
Wclobbered
|
||||
C ObjC C++ ObjC++ Var(warn_clobbered) Warning EnabledBy(Wextra)
|
||||
|
@ -1260,97 +1260,86 @@ Where shorter, use canonicalized paths to systems headers.
|
|||
|
||||
fcheck-pointer-bounds
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds)
|
||||
Add Pointer Bounds Checker instrumentation. fchkp-* flags are used to
|
||||
control instrumentation. Currently available for C, C++ and ObjC.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-check-incomplete-type
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_incomplete_type) Init(1)
|
||||
Generate pointer bounds checks for variables with incomplete type.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-zero-input-bounds-for-main
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_input_bounds_for_main) Init(0)
|
||||
Use zero bounds for all incoming arguments in 'main' function. It helps when
|
||||
instrumented binaries are used with legacy libs.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-first-field-has-own-bounds
|
||||
C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_first_field_has_own_bounds)
|
||||
Forces Pointer Bounds Checker to use narrowed bounds for address of the first
|
||||
field in the structure. By default pointer to the first field has the same
|
||||
bounds as pointer to the whole structure.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-narrow-bounds
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_narrow_bounds) Init(1)
|
||||
Control how Pointer Bounds Checker handle pointers to object fields. When
|
||||
narrowing is on, field bounds are used. Otherwise full object bounds are used.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-narrow-to-innermost-array
|
||||
C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_narrow_to_innermost_arrray)
|
||||
Forces Pointer Bounds Checker to use bounds of the innermost arrays in case of
|
||||
nested static arrays access. By default outermost array is used.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-flexible-struct-trailing-arrays
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_flexible_struct_trailing_arrays)
|
||||
Forces Pointer Bounds Checker to treat all trailing arrays in structures as
|
||||
possibly flexible. By default only arrays fields with zero length or that are
|
||||
marked with attribute bnd_variable_size are treated as flexible.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-optimize
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_optimize) Init(-1)
|
||||
Allow Pointer Bounds Checker optimizations. By default allowed
|
||||
on optimization levels >0.
|
||||
|
||||
fchkp-use-fast-string-functions
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_fast_string_functions) Init(0)
|
||||
Allow to use *_nobnd versions of string functions by Pointer Bounds Checker.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-use-nochk-string-functions
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_nochk_string_functions) Init(0)
|
||||
Allow to use *_nochk versions of string functions by Pointer Bounds Checker.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-use-static-bounds
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_bounds) Init(1)
|
||||
Use statically initialized variable for vars bounds instead of
|
||||
generating them each time it is required.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-use-static-const-bounds
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_const_bounds) Init(-1)
|
||||
Use statically initialized variable for constant bounds instead of
|
||||
generating them each time it is required.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-treat-zero-dynamic-size-as-infinite
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_dynamic_size_as_infinite) Init(0)
|
||||
With this option zero size obtained dynamically for objects with
|
||||
incomplete type will be treated as infinite.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-check-read
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_read) Init(1)
|
||||
Generate checks for all read accesses to memory.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-check-write
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_write) Init(1)
|
||||
Generate checks for all write accesses to memory.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-store-bounds
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_store_bounds) Init(1)
|
||||
Generate bounds stores for pointer writes.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-instrument-calls
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_calls) Init(1)
|
||||
Generate bounds passing for calls.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-instrument-marked-only
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0)
|
||||
Instrument only functions marked with bnd_instrument attribute.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fchkp-use-wrappers
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_wrappers) Init(1)
|
||||
Transform instrumented builtin calls into calls to wrappers.
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
static-libmpx
|
||||
Driver
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
static-libmpxwrappers
|
||||
Driver
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
fcilkplus Undocumented
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_cilkplus) Init(0)
|
||||
|
|
214
gcc/calls.c
214
gcc/calls.c
|
@ -47,10 +47,8 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "except.h"
|
||||
#include "dbgcnt.h"
|
||||
#include "rtl-iter.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "tree-vrp.h"
|
||||
#include "tree-ssanames.h"
|
||||
#include "rtl-chkp.h"
|
||||
#include "intl.h"
|
||||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
|
@ -154,7 +152,6 @@ static unsigned HOST_WIDE_INT stored_args_watermark;
|
|||
static int stack_arg_under_construction;
|
||||
|
||||
static void precompute_register_parameters (int, struct arg_data *, int *);
|
||||
static void store_bounds (struct arg_data *, struct arg_data *);
|
||||
static int store_one_arg (struct arg_data *, rtx, int, int, int);
|
||||
static void store_unaligned_arguments_into_pseudos (struct arg_data *, int);
|
||||
static int finalize_must_preallocate (int, int, struct arg_data *,
|
||||
|
@ -488,10 +485,6 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
|
|||
&& MEM_EXPR (funmem) != NULL_TREE)
|
||||
set_mem_expr (XEXP (call, 0), MEM_EXPR (funmem));
|
||||
|
||||
/* Mark instrumented calls. */
|
||||
if (call && fntree)
|
||||
CALL_EXPR_WITH_BOUNDS_P (call) = CALL_WITH_BOUNDS_P (fntree);
|
||||
|
||||
/* Put the register usage information there. */
|
||||
add_function_usage_to (call_insn, call_fusage);
|
||||
|
||||
|
@ -598,12 +591,6 @@ special_function_p (const_tree fndecl, int flags)
|
|||
{
|
||||
tree name_decl = DECL_NAME (fndecl);
|
||||
|
||||
/* For instrumentation clones we want to derive flags
|
||||
from the original name. */
|
||||
if (cgraph_node::get (fndecl)
|
||||
&& cgraph_node::get (fndecl)->instrumentation_clone)
|
||||
name_decl = DECL_NAME (cgraph_node::get (fndecl)->orig_decl);
|
||||
|
||||
if (fndecl && name_decl
|
||||
&& IDENTIFIER_LENGTH (name_decl) <= 11
|
||||
/* Exclude functions not at the file scope, or not `extern',
|
||||
|
@ -1626,8 +1613,6 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
|
|||
if (!fndecl || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
|
||||
return;
|
||||
|
||||
bool with_bounds = CALL_WITH_BOUNDS_P (exp);
|
||||
|
||||
unsigned nargs = call_expr_nargs (exp);
|
||||
|
||||
/* The bound argument to a bounded string function like strncpy. */
|
||||
|
@ -1651,8 +1636,7 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
|
|||
the range of their known or possible lengths and use it
|
||||
conservatively as the bound for the unbounded function,
|
||||
and to adjust the range of the bound of the bounded ones. */
|
||||
unsigned stride = with_bounds ? 2 : 1;
|
||||
for (unsigned argno = 0; argno < nargs && !*lenrng; argno += stride)
|
||||
for (unsigned argno = 0; argno < nargs && !*lenrng; argno ++)
|
||||
{
|
||||
tree arg = CALL_EXPR_ARG (exp, argno);
|
||||
if (!get_attr_nonstring_decl (arg))
|
||||
|
@ -1662,11 +1646,9 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
|
|||
/* Fall through. */
|
||||
|
||||
case BUILT_IN_STPNCPY:
|
||||
case BUILT_IN_STPNCPY_CHK:
|
||||
case BUILT_IN_STRNCPY:
|
||||
case BUILT_IN_STRNCPY_CHK:
|
||||
{
|
||||
unsigned argno = with_bounds ? 4 : 2;
|
||||
unsigned argno = 2;
|
||||
if (argno < nargs)
|
||||
bound = CALL_EXPR_ARG (exp, argno);
|
||||
break;
|
||||
|
@ -1674,7 +1656,7 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
|
|||
|
||||
case BUILT_IN_STRNDUP:
|
||||
{
|
||||
unsigned argno = with_bounds ? 2 : 1;
|
||||
unsigned argno = 1;
|
||||
if (argno < nargs)
|
||||
bound = CALL_EXPR_ARG (exp, argno);
|
||||
break;
|
||||
|
@ -1879,7 +1861,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
|
|||
|
||||
i = num_actuals - 1;
|
||||
{
|
||||
int j = i, ptr_arg = -1;
|
||||
int j = i;
|
||||
call_expr_arg_iterator iter;
|
||||
tree arg;
|
||||
bitmap slots = NULL;
|
||||
|
@ -1888,79 +1870,12 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
|
|||
{
|
||||
args[j].tree_value = struct_value_addr_value;
|
||||
j--;
|
||||
|
||||
/* If we pass structure address then we need to
|
||||
create bounds for it. Since created bounds is
|
||||
a call statement, we expand it right here to avoid
|
||||
fixing all other places where it may be expanded. */
|
||||
if (CALL_WITH_BOUNDS_P (exp))
|
||||
{
|
||||
args[j].value = gen_reg_rtx (targetm.chkp_bound_mode ());
|
||||
args[j].tree_value
|
||||
= chkp_make_bounds_for_struct_addr (struct_value_addr_value);
|
||||
expand_expr_real (args[j].tree_value, args[j].value, VOIDmode,
|
||||
EXPAND_NORMAL, 0, false);
|
||||
args[j].pointer_arg = j + 1;
|
||||
j--;
|
||||
}
|
||||
}
|
||||
argpos = 0;
|
||||
FOR_EACH_CALL_EXPR_ARG (arg, iter, exp)
|
||||
{
|
||||
tree argtype = TREE_TYPE (arg);
|
||||
|
||||
/* Remember last param with pointer and associate it
|
||||
with following pointer bounds. */
|
||||
if (CALL_WITH_BOUNDS_P (exp)
|
||||
&& chkp_type_has_pointer (argtype))
|
||||
{
|
||||
if (slots)
|
||||
BITMAP_FREE (slots);
|
||||
ptr_arg = j;
|
||||
if (!BOUNDED_TYPE_P (argtype))
|
||||
{
|
||||
slots = BITMAP_ALLOC (NULL);
|
||||
chkp_find_bound_slots (argtype, slots);
|
||||
}
|
||||
}
|
||||
else if (CALL_WITH_BOUNDS_P (exp)
|
||||
&& pass_by_reference (NULL, TYPE_MODE (argtype), argtype,
|
||||
argpos < n_named_args))
|
||||
{
|
||||
if (slots)
|
||||
BITMAP_FREE (slots);
|
||||
ptr_arg = j;
|
||||
}
|
||||
else if (POINTER_BOUNDS_TYPE_P (argtype))
|
||||
{
|
||||
/* We expect bounds in instrumented calls only.
|
||||
Otherwise it is a sign we lost flag due to some optimization
|
||||
and may emit call args incorrectly. */
|
||||
gcc_assert (CALL_WITH_BOUNDS_P (exp));
|
||||
|
||||
/* For structures look for the next available pointer. */
|
||||
if (ptr_arg != -1 && slots)
|
||||
{
|
||||
unsigned bnd_no = bitmap_first_set_bit (slots);
|
||||
args[j].pointer_offset =
|
||||
bnd_no * POINTER_SIZE / BITS_PER_UNIT;
|
||||
|
||||
bitmap_clear_bit (slots, bnd_no);
|
||||
|
||||
/* Check we have no more pointers in the structure. */
|
||||
if (bitmap_empty_p (slots))
|
||||
BITMAP_FREE (slots);
|
||||
}
|
||||
args[j].pointer_arg = ptr_arg;
|
||||
|
||||
/* Check we covered all pointers in the previous
|
||||
non bounds arg. */
|
||||
if (!slots)
|
||||
ptr_arg = -1;
|
||||
}
|
||||
else
|
||||
ptr_arg = -1;
|
||||
|
||||
if (targetm.calls.split_complex_arg
|
||||
&& argtype
|
||||
&& TREE_CODE (argtype) == COMPLEX_TYPE
|
||||
|
@ -2205,11 +2120,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
|
|||
|| (args[i].pass_on_stack && args[i].reg != 0))
|
||||
*must_preallocate = 1;
|
||||
|
||||
/* No stack allocation and padding for bounds. */
|
||||
if (POINTER_BOUNDS_P (args[i].tree_value))
|
||||
;
|
||||
/* Compute the stack-size of this argument. */
|
||||
else if (args[i].reg == 0 || args[i].partial != 0
|
||||
if (args[i].reg == 0 || args[i].partial != 0
|
||||
|| reg_parm_stack_space > 0
|
||||
|| args[i].pass_on_stack)
|
||||
locate_and_pad_parm (mode, type,
|
||||
|
@ -2442,12 +2354,6 @@ finalize_must_preallocate (int must_preallocate, int num_actuals,
|
|||
partial_seen = 1;
|
||||
else if (partial_seen && args[i].reg == 0)
|
||||
must_preallocate = 1;
|
||||
/* We preallocate in case there are bounds passed
|
||||
in the bounds table to have precomputed address
|
||||
for bounds association. */
|
||||
else if (POINTER_BOUNDS_P (args[i].tree_value)
|
||||
&& !args[i].reg)
|
||||
must_preallocate = 1;
|
||||
|
||||
if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
|
||||
&& (TREE_CODE (args[i].tree_value) == CALL_EXPR
|
||||
|
@ -2506,10 +2412,6 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals
|
|||
if (TYPE_EMPTY_P (TREE_TYPE (args[i].tree_value)))
|
||||
continue;
|
||||
|
||||
/* Pointer Bounds are never passed on the stack. */
|
||||
if (POINTER_BOUNDS_P (args[i].tree_value))
|
||||
continue;
|
||||
|
||||
addr = simplify_gen_binary (PLUS, Pmode, arg_reg, offset);
|
||||
addr = plus_constant (Pmode, addr, arg_offset);
|
||||
|
||||
|
@ -3320,8 +3222,6 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
/* Register in which non-BLKmode value will be returned,
|
||||
or 0 if no value or if value is BLKmode. */
|
||||
rtx valreg;
|
||||
/* Register(s) in which bounds are returned. */
|
||||
rtx valbnd = NULL;
|
||||
/* Address where we should return a BLKmode value;
|
||||
0 if value not BLKmode. */
|
||||
rtx structure_value_addr = 0;
|
||||
|
@ -3589,7 +3489,7 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
|
||||
structure_value_addr_value =
|
||||
make_tree (build_pointer_type (TREE_TYPE (funtype)), temp);
|
||||
structure_value_addr_parm = CALL_WITH_BOUNDS_P (exp) ? 2 : 1;
|
||||
structure_value_addr_parm = 1;
|
||||
}
|
||||
|
||||
/* Count the arguments and set NUM_ACTUALS. */
|
||||
|
@ -4126,10 +4026,7 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
|
||||
for (i = 0; i < num_actuals; i++)
|
||||
{
|
||||
/* Delay bounds until all other args are stored. */
|
||||
if (POINTER_BOUNDS_P (args[i].tree_value))
|
||||
continue;
|
||||
else if (args[i].reg == 0 || args[i].pass_on_stack)
|
||||
if (args[i].reg == 0 || args[i].pass_on_stack)
|
||||
{
|
||||
rtx_insn *before_arg = get_last_insn ();
|
||||
|
||||
|
@ -4203,28 +4100,15 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
|
||||
/* Figure out the register where the value, if any, will come back. */
|
||||
valreg = 0;
|
||||
valbnd = 0;
|
||||
if (TYPE_MODE (rettype) != VOIDmode
|
||||
&& ! structure_value_addr)
|
||||
{
|
||||
if (pcc_struct_value)
|
||||
{
|
||||
valreg = hard_function_value (build_pointer_type (rettype),
|
||||
fndecl, NULL, (pass == 0));
|
||||
if (CALL_WITH_BOUNDS_P (exp))
|
||||
valbnd = targetm.calls.
|
||||
chkp_function_value_bounds (build_pointer_type (rettype),
|
||||
fndecl, (pass == 0));
|
||||
}
|
||||
valreg = hard_function_value (build_pointer_type (rettype),
|
||||
fndecl, NULL, (pass == 0));
|
||||
else
|
||||
{
|
||||
valreg = hard_function_value (rettype, fndecl, fntype,
|
||||
(pass == 0));
|
||||
if (CALL_WITH_BOUNDS_P (exp))
|
||||
valbnd = targetm.calls.chkp_function_value_bounds (rettype,
|
||||
fndecl,
|
||||
(pass == 0));
|
||||
}
|
||||
valreg = hard_function_value (rettype, fndecl, fntype,
|
||||
(pass == 0));
|
||||
|
||||
/* If VALREG is a PARALLEL whose first member has a zero
|
||||
offset, use that. This is for targets such as m68k that
|
||||
|
@ -4240,17 +4124,6 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
}
|
||||
}
|
||||
|
||||
/* Store all bounds not passed in registers. */
|
||||
for (i = 0; i < num_actuals; i++)
|
||||
{
|
||||
if (POINTER_BOUNDS_P (args[i].tree_value)
|
||||
&& !args[i].reg)
|
||||
store_bounds (&args[i],
|
||||
args[i].pointer_arg == -1
|
||||
? NULL
|
||||
: &args[args[i].pointer_arg]);
|
||||
}
|
||||
|
||||
/* If register arguments require space on the stack and stack space
|
||||
was not preallocated, allocate stack space here for arguments
|
||||
passed in registers. */
|
||||
|
@ -4655,10 +4528,6 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
|
||||
free (stack_usage_map_buf);
|
||||
free (args);
|
||||
|
||||
/* Join result with returned bounds so caller may use them if needed. */
|
||||
target = chkp_join_splitted_slot (target, valbnd);
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
|
@ -5513,67 +5382,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
|
|||
}
|
||||
|
||||
|
||||
/* Store pointer bounds argument ARG into Bounds Table entry
|
||||
associated with PARM. */
|
||||
static void
|
||||
store_bounds (struct arg_data *arg, struct arg_data *parm)
|
||||
{
|
||||
rtx slot = NULL, ptr = NULL, addr = NULL;
|
||||
|
||||
/* We may pass bounds not associated with any pointer. */
|
||||
if (!parm)
|
||||
{
|
||||
gcc_assert (arg->special_slot);
|
||||
slot = arg->special_slot;
|
||||
ptr = const0_rtx;
|
||||
}
|
||||
/* Find pointer associated with bounds and where it is
|
||||
passed. */
|
||||
else
|
||||
{
|
||||
if (!parm->reg)
|
||||
{
|
||||
gcc_assert (!arg->special_slot);
|
||||
|
||||
addr = adjust_address (parm->stack, Pmode, arg->pointer_offset);
|
||||
}
|
||||
else if (REG_P (parm->reg))
|
||||
{
|
||||
gcc_assert (arg->special_slot);
|
||||
slot = arg->special_slot;
|
||||
|
||||
if (MEM_P (parm->value))
|
||||
addr = adjust_address (parm->value, Pmode, arg->pointer_offset);
|
||||
else if (REG_P (parm->value))
|
||||
ptr = gen_rtx_SUBREG (Pmode, parm->value, arg->pointer_offset);
|
||||
else
|
||||
{
|
||||
gcc_assert (!arg->pointer_offset);
|
||||
ptr = parm->value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gcc_assert (GET_CODE (parm->reg) == PARALLEL);
|
||||
|
||||
gcc_assert (arg->special_slot);
|
||||
slot = arg->special_slot;
|
||||
|
||||
if (parm->parallel_value)
|
||||
ptr = chkp_get_value_with_offs (parm->parallel_value,
|
||||
GEN_INT (arg->pointer_offset));
|
||||
else
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Expand bounds. */
|
||||
if (!arg->value)
|
||||
arg->value = expand_normal (arg->tree_value);
|
||||
|
||||
targetm.calls.store_bounds_for_arg (ptr, addr, arg->value, slot);
|
||||
}
|
||||
|
||||
/* Store a single argument for a function call
|
||||
into the register or memory area where it must be passed.
|
||||
*ARG describes the argument value and where to pass it.
|
||||
|
|
|
@ -74,8 +74,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tree-ssa-address.h"
|
||||
#include "output.h"
|
||||
#include "builtins.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "rtl-chkp.h"
|
||||
|
||||
/* Some systems use __main in a way incompatible with its use in gcc, in these
|
||||
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
|
||||
|
@ -2665,7 +2663,6 @@ expand_call_stmt (gcall *stmt)
|
|||
CALL_EXPR_VA_ARG_PACK (exp) = gimple_call_va_arg_pack_p (stmt);
|
||||
CALL_EXPR_BY_DESCRIPTOR (exp) = gimple_call_by_descriptor_p (stmt);
|
||||
SET_EXPR_LOCATION (exp, gimple_location (stmt));
|
||||
CALL_WITH_BOUNDS_P (exp) = gimple_call_with_bounds_p (stmt);
|
||||
|
||||
/* Ensure RTL is created for debug args. */
|
||||
if (decl && DECL_HAS_DEBUG_ARGS_P (decl))
|
||||
|
@ -3444,12 +3441,11 @@ expand_value_return (rtx val)
|
|||
from the current function. */
|
||||
|
||||
static void
|
||||
expand_return (tree retval, tree bounds)
|
||||
expand_return (tree retval)
|
||||
{
|
||||
rtx result_rtl;
|
||||
rtx val = 0;
|
||||
tree retval_rhs;
|
||||
rtx bounds_rtl;
|
||||
|
||||
/* If function wants no value, give it none. */
|
||||
if (TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl))) == VOID_TYPE)
|
||||
|
@ -3475,71 +3471,6 @@ expand_return (tree retval, tree bounds)
|
|||
|
||||
result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
|
||||
|
||||
/* Put returned bounds to the right place. */
|
||||
bounds_rtl = DECL_BOUNDS_RTL (DECL_RESULT (current_function_decl));
|
||||
if (bounds_rtl)
|
||||
{
|
||||
rtx addr = NULL;
|
||||
rtx bnd = NULL;
|
||||
|
||||
if (bounds && bounds != error_mark_node)
|
||||
{
|
||||
bnd = expand_normal (bounds);
|
||||
targetm.calls.store_returned_bounds (bounds_rtl, bnd);
|
||||
}
|
||||
else if (REG_P (bounds_rtl))
|
||||
{
|
||||
if (bounds)
|
||||
bnd = chkp_expand_zero_bounds ();
|
||||
else
|
||||
{
|
||||
addr = expand_normal (build_fold_addr_expr (retval_rhs));
|
||||
addr = gen_rtx_MEM (Pmode, addr);
|
||||
bnd = targetm.calls.load_bounds_for_arg (addr, NULL, NULL);
|
||||
}
|
||||
|
||||
targetm.calls.store_returned_bounds (bounds_rtl, bnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
int n;
|
||||
|
||||
gcc_assert (GET_CODE (bounds_rtl) == PARALLEL);
|
||||
|
||||
if (bounds)
|
||||
bnd = chkp_expand_zero_bounds ();
|
||||
else
|
||||
{
|
||||
addr = expand_normal (build_fold_addr_expr (retval_rhs));
|
||||
addr = gen_rtx_MEM (Pmode, addr);
|
||||
}
|
||||
|
||||
for (n = 0; n < XVECLEN (bounds_rtl, 0); n++)
|
||||
{
|
||||
rtx slot = XEXP (XVECEXP (bounds_rtl, 0, n), 0);
|
||||
if (!bounds)
|
||||
{
|
||||
rtx offs = XEXP (XVECEXP (bounds_rtl, 0, n), 1);
|
||||
rtx from = adjust_address (addr, Pmode, INTVAL (offs));
|
||||
bnd = targetm.calls.load_bounds_for_arg (from, NULL, NULL);
|
||||
}
|
||||
targetm.calls.store_returned_bounds (slot, bnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (chkp_function_instrumented_p (current_function_decl)
|
||||
&& !BOUNDED_P (retval_rhs)
|
||||
&& chkp_type_has_pointer (TREE_TYPE (retval_rhs))
|
||||
&& TREE_CODE (retval_rhs) != RESULT_DECL)
|
||||
{
|
||||
rtx addr = expand_normal (build_fold_addr_expr (retval_rhs));
|
||||
addr = gen_rtx_MEM (Pmode, addr);
|
||||
|
||||
gcc_assert (MEM_P (result_rtl));
|
||||
|
||||
chkp_copy_bounds_for_stack_parm (result_rtl, addr, TREE_TYPE (retval_rhs));
|
||||
}
|
||||
|
||||
/* If we are returning the RESULT_DECL, then the value has already
|
||||
been stored into it, so we don't have to do anything special. */
|
||||
if (TREE_CODE (retval_rhs) == RESULT_DECL)
|
||||
|
@ -3646,19 +3577,12 @@ expand_gimple_stmt_1 (gimple *stmt)
|
|||
|
||||
case GIMPLE_RETURN:
|
||||
{
|
||||
tree bnd = gimple_return_retbnd (as_a <greturn *> (stmt));
|
||||
op0 = gimple_return_retval (as_a <greturn *> (stmt));
|
||||
|
||||
if (op0 && op0 != error_mark_node)
|
||||
{
|
||||
tree result = DECL_RESULT (current_function_decl);
|
||||
|
||||
/* Mark we have return statement with missing bounds. */
|
||||
if (!bnd
|
||||
&& chkp_function_instrumented_p (cfun->decl)
|
||||
&& !DECL_P (op0))
|
||||
bnd = error_mark_node;
|
||||
|
||||
/* If we are not returning the current function's RESULT_DECL,
|
||||
build an assignment to it. */
|
||||
if (op0 != result)
|
||||
|
@ -3680,7 +3604,7 @@ expand_gimple_stmt_1 (gimple *stmt)
|
|||
if (!op0)
|
||||
expand_null_return ();
|
||||
else
|
||||
expand_return (op0, bnd);
|
||||
expand_return (op0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -6267,9 +6191,6 @@ pass_expand::execute (function *fun)
|
|||
|
||||
rtl_profile_for_bb (ENTRY_BLOCK_PTR_FOR_FN (fun));
|
||||
|
||||
if (chkp_function_instrumented_p (current_function_decl))
|
||||
chkp_reset_rtl_bounds ();
|
||||
|
||||
insn_locations_init ();
|
||||
if (!DECL_IS_BUILTIN (current_function_decl))
|
||||
{
|
||||
|
|
127
gcc/cgraph.c
127
gcc/cgraph.c
|
@ -58,7 +58,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tree-dfa.h"
|
||||
#include "profile.h"
|
||||
#include "params.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "context.h"
|
||||
#include "gimplify.h"
|
||||
#include "stringpool.h"
|
||||
|
@ -1275,7 +1274,6 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
|
|||
tree decl = gimple_call_fndecl (e->call_stmt);
|
||||
gcall *new_stmt;
|
||||
gimple_stmt_iterator gsi;
|
||||
bool skip_bounds = false;
|
||||
|
||||
if (e->speculative)
|
||||
{
|
||||
|
@ -1333,24 +1331,6 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
|
|||
e->caller->set_call_stmt_including_clones (e->call_stmt, new_stmt,
|
||||
false);
|
||||
e->count = gimple_bb (e->call_stmt)->count;
|
||||
|
||||
/* Fix edges for BUILT_IN_CHKP_BNDRET calls attached to the
|
||||
processed call stmt. */
|
||||
if (gimple_call_with_bounds_p (new_stmt)
|
||||
&& gimple_call_lhs (new_stmt)
|
||||
&& chkp_retbnd_call_by_val (gimple_call_lhs (e2->call_stmt)))
|
||||
{
|
||||
tree dresult = gimple_call_lhs (new_stmt);
|
||||
tree iresult = gimple_call_lhs (e2->call_stmt);
|
||||
gcall *dbndret = chkp_retbnd_call_by_val (dresult);
|
||||
gcall *ibndret = chkp_retbnd_call_by_val (iresult);
|
||||
struct cgraph_edge *iedge
|
||||
= e2->caller->cgraph_node::get_edge (ibndret);
|
||||
|
||||
if (dbndret)
|
||||
iedge->caller->create_edge (iedge->callee, dbndret, e->count);
|
||||
}
|
||||
|
||||
e2->speculative = false;
|
||||
e2->count = gimple_bb (e2->call_stmt)->count;
|
||||
ref->speculative = false;
|
||||
|
@ -1364,16 +1344,9 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* We might propagate instrumented function pointer into
|
||||
not instrumented function and vice versa. In such a
|
||||
case we need to either fix function declaration or
|
||||
remove bounds from call statement. */
|
||||
if (flag_check_pointer_bounds && e->callee)
|
||||
skip_bounds = chkp_redirect_edge (e);
|
||||
|
||||
if (e->indirect_unknown_callee
|
||||
|| (decl == e->callee->decl
|
||||
&& !skip_bounds))
|
||||
|| decl == e->callee->decl)
|
||||
return e->call_stmt;
|
||||
|
||||
if (flag_checking && decl)
|
||||
|
@ -1395,8 +1368,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (e->callee->clone.combined_args_to_skip
|
||||
|| skip_bounds)
|
||||
if (e->callee->clone.combined_args_to_skip)
|
||||
{
|
||||
int lp_nr;
|
||||
|
||||
|
@ -1405,9 +1377,6 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
|
|||
new_stmt
|
||||
= gimple_call_copy_skip_args (new_stmt,
|
||||
e->callee->clone.combined_args_to_skip);
|
||||
if (skip_bounds)
|
||||
new_stmt = chkp_copy_call_skip_bounds (new_stmt);
|
||||
|
||||
tree old_fntype = gimple_call_fntype (e->call_stmt);
|
||||
gimple_call_set_fndecl (new_stmt, e->callee->decl);
|
||||
cgraph_node *origin = e->callee;
|
||||
|
@ -1906,12 +1875,6 @@ cgraph_node::remove (void)
|
|||
call_site_hash = NULL;
|
||||
}
|
||||
|
||||
if (instrumented_version)
|
||||
{
|
||||
instrumented_version->instrumented_version = NULL;
|
||||
instrumented_version = NULL;
|
||||
}
|
||||
|
||||
symtab->release_symbol (this, uid);
|
||||
}
|
||||
|
||||
|
@ -2234,11 +2197,6 @@ cgraph_node::dump (FILE *f)
|
|||
if (edge->indirect_info->polymorphic)
|
||||
edge->indirect_info->context.dump (f);
|
||||
}
|
||||
|
||||
if (instrumentation_clone)
|
||||
fprintf (f, " Is instrumented version.\n");
|
||||
else if (instrumented_version)
|
||||
fprintf (f, " Has instrumented version.\n");
|
||||
}
|
||||
|
||||
/* Dump call graph node NODE to stderr. */
|
||||
|
@ -3335,9 +3293,7 @@ cgraph_node::verify_node (void)
|
|||
error_found = true;
|
||||
}
|
||||
for (i = 0; iterate_reference (i, ref); i++)
|
||||
if (ref->use == IPA_REF_CHKP)
|
||||
;
|
||||
else if (ref->use != IPA_REF_ALIAS)
|
||||
if (ref->use != IPA_REF_ALIAS)
|
||||
{
|
||||
error ("Alias has non-alias reference");
|
||||
error_found = true;
|
||||
|
@ -3356,77 +3312,6 @@ cgraph_node::verify_node (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* Check instrumented version reference. */
|
||||
if (instrumented_version
|
||||
&& instrumented_version->instrumented_version != this)
|
||||
{
|
||||
error ("Instrumentation clone does not reference original node");
|
||||
error_found = true;
|
||||
}
|
||||
|
||||
/* Cannot have orig_decl for not instrumented nodes. */
|
||||
if (!instrumentation_clone && orig_decl)
|
||||
{
|
||||
error ("Not instrumented node has non-NULL original declaration");
|
||||
error_found = true;
|
||||
}
|
||||
|
||||
/* If original not instrumented node still exists then we may check
|
||||
original declaration is set properly. */
|
||||
if (instrumented_version
|
||||
&& orig_decl
|
||||
&& orig_decl != instrumented_version->decl)
|
||||
{
|
||||
error ("Instrumented node has wrong original declaration");
|
||||
error_found = true;
|
||||
}
|
||||
|
||||
/* Check all nodes have chkp reference to their instrumented versions. */
|
||||
if (analyzed
|
||||
&& instrumented_version
|
||||
&& !instrumentation_clone)
|
||||
{
|
||||
bool ref_found = false;
|
||||
int i;
|
||||
struct ipa_ref *ref;
|
||||
|
||||
for (i = 0; iterate_reference (i, ref); i++)
|
||||
if (ref->use == IPA_REF_CHKP)
|
||||
{
|
||||
if (ref_found)
|
||||
{
|
||||
error ("Node has more than one chkp reference");
|
||||
error_found = true;
|
||||
}
|
||||
if (ref->referred != instrumented_version)
|
||||
{
|
||||
error ("Wrong node is referenced with chkp reference");
|
||||
error_found = true;
|
||||
}
|
||||
ref_found = true;
|
||||
}
|
||||
|
||||
if (!ref_found)
|
||||
{
|
||||
error ("Analyzed node has no reference to instrumented version");
|
||||
error_found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (instrumentation_clone
|
||||
&& DECL_BUILT_IN_CLASS (decl) == NOT_BUILT_IN)
|
||||
{
|
||||
tree name = DECL_ASSEMBLER_NAME (decl);
|
||||
tree orig_name = DECL_ASSEMBLER_NAME (orig_decl);
|
||||
|
||||
if (!IDENTIFIER_TRANSPARENT_ALIAS (name)
|
||||
|| TREE_CHAIN (name) != orig_name)
|
||||
{
|
||||
error ("Alias chain for instrumented node is broken");
|
||||
error_found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (analyzed && thunk.thunk_p)
|
||||
{
|
||||
if (!callees)
|
||||
|
@ -3444,12 +3329,6 @@ cgraph_node::verify_node (void)
|
|||
error ("Thunk is not supposed to have body");
|
||||
error_found = true;
|
||||
}
|
||||
if (thunk.add_pointer_bounds_args
|
||||
&& !instrumented_version->semantically_equivalent_p (callees->callee))
|
||||
{
|
||||
error ("Instrumentation thunk has wrong edge callee");
|
||||
error_found = true;
|
||||
}
|
||||
}
|
||||
else if (analyzed && gimple_has_body_p (decl)
|
||||
&& !TREE_ASM_WRITTEN (decl)
|
||||
|
|
33
gcc/cgraph.h
33
gcc/cgraph.h
|
@ -1362,13 +1362,6 @@ public:
|
|||
cgraph_node *prev_sibling_clone;
|
||||
cgraph_node *clones;
|
||||
cgraph_node *clone_of;
|
||||
/* If instrumentation_clone is 1 then instrumented_version points
|
||||
to the original function used to make instrumented version.
|
||||
Otherwise points to instrumented version of the function. */
|
||||
cgraph_node *instrumented_version;
|
||||
/* If instrumentation_clone is 1 then orig_decl is the original
|
||||
function declaration. */
|
||||
tree orig_decl;
|
||||
/* For functions with many calls sites it holds map from call expression
|
||||
to the edge to speed up cgraph_edge function. */
|
||||
hash_table<cgraph_edge_hasher> *GTY(()) call_site_hash;
|
||||
|
@ -1433,9 +1426,6 @@ public:
|
|||
unsigned calls_comdat_local : 1;
|
||||
/* True if node has been created by merge operation in IPA-ICF. */
|
||||
unsigned icf_merged: 1;
|
||||
/* True when function is clone created for Pointer Bounds Checker
|
||||
instrumentation. */
|
||||
unsigned instrumentation_clone : 1;
|
||||
/* True if call to node can't result in a call to free, munmap or
|
||||
other operation that could make previously non-trapping memory
|
||||
accesses trapping. */
|
||||
|
@ -2386,9 +2376,6 @@ bool ipa_discover_readonly_nonaddressable_vars (void);
|
|||
/* In varpool.c */
|
||||
tree ctor_for_folding (tree);
|
||||
|
||||
/* In tree-chkp.c */
|
||||
extern bool chkp_function_instrumented_p (tree fndecl);
|
||||
|
||||
/* In ipa-inline-analysis.c */
|
||||
void initialize_inline_failed (struct cgraph_edge *);
|
||||
bool speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining);
|
||||
|
@ -2449,8 +2436,6 @@ symtab_node::get_alias_target (void)
|
|||
{
|
||||
ipa_ref *ref = NULL;
|
||||
iterate_reference (0, ref);
|
||||
if (ref->use == IPA_REF_CHKP)
|
||||
iterate_reference (1, ref);
|
||||
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
|
||||
return ref->referred;
|
||||
}
|
||||
|
@ -2905,12 +2890,6 @@ inline bool
|
|||
cgraph_node::can_remove_if_no_direct_calls_and_refs_p (void)
|
||||
{
|
||||
gcc_checking_assert (!global.inlined_to);
|
||||
/* Instrumentation clones should not be removed before
|
||||
instrumentation happens. New callers may appear after
|
||||
instrumentation. */
|
||||
if (instrumentation_clone
|
||||
&& !chkp_function_instrumented_p (decl))
|
||||
return false;
|
||||
/* Extern inlines can always go, we will use the external definition. */
|
||||
if (DECL_EXTERNAL (decl))
|
||||
return true;
|
||||
|
@ -3318,18 +3297,6 @@ ipa_polymorphic_call_context::useless_p () const
|
|||
return (!outer_type && !speculative_outer_type);
|
||||
}
|
||||
|
||||
/* Return true if NODE is local. Instrumentation clones are counted as local
|
||||
only when original function is local. */
|
||||
|
||||
static inline bool
|
||||
cgraph_local_p (cgraph_node *node)
|
||||
{
|
||||
if (!node->instrumentation_clone || !node->instrumented_version)
|
||||
return node->local.local;
|
||||
|
||||
return node->local.local && node->instrumented_version->local.local;
|
||||
}
|
||||
|
||||
/* When using fprintf (or similar), problems can arise with
|
||||
transient generated strings. Many string-generation APIs
|
||||
only support one result being alive at once (e.g. by
|
||||
|
|
|
@ -429,11 +429,6 @@ cgraph_edge::rebuild_edges (void)
|
|||
}
|
||||
record_eh_tables (node, cfun);
|
||||
gcc_assert (!node->global.inlined_to);
|
||||
|
||||
if (node->instrumented_version
|
||||
&& !node->instrumentation_clone)
|
||||
node->create_reference (node->instrumented_version, IPA_REF_CHKP, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -464,10 +459,6 @@ cgraph_edge::rebuild_references (void)
|
|||
node->record_stmt_references (gsi_stmt (gsi));
|
||||
}
|
||||
record_eh_tables (node, cfun);
|
||||
|
||||
if (node->instrumented_version
|
||||
&& !node->instrumentation_clone)
|
||||
node->create_reference (node->instrumented_version, IPA_REF_CHKP, NULL);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -202,7 +202,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "pass_manager.h"
|
||||
#include "tree-nested.h"
|
||||
#include "dbgcnt.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "lto-section-names.h"
|
||||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
|
@ -865,9 +864,6 @@ varpool_node::finalize_decl (tree decl)
|
|||
|| (node->no_reorder
|
||||
&& symtab->state == EXPANSION))
|
||||
node->assemble_decl ();
|
||||
|
||||
if (DECL_INITIAL (decl))
|
||||
chkp_register_var_initializer (decl);
|
||||
}
|
||||
|
||||
/* EDGE is an polymorphic call. Mark all possible targets as reachable
|
||||
|
@ -941,10 +937,6 @@ walk_polymorphic_call_targets (hash_set<void *> *reachable_call_targets,
|
|||
edge->make_direct (target);
|
||||
edge->redirect_call_stmt_to_callee ();
|
||||
|
||||
/* Call to __builtin_unreachable shouldn't be instrumented. */
|
||||
if (!targets.length ())
|
||||
gimple_call_set_with_bounds (edge->call_stmt, false);
|
||||
|
||||
if (symtab->dump_file)
|
||||
{
|
||||
fprintf (symtab->dump_file,
|
||||
|
@ -1924,7 +1916,6 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
|
|||
call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
|
||||
callees->call_stmt = call;
|
||||
gimple_call_set_from_thunk (call, true);
|
||||
gimple_call_set_with_bounds (call, instrumentation_clone);
|
||||
|
||||
/* Return slot optimization is always possible and in fact requred to
|
||||
return values with DECL_BY_REFERENCE. */
|
||||
|
@ -1942,17 +1933,6 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
|
|||
gsi_insert_after (&bsi, call, GSI_NEW_STMT);
|
||||
if (!alias_is_noreturn)
|
||||
{
|
||||
if (instrumentation_clone
|
||||
&& !DECL_BY_REFERENCE (resdecl)
|
||||
&& restmp
|
||||
&& BOUNDED_P (restmp))
|
||||
{
|
||||
resbnd = chkp_insert_retbnd_call (NULL, restmp, &bsi);
|
||||
create_edge (get_create (gimple_call_fndecl (gsi_stmt (bsi))),
|
||||
as_a <gcall *> (gsi_stmt (bsi)),
|
||||
callees->count);
|
||||
}
|
||||
|
||||
if (restmp && !this_adjusting
|
||||
&& (fixed_offset || virtual_offset))
|
||||
{
|
||||
|
@ -2503,13 +2483,9 @@ void
|
|||
symbol_table::output_weakrefs (void)
|
||||
{
|
||||
symtab_node *node;
|
||||
cgraph_node *cnode;
|
||||
FOR_EACH_SYMBOL (node)
|
||||
if (node->alias
|
||||
&& !TREE_ASM_WRITTEN (node->decl)
|
||||
&& (!(cnode = dyn_cast <cgraph_node *> (node))
|
||||
|| !cnode->instrumented_version
|
||||
|| !TREE_ASM_WRITTEN (cnode->instrumented_version->decl))
|
||||
&& node->weakref)
|
||||
{
|
||||
tree target;
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
/* This file contains the definitions and documentation for the
|
||||
builtins used in the GNU compiler.
|
||||
Copyright (C) 2013-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Before including this file, you should define macros:
|
||||
|
||||
DEF_BUILTIN_STUB(ENUM, NAME)
|
||||
DEF_CHKP_BUILTIN(ENUM, NAME, TYPE, ATTRS)
|
||||
|
||||
See builtins.def for details. */
|
||||
|
||||
/* Following builtins are used by compiler for Pointer Bounds Checker
|
||||
instrumentation. Currently these generic builtins are not
|
||||
implemented and target has to provide his own version. See
|
||||
builtin_chkp_function target hook documentation for more details. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_CHKP_INTERSECT, "__chkp_intersect")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_CHKP_SIZEOF, "__chkp_sizeof")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_CHKP_NARROW, "__chkp_narrow")
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDCL, "__chkp_bndcl", BT_FN_VOID_PTR_BND, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDCU, "__chkp_bndcu", BT_FN_VOID_PTR_BND, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDSTX, "__chkp_bndstx", BT_FN_VOID_CONST_PTR_BND_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDLDX, "__chkp_bndldx", BT_FN_CONST_PTR_CONST_PTR_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDRET, "__chkp_bndret", BT_FN_BND_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_BNDMK, "__chkp_bndmk", BT_FN_BND_CONST_PTR_SIZE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_EXTRACT_LOWER, "__chkp_extract_lower", BT_FN_CONST_PTR_BND, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_EXTRACT_UPPER, "__chkp_extract_upper", BT_FN_CONST_PTR_BND, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Pointer Bounds Checker builtins for users.
|
||||
All builtins calls are expanded in the
|
||||
Pointer Bounds Checker pass. */
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_SET_PTR_BOUNDS, "__bnd_set_ptr_bounds", BT_FN_PTR_CONST_PTR_SIZE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_INIT_PTR_BOUNDS, "__bnd_init_ptr_bounds", BT_FN_PTR_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_NULL_PTR_BOUNDS, "__bnd_null_ptr_bounds", BT_FN_PTR_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_COPY_PTR_BOUNDS, "__bnd_copy_ptr_bounds", BT_FN_PTR_CONST_PTR_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_NARROW_PTR_BOUNDS, "__bnd_narrow_ptr_bounds", BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_STORE_PTR_BOUNDS, "__bnd_store_ptr_bounds", BT_FN_VOID_PTRPTR_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, "__bnd_chk_ptr_lbounds", BT_FN_VOID_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_CHECK_PTR_UBOUNDS, "__bnd_chk_ptr_ubounds", BT_FN_VOID_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_CHECK_PTR_BOUNDS, "__bnd_chk_ptr_bounds", BT_FN_VOID_CONST_PTR_SIZE, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_GET_PTR_LBOUND, "__bnd_get_ptr_lbound", BT_FN_CONST_PTR_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_GET_PTR_UBOUND, "__bnd_get_ptr_ubound", BT_FN_CONST_PTR_CONST_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Pointer Bounds Checker specific versions of string functions. */
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMCPY_NOBND, "chkp_memcpy_nobnd", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMCPY_NOCHK, "chkp_memcpy_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMCPY_NOBND_NOCHK, "chkp_memcpy_nobnd_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMMOVE_NOBND, "chkp_memmove_nobnd", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMMOVE_NOCHK, "chkp_memmove_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMMOVE_NOBND_NOCHK, "chkp_memmove_nobnd_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMPCPY_NOBND, "chkp_mempcpy_nobnd", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMPCPY_NOCHK, "chkp_mempcpy_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMPCPY_NOBND_NOCHK, "chkp_mempcpy_nobnd_nochk", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMSET_NOBND, "chkp_memset_nobnd", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMSET_NOCHK, "chkp_memset_nochk", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_CHKP_BUILTIN (BUILT_IN_CHKP_MEMSET_NOBND_NOCHK, "chkp_memset_nobnd_nochk", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
|
@ -273,7 +273,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define OPTION_MASK_ISA2_AVX512F_UNSET \
|
||||
(OPTION_MASK_ISA_AVX5124FMAPS_UNSET | OPTION_MASK_ISA_AVX5124VNNIW_UNSET)
|
||||
#define OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET \
|
||||
(OPTION_MASK_ISA2_AVX512F_UNSET | OPTION_MASK_ISA_MPX)
|
||||
(OPTION_MASK_ISA2_AVX512F_UNSET)
|
||||
|
||||
/* Implement TARGET_HANDLE_OPTION. */
|
||||
|
||||
|
@ -291,7 +291,7 @@ ix86_handle_option (struct gcc_options *opts,
|
|||
case OPT_mgeneral_regs_only:
|
||||
if (value)
|
||||
{
|
||||
/* Disable MPX, MMX, SSE and x87 instructions if only
|
||||
/* Disable MMX, SSE and x87 instructions if only
|
||||
general registers are allowed. */
|
||||
opts->x_ix86_isa_flags
|
||||
&= ~OPTION_MASK_ISA_GENERAL_REGS_ONLY_UNSET;
|
||||
|
|
|
@ -94,9 +94,6 @@
|
|||
(define_register_constraint "v" "TARGET_SSE ? ALL_SSE_REGS : NO_REGS"
|
||||
"Any EVEX encodable SSE register (@code{%xmm0-%xmm31}).")
|
||||
|
||||
(define_register_constraint "w" "TARGET_MPX ? BND_REGS : NO_REGS"
|
||||
"@internal Any bound register.")
|
||||
|
||||
;; We use the Y prefix to denote any number of conditional register sets:
|
||||
;; z First SSE register.
|
||||
;; d any EVEX encodable SSE register for AVX512BW target or
|
||||
|
@ -319,11 +316,3 @@
|
|||
(define_address_constraint "Ts"
|
||||
"Address operand without segment register"
|
||||
(match_operand 0 "address_no_seg_operand"))
|
||||
|
||||
(define_address_constraint "Ti"
|
||||
"MPX address operand without index"
|
||||
(match_operand 0 "address_mpx_no_index_operand"))
|
||||
|
||||
(define_address_constraint "Tb"
|
||||
"MPX address operand without base"
|
||||
(match_operand 0 "address_mpx_no_base_operand"))
|
||||
|
|
|
@ -47,7 +47,6 @@ DEF_PRIMITIVE_TYPE (UCHAR, unsigned_char_type_node)
|
|||
DEF_PRIMITIVE_TYPE (QI, char_type_node)
|
||||
DEF_PRIMITIVE_TYPE (HI, intHI_type_node)
|
||||
DEF_PRIMITIVE_TYPE (SI, intSI_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BND, pointer_bounds_type_node)
|
||||
# ??? Logically this should be intDI_type_node, but that maps to "long"
|
||||
# with 64-bit, and that's not how the emmintrin.h is written. Again,
|
||||
# changing this would change name mangling.
|
||||
|
@ -1208,17 +1207,6 @@ DEF_FUNCTION_TYPE_ALIAS (V4SF_FTYPE_V4SF_V4SF, TF)
|
|||
DEF_FUNCTION_TYPE_ALIAS (V4SI_FTYPE_V4SI_V4SI, TF)
|
||||
DEF_FUNCTION_TYPE_ALIAS (V8HI_FTYPE_V8HI_V8HI, TF)
|
||||
|
||||
# MPX builtins
|
||||
DEF_FUNCTION_TYPE (BND, PCVOID, ULONG)
|
||||
DEF_FUNCTION_TYPE (VOID, PCVOID, BND)
|
||||
DEF_FUNCTION_TYPE (VOID, PCVOID, BND, PCVOID)
|
||||
DEF_FUNCTION_TYPE (BND, PCVOID, PCVOID)
|
||||
DEF_FUNCTION_TYPE (BND, PCVOID)
|
||||
DEF_FUNCTION_TYPE (BND, BND, BND)
|
||||
DEF_FUNCTION_TYPE (PVOID, PCVOID, BND, ULONG)
|
||||
DEF_FUNCTION_TYPE (ULONG, VOID)
|
||||
DEF_FUNCTION_TYPE (PVOID, BND)
|
||||
|
||||
#GFNI builtins
|
||||
DEF_FUNCTION_TYPE (V64QI, V64QI, V64QI, INT)
|
||||
DEF_FUNCTION_TYPE (V64QI, V64QI, V64QI, INT, V64QI, UDI)
|
||||
|
|
|
@ -2847,29 +2847,7 @@ BDESC_FIRST (special_args2, SPECIAL_ARGS2,
|
|||
OPTION_MASK_ISA_WBNOINVD, CODE_FOR_wbnoinvd, "__builtin_ia32_wbnoinvd", IX86_BUILTIN_WBNOINVD, UNKNOWN, (int) VOID_FTYPE_VOID)
|
||||
BDESC (OPTION_MASK_ISA_MOVDIR64B, CODE_FOR_nothing, "__builtin_ia32_movdir64b", IX86_BUILTIN_MOVDIR64B, UNKNOWN, (int) VOID_FTYPE_PVOID_PCVOID)
|
||||
|
||||
BDESC_END (SPECIAL_ARGS2, MPX)
|
||||
|
||||
|
||||
/* Builtins for MPX. */
|
||||
BDESC_FIRST (mpx, MPX,
|
||||
OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndstx", IX86_BUILTIN_BNDSTX, UNKNOWN, (int) VOID_FTYPE_PCVOID_BND_PCVOID)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndcl", IX86_BUILTIN_BNDCL, UNKNOWN, (int) VOID_FTYPE_PCVOID_BND)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndcu", IX86_BUILTIN_BNDCU, UNKNOWN, (int) VOID_FTYPE_PCVOID_BND)
|
||||
|
||||
BDESC_END (MPX, MPX_CONST)
|
||||
|
||||
/* Const builtins for MPX. */
|
||||
BDESC_FIRST (mpx_const, MPX_CONST,
|
||||
OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndmk", IX86_BUILTIN_BNDMK, UNKNOWN, (int) BND_FTYPE_PCVOID_ULONG)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndldx", IX86_BUILTIN_BNDLDX, UNKNOWN, (int) BND_FTYPE_PCVOID_PCVOID)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_narrow_bounds", IX86_BUILTIN_BNDNARROW, UNKNOWN, (int) PVOID_FTYPE_PCVOID_BND_ULONG)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndint", IX86_BUILTIN_BNDINT, UNKNOWN, (int) BND_FTYPE_BND_BND)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_sizeof", IX86_BUILTIN_SIZEOF, UNKNOWN, (int) ULONG_FTYPE_VOID)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndlower", IX86_BUILTIN_BNDLOWER, UNKNOWN, (int) PVOID_FTYPE_BND)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndupper", IX86_BUILTIN_BNDUPPER, UNKNOWN, (int) PVOID_FTYPE_BND)
|
||||
BDESC (OPTION_MASK_ISA_MPX, (enum insn_code)0, "__builtin_ia32_bndret", IX86_BUILTIN_BNDRET, UNKNOWN, (int) BND_FTYPE_PCVOID)
|
||||
|
||||
BDESC_END (MPX_CONST, MULTI_ARG)
|
||||
BDESC_END (SPECIAL_ARGS2, MULTI_ARG)
|
||||
|
||||
/* FMA4 and XOP. */
|
||||
BDESC_FIRST (multi_arg, MULTI_ARG,
|
||||
|
|
|
@ -508,8 +508,6 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
|
|||
def_or_undef (parse_in, "__XSAVEC__");
|
||||
if (isa_flag & OPTION_MASK_ISA_XSAVES)
|
||||
def_or_undef (parse_in, "__XSAVES__");
|
||||
if (isa_flag2 & OPTION_MASK_ISA_MPX)
|
||||
def_or_undef (parse_in, "__MPX__");
|
||||
if (isa_flag & OPTION_MASK_ISA_CLWB)
|
||||
def_or_undef (parse_in, "__CLWB__");
|
||||
if (isa_flag2 & OPTION_MASK_ISA_MWAITX)
|
||||
|
|
|
@ -232,8 +232,6 @@ extern void ix86_expand_sse2_mulv4si3 (rtx, rtx, rtx);
|
|||
extern void ix86_expand_sse2_mulvxdi3 (rtx, rtx, rtx);
|
||||
extern void ix86_expand_sse2_abs (rtx, rtx);
|
||||
|
||||
extern bool ix86_bnd_prefixed_insn_p (rtx);
|
||||
|
||||
/* In i386-c.c */
|
||||
extern void ix86_target_macros (void);
|
||||
extern void ix86_register_pragmas (void);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -175,8 +175,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|||
#define TARGET_XSAVEOPT_P(x) TARGET_ISA_XSAVEOPT_P(x)
|
||||
#define TARGET_PREFETCHWT1 TARGET_ISA_PREFETCHWT1
|
||||
#define TARGET_PREFETCHWT1_P(x) TARGET_ISA_PREFETCHWT1_P(x)
|
||||
#define TARGET_MPX TARGET_ISA_MPX
|
||||
#define TARGET_MPX_P(x) TARGET_ISA_MPX_P(x)
|
||||
#define TARGET_CLWB TARGET_ISA_CLWB
|
||||
#define TARGET_CLWB_P(x) TARGET_ISA_CLWB_P(x)
|
||||
#define TARGET_MWAITX TARGET_ISA_MWAITX
|
||||
|
@ -1157,9 +1155,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
|||
|
||||
#define VALID_MASK_AVX512BW_MODE(MODE) ((MODE) == SImode || (MODE) == DImode)
|
||||
|
||||
#define VALID_BND_REG_MODE(MODE) \
|
||||
(TARGET_64BIT ? (MODE) == BND64mode : (MODE) == BND32mode)
|
||||
|
||||
#define VALID_DFP_MODE_P(MODE) \
|
||||
((MODE) == SDmode || (MODE) == DDmode || (MODE) == TDmode)
|
||||
|
||||
|
@ -1261,9 +1256,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
|||
#define FIRST_MASK_REG MASK0_REG
|
||||
#define LAST_MASK_REG MASK7_REG
|
||||
|
||||
#define FIRST_BND_REG BND0_REG
|
||||
#define LAST_BND_REG BND3_REG
|
||||
|
||||
/* Override this in other tm.h files to cope with various OS lossage
|
||||
requiring a frame pointer. */
|
||||
#ifndef SUBTARGET_FRAME_POINTER_REQUIRED
|
||||
|
@ -1345,7 +1337,6 @@ enum reg_class
|
|||
NO_REX_SSE_REGS,
|
||||
SSE_REGS,
|
||||
EVEX_SSE_REGS,
|
||||
BND_REGS,
|
||||
ALL_SSE_REGS,
|
||||
MMX_REGS,
|
||||
FP_TOP_SSE_REGS,
|
||||
|
@ -1408,7 +1399,6 @@ enum reg_class
|
|||
"NO_REX_SSE_REGS", \
|
||||
"SSE_REGS", \
|
||||
"EVEX_SSE_REGS", \
|
||||
"BND_REGS", \
|
||||
"ALL_SSE_REGS", \
|
||||
"MMX_REGS", \
|
||||
"FP_TOP_SSE_REGS", \
|
||||
|
@ -1451,7 +1441,6 @@ enum reg_class
|
|||
{ 0x1fe00000, 0x000000, 0x0 }, /* NO_REX_SSE_REGS */ \
|
||||
{ 0x1fe00000, 0x1fe000, 0x0 }, /* SSE_REGS */ \
|
||||
{ 0x0,0xffe00000, 0x1f }, /* EVEX_SSE_REGS */ \
|
||||
{ 0x0, 0x0,0x1e000 }, /* BND_REGS */ \
|
||||
{ 0x1fe00000,0xffffe000, 0x1f }, /* ALL_SSE_REGS */ \
|
||||
{ 0xe0000000, 0x1f, 0x0 }, /* MMX_REGS */ \
|
||||
{ 0x1fe00100,0xffffe000, 0x1f }, /* FP_TOP_SSE_REG */ \
|
||||
|
@ -1526,9 +1515,6 @@ enum reg_class
|
|||
#define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
|
||||
#define CC_REGNO_P(X) ((X) == FLAGS_REG || (X) == FPSR_REG)
|
||||
|
||||
#define BND_REG_P(X) (REG_P (X) && BND_REGNO_P (REGNO (X)))
|
||||
#define BND_REGNO_P(N) IN_RANGE ((N), FIRST_BND_REG, LAST_BND_REG)
|
||||
|
||||
#define MOD4_SSE_REG_P(X) (REG_P (X) && MOD4_SSE_REGNO_P (REGNO (X)))
|
||||
#define MOD4_SSE_REGNO_P(N) ((N) == XMM0_REG \
|
||||
|| (N) == XMM4_REG \
|
||||
|
@ -1670,9 +1656,6 @@ typedef struct ix86_args {
|
|||
int float_in_sse; /* Set to 1 or 2 for 32bit targets if
|
||||
SFmode/DFmode arguments should be passed
|
||||
in SSE registers. Otherwise 0. */
|
||||
int bnd_regno; /* next available bnd register number */
|
||||
int bnds_in_bt; /* number of bounds expected in BT. */
|
||||
int force_bnd_pass; /* number of bounds expected for stdarg arg. */
|
||||
int stdarg; /* Set to 1 if function is stdarg. */
|
||||
enum calling_abi call_abi; /* Set to SYSV_ABI for sysv abi. Otherwise
|
||||
MS_ABI for ms abi. */
|
||||
|
@ -1964,9 +1947,6 @@ do { \
|
|||
#define STACK_SAVEAREA_MODE(LEVEL) \
|
||||
((LEVEL) == SAVE_NONLOCAL ? (TARGET_64BIT ? TImode : DImode) : Pmode)
|
||||
|
||||
/* Specify the machine mode that bounds have. */
|
||||
#define BNDmode (ix86_pmode == PMODE_DI ? BND64mode : BND32mode)
|
||||
|
||||
/* A C expression whose value is zero if pointers that need to be extended
|
||||
from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
|
||||
greater then zero if they are zero-extended and less then zero if the
|
||||
|
@ -2257,15 +2237,6 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
|
|||
/* Default threshold for putting data in large sections
|
||||
with x86-64 medium memory model */
|
||||
#define DEFAULT_LARGE_SECTION_THRESHOLD 65536
|
||||
|
||||
/* Adjust the length of the insn with the length of BND prefix. */
|
||||
|
||||
#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
|
||||
do { \
|
||||
if (NONDEBUG_INSN_P (INSN) && INSN_CODE (INSN) >= 0 \
|
||||
&& get_attr_maybe_prefix_bnd (INSN)) \
|
||||
LENGTH += ix86_bnd_prefixed_insn_p (INSN); \
|
||||
} while (0)
|
||||
|
||||
/* Which processor to tune code generation for. These must be in sync
|
||||
with processor_target_table in i386.c. */
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
;; ; -- print a semicolon (after prefixes due to bug in older gas).
|
||||
;; ~ -- print "i" if TARGET_AVX2, "f" otherwise.
|
||||
;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
|
||||
;; ! -- print MPX or NOTRACK prefix for jxx/call/ret instructions if required.
|
||||
;; ! -- print NOTRACK prefix for jxx/call/ret instructions if required.
|
||||
|
||||
(define_c_enum "unspec" [
|
||||
;; Relocation specifiers
|
||||
|
@ -550,9 +550,6 @@
|
|||
(const_int 0)
|
||||
(and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))
|
||||
(const_int 1)
|
||||
(and (eq_attr "type" "ibr,call,callv")
|
||||
(match_test "ix86_bnd_prefixed_insn_p (insn)"))
|
||||
(const_int 1)
|
||||
]
|
||||
(const_int 0)))
|
||||
|
||||
|
@ -596,9 +593,6 @@
|
|||
]
|
||||
(const_int 0)))
|
||||
|
||||
;; Set when BND opcode prefix may be used.
|
||||
(define_attr "maybe_prefix_bnd" "" (const_int 0))
|
||||
|
||||
;; Prefix used: original, VEX or maybe VEX.
|
||||
(define_attr "prefix" "orig,vex,maybe_vex,evex,maybe_evex"
|
||||
(cond [(eq_attr "mode" "OI,V8SF,V4DF")
|
||||
|
@ -1074,17 +1068,6 @@
|
|||
(define_mode_iterator BND [(BND32 "!TARGET_LP64")
|
||||
(BND64 "TARGET_LP64")])
|
||||
|
||||
;; Pointer mode corresponding to bound mode.
|
||||
(define_mode_attr bnd_ptr [(BND32 "SI") (BND64 "DI")])
|
||||
|
||||
;; MPX check types
|
||||
(define_int_iterator BNDCHECK [UNSPEC_BNDCL UNSPEC_BNDCU UNSPEC_BNDCN])
|
||||
|
||||
;; Check name
|
||||
(define_int_attr bndcheck [(UNSPEC_BNDCL "cl")
|
||||
(UNSPEC_BNDCU "cu")
|
||||
(UNSPEC_BNDCN "cn")])
|
||||
|
||||
;; Instruction suffix for integer modes.
|
||||
(define_mode_attr imodesuffix [(QI "b") (HI "w") (SI "l") (DI "q")])
|
||||
|
||||
|
@ -12601,8 +12584,7 @@
|
|||
(lt (minus (match_dup 0) (pc))
|
||||
(const_int 128)))
|
||||
(const_int 2)
|
||||
(const_int 6)))
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(const_int 6)))])
|
||||
|
||||
;; In general it is not safe to assume too much about CCmode registers,
|
||||
;; so simplify-rtx stops when it sees a second one. Under certain
|
||||
|
@ -12670,8 +12652,7 @@
|
|||
(lt (minus (match_dup 0) (pc))
|
||||
(const_int 128)))
|
||||
(const_int 2)
|
||||
(const_int 5)))
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(const_int 5)))])
|
||||
|
||||
(define_expand "indirect_jump"
|
||||
[(set (pc) (match_operand 0 "indirect_branch_operand"))]
|
||||
|
@ -12691,8 +12672,7 @@
|
|||
!= indirect_branch_keep)")
|
||||
(const_string "multi")
|
||||
(const_string "ibr")))
|
||||
(set_attr "length_immediate" "0")
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(set_attr "length_immediate" "0")])
|
||||
|
||||
(define_expand "tablejump"
|
||||
[(parallel [(set (pc) (match_operand 0 "indirect_branch_operand"))
|
||||
|
@ -12746,8 +12726,7 @@
|
|||
!= indirect_branch_keep)")
|
||||
(const_string "multi")
|
||||
(const_string "ibr")))
|
||||
(set_attr "length_immediate" "0")
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(set_attr "length_immediate" "0")])
|
||||
|
||||
;; Convert setcc + movzbl to xor + setcc if operands don't overlap.
|
||||
|
||||
|
@ -13444,8 +13423,7 @@
|
|||
[(set_attr "length" "1")
|
||||
(set_attr "atom_unit" "jeu")
|
||||
(set_attr "length_immediate" "0")
|
||||
(set_attr "modrm" "0")
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(set_attr "modrm" "0")])
|
||||
|
||||
(define_insn "interrupt_return"
|
||||
[(simple_return)
|
||||
|
@ -13480,8 +13458,7 @@
|
|||
[(set_attr "length" "3")
|
||||
(set_attr "atom_unit" "jeu")
|
||||
(set_attr "length_immediate" "2")
|
||||
(set_attr "modrm" "0")
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(set_attr "modrm" "0")])
|
||||
|
||||
(define_expand "simple_return_indirect_internal"
|
||||
[(parallel
|
||||
|
@ -13498,8 +13475,7 @@
|
|||
!= indirect_branch_keep)")
|
||||
(const_string "multi")
|
||||
(const_string "ibr")))
|
||||
(set_attr "length_immediate" "0")
|
||||
(set_attr "maybe_prefix_bnd" "1")])
|
||||
(set_attr "length_immediate" "0")])
|
||||
|
||||
(define_insn "nop"
|
||||
[(const_int 0)]
|
||||
|
@ -20844,161 +20820,6 @@
|
|||
[(set_attr "length" "3")
|
||||
(set_attr "memory" "unknown")])
|
||||
|
||||
;; MPX instructions
|
||||
|
||||
(define_expand "<mode>_mk"
|
||||
[(set (match_operand:BND 0 "register_operand")
|
||||
(unspec:BND
|
||||
[(mem:<bnd_ptr>
|
||||
(match_par_dup 3
|
||||
[(match_operand:<bnd_ptr> 1 "register_operand")
|
||||
(match_operand:<bnd_ptr> 2 "address_mpx_no_base_operand")]))]
|
||||
UNSPEC_BNDMK))]
|
||||
"TARGET_MPX"
|
||||
{
|
||||
operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1],
|
||||
operands[2]),
|
||||
UNSPEC_BNDMK_ADDR);
|
||||
})
|
||||
|
||||
(define_insn "*<mode>_mk"
|
||||
[(set (match_operand:BND 0 "register_operand" "=w")
|
||||
(unspec:BND
|
||||
[(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
|
||||
[(unspec:<bnd_ptr>
|
||||
[(match_operand:<bnd_ptr> 1 "register_operand" "r")
|
||||
(match_operand:<bnd_ptr> 2 "address_mpx_no_base_operand" "Tb")]
|
||||
UNSPEC_BNDMK_ADDR)])]
|
||||
UNSPEC_BNDMK))]
|
||||
"TARGET_MPX"
|
||||
"bndmk\t{%3, %0|%0, %3}"
|
||||
[(set_attr "type" "mpxmk")])
|
||||
|
||||
(define_expand "mov<mode>"
|
||||
[(set (match_operand:BND 0 "general_operand")
|
||||
(match_operand:BND 1 "general_operand"))]
|
||||
"TARGET_MPX"
|
||||
"ix86_expand_move (<MODE>mode, operands); DONE;")
|
||||
|
||||
(define_insn "*mov<mode>_internal_mpx"
|
||||
[(set (match_operand:BND 0 "nonimmediate_operand" "=w,m")
|
||||
(match_operand:BND 1 "general_operand" "wm,w"))]
|
||||
"TARGET_MPX"
|
||||
"bndmov\t{%1, %0|%0, %1}"
|
||||
[(set_attr "type" "mpxmov")])
|
||||
|
||||
(define_expand "<mode>_<bndcheck>"
|
||||
[(parallel
|
||||
[(unspec
|
||||
[(match_operand:BND 0 "register_operand")
|
||||
(match_operand:<bnd_ptr> 1 "address_no_seg_operand")] BNDCHECK)
|
||||
(set (match_dup 2)
|
||||
(unspec:BLK [(match_dup 2)] UNSPEC_MPX_FENCE))])]
|
||||
"TARGET_MPX"
|
||||
{
|
||||
operands[2] = gen_rtx_MEM (BLKmode, operands[1]);
|
||||
MEM_VOLATILE_P (operands[2]) = 1;
|
||||
})
|
||||
|
||||
(define_insn "*<mode>_<bndcheck>"
|
||||
[(unspec
|
||||
[(match_operand:BND 0 "register_operand" "w")
|
||||
(match_operand:<bnd_ptr> 1 "address_no_seg_operand" "Ts")] BNDCHECK)
|
||||
(set (match_operand:BLK 2 "bnd_mem_operator")
|
||||
(unspec:BLK [(match_dup 2)] UNSPEC_MPX_FENCE))]
|
||||
"TARGET_MPX"
|
||||
"bnd<bndcheck>\t{%a1, %0|%0, %a1}"
|
||||
[(set_attr "type" "mpxchk")])
|
||||
|
||||
(define_expand "<mode>_ldx"
|
||||
[(parallel
|
||||
[(set (match_operand:BND 0 "register_operand")
|
||||
(unspec:BND
|
||||
[(mem:<bnd_ptr>
|
||||
(match_par_dup 3
|
||||
[(match_operand:<bnd_ptr> 1 "address_mpx_no_index_operand")
|
||||
(match_operand:<bnd_ptr> 2 "register_operand")]))]
|
||||
UNSPEC_BNDLDX))
|
||||
(use (mem:BLK (match_dup 1)))])]
|
||||
"TARGET_MPX"
|
||||
{
|
||||
/* Avoid registers which cannot be used as index. */
|
||||
if (!index_register_operand (operands[2], Pmode))
|
||||
operands[2] = copy_addr_to_reg (operands[2]);
|
||||
|
||||
operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1],
|
||||
operands[2]),
|
||||
UNSPEC_BNDLDX_ADDR);
|
||||
})
|
||||
|
||||
(define_insn "*<mode>_ldx"
|
||||
[(set (match_operand:BND 0 "register_operand" "=w")
|
||||
(unspec:BND
|
||||
[(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
|
||||
[(unspec:<bnd_ptr>
|
||||
[(match_operand:<bnd_ptr> 1 "address_mpx_no_index_operand" "Ti")
|
||||
(match_operand:<bnd_ptr> 2 "register_operand" "l")]
|
||||
UNSPEC_BNDLDX_ADDR)])]
|
||||
UNSPEC_BNDLDX))
|
||||
(use (mem:BLK (match_dup 1)))]
|
||||
"TARGET_MPX"
|
||||
"bndldx\t{%3, %0|%0, %3}"
|
||||
[(set_attr "type" "mpxld")])
|
||||
|
||||
(define_expand "<mode>_stx"
|
||||
[(parallel
|
||||
[(unspec
|
||||
[(mem:<bnd_ptr>
|
||||
(match_par_dup 3
|
||||
[(match_operand:<bnd_ptr> 0 "address_mpx_no_index_operand")
|
||||
(match_operand:<bnd_ptr> 1 "register_operand")]))
|
||||
(match_operand:BND 2 "register_operand")]
|
||||
UNSPEC_BNDSTX)
|
||||
(set (match_dup 4)
|
||||
(unspec:BLK [(match_dup 4)] UNSPEC_MPX_FENCE))])]
|
||||
"TARGET_MPX"
|
||||
{
|
||||
/* Avoid registers which cannot be used as index. */
|
||||
if (!index_register_operand (operands[1], Pmode))
|
||||
operands[1] = copy_addr_to_reg (operands[1]);
|
||||
|
||||
operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[0],
|
||||
operands[1]),
|
||||
UNSPEC_BNDLDX_ADDR);
|
||||
operands[4] = gen_rtx_MEM (BLKmode, operands[0]);
|
||||
MEM_VOLATILE_P (operands[4]) = 1;
|
||||
})
|
||||
|
||||
(define_insn "*<mode>_stx"
|
||||
[(unspec
|
||||
[(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
|
||||
[(unspec:<bnd_ptr>
|
||||
[(match_operand:<bnd_ptr> 0 "address_mpx_no_index_operand" "Ti")
|
||||
(match_operand:<bnd_ptr> 1 "register_operand" "l")]
|
||||
UNSPEC_BNDLDX_ADDR)])
|
||||
(match_operand:BND 2 "register_operand" "w")]
|
||||
UNSPEC_BNDSTX)
|
||||
(set (match_operand:BLK 4 "bnd_mem_operator")
|
||||
(unspec:BLK [(match_dup 4)] UNSPEC_MPX_FENCE))]
|
||||
"TARGET_MPX"
|
||||
"bndstx\t{%2, %3|%3, %2}"
|
||||
[(set_attr "type" "mpxst")])
|
||||
|
||||
(define_insn "move_size_reloc_<mode>"
|
||||
[(set (match_operand:SWI48 0 "register_operand" "=r")
|
||||
(unspec:SWI48
|
||||
[(match_operand:SWI48 1 "symbol_operand")]
|
||||
UNSPEC_SIZEOF))]
|
||||
"TARGET_MPX"
|
||||
{
|
||||
if (x86_64_immediate_size_operand (operands[1], VOIDmode))
|
||||
return "mov{l}\t{%1@SIZE, %k0|%k0, %1@SIZE}";
|
||||
else
|
||||
return "movabs{q}\t{%1@SIZE, %0|%0, %1@SIZE}";
|
||||
}
|
||||
[(set_attr "type" "imov")
|
||||
(set_attr "mode" "<MODE>")])
|
||||
|
||||
;; RDPKRU and WRPKRU
|
||||
|
||||
(define_expand "rdpkru"
|
||||
|
|
|
@ -951,8 +951,8 @@ Target Report Mask(ISA_RTM) Var(ix86_isa_flags) Save
|
|||
Support RTM built-in functions and code generation.
|
||||
|
||||
mmpx
|
||||
Target Report Mask(ISA_MPX) Var(ix86_isa_flags2) Save
|
||||
Support MPX code generation.
|
||||
Target Report
|
||||
Deprecated in GCC 9. This switch has no effect.
|
||||
|
||||
mmwaitx
|
||||
Target Report Mask(ISA_MWAITX) Var(ix86_isa_flags2) Save
|
||||
|
|
|
@ -54,31 +54,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
GNU_USER_TARGET_MATHFILE_SPEC " " \
|
||||
ANDROID_ENDFILE_SPEC)
|
||||
|
||||
#ifndef LIBMPX_LIBS
|
||||
#define LIBMPX_LIBS "\
|
||||
%:include(libmpx.spec)%(link_libmpx)"
|
||||
#endif
|
||||
|
||||
#ifndef LINK_MPX
|
||||
#if defined (HAVE_LD_BNDPLT_SUPPORT)
|
||||
#define LINK_MPX "-z bndplt "
|
||||
#else
|
||||
#define LINK_MPX \
|
||||
"%nGCC was configured with a linker with no '-z bndplt' support. " \
|
||||
"It significantly reduces MPX coverage for dynamic codes. " \
|
||||
"It is strongly recommended to use GCC properly configured for MPX."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MPX_SPEC
|
||||
#ifdef SPEC_64
|
||||
#define MPX_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:%{!static:%{" SPEC_64 ":" LINK_MPX "}}}}"
|
||||
#else
|
||||
#define MPX_SPEC ""
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LD_PUSHPOPSTATE_SUPPORT
|
||||
#define MPX_LD_AS_NEEDED_GUARD_PUSH "--push-state --no-as-needed"
|
||||
#define MPX_LD_AS_NEEDED_GUARD_POP "--pop-state"
|
||||
|
@ -87,41 +62,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define MPX_LD_AS_NEEDED_GUARD_POP ""
|
||||
#endif
|
||||
|
||||
#ifndef LIBMPX_SPEC
|
||||
#if defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBMPX_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:\
|
||||
%{static:--whole-archive -lmpx --no-whole-archive" LIBMPX_LIBS "}\
|
||||
%{!static:%{static-libmpx:" LD_STATIC_OPTION " --whole-archive}\
|
||||
%{!static-libmpx:" MPX_LD_AS_NEEDED_GUARD_PUSH "} -lmpx \
|
||||
%{!static-libmpx:" MPX_LD_AS_NEEDED_GUARD_POP "} \
|
||||
%{static-libmpx:--no-whole-archive " LD_DYNAMIC_OPTION \
|
||||
LIBMPX_LIBS "}}}}"
|
||||
#else
|
||||
#define LIBMPX_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:-lmpx" LIBMPX_LIBS "}}"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBMPXWRAPPERS_SPEC
|
||||
#if defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBMPXWRAPPERS_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:%{!fno-chkp-use-wrappers:\
|
||||
%{static:-lmpxwrappers}\
|
||||
%{!static:%{static-libmpxwrappers:" LD_STATIC_OPTION "}\
|
||||
-lmpxwrappers %{static-libmpxwrappers: "\
|
||||
LD_DYNAMIC_OPTION "}}}}}"
|
||||
#else
|
||||
#define LIBMPXWRAPPERS_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:{!fno-chkp-use-wrappers:-lmpxwrappers}}}"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CHKP_SPEC
|
||||
#define CHKP_SPEC "\
|
||||
%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}" MPX_SPEC
|
||||
#endif
|
||||
|
||||
extern void file_end_indicate_exec_stack_and_cet (void);
|
||||
|
||||
#undef TARGET_ASM_FILE_END
|
||||
|
|
|
@ -1132,68 +1132,6 @@
|
|||
return true;
|
||||
})
|
||||
|
||||
;; Return true if op is valid MPX address operand without base
|
||||
(define_predicate "address_mpx_no_base_operand"
|
||||
(match_test "address_operand (op, VOIDmode)")
|
||||
{
|
||||
struct ix86_address parts;
|
||||
int ok;
|
||||
|
||||
ok = ix86_decompose_address (op, &parts);
|
||||
gcc_assert (ok);
|
||||
|
||||
if (parts.index && parts.base)
|
||||
return false;
|
||||
|
||||
if (parts.seg != ADDR_SPACE_GENERIC)
|
||||
return false;
|
||||
|
||||
/* Do not support (%rip). */
|
||||
if (parts.disp && flag_pic && TARGET_64BIT
|
||||
&& SYMBOLIC_CONST (parts.disp))
|
||||
{
|
||||
if (GET_CODE (parts.disp) != CONST
|
||||
|| GET_CODE (XEXP (parts.disp, 0)) != PLUS
|
||||
|| GET_CODE (XEXP (XEXP (parts.disp, 0), 0)) != UNSPEC
|
||||
|| !CONST_INT_P (XEXP (XEXP (parts.disp, 0), 1))
|
||||
|| (XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_DTPOFF
|
||||
&& XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_NTPOFF))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
|
||||
;; Return true if op is valid MPX address operand without index
|
||||
(define_predicate "address_mpx_no_index_operand"
|
||||
(match_test "address_operand (op, VOIDmode)")
|
||||
{
|
||||
struct ix86_address parts;
|
||||
int ok;
|
||||
|
||||
ok = ix86_decompose_address (op, &parts);
|
||||
gcc_assert (ok);
|
||||
|
||||
if (parts.index)
|
||||
return false;
|
||||
|
||||
if (parts.seg != ADDR_SPACE_GENERIC)
|
||||
return false;
|
||||
|
||||
/* Do not support (%rip). */
|
||||
if (parts.disp && flag_pic && TARGET_64BIT
|
||||
&& SYMBOLIC_CONST (parts.disp)
|
||||
&& (GET_CODE (parts.disp) != CONST
|
||||
|| GET_CODE (XEXP (parts.disp, 0)) != PLUS
|
||||
|| GET_CODE (XEXP (XEXP (parts.disp, 0), 0)) != UNSPEC
|
||||
|| !CONST_INT_P (XEXP (XEXP (parts.disp, 0), 1))
|
||||
|| (XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_DTPOFF
|
||||
&& XINT (XEXP (XEXP (parts.disp, 0), 0), 1) != UNSPEC_NTPOFF)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
})
|
||||
|
||||
(define_predicate "vsib_mem_operator"
|
||||
(match_code "mem"))
|
||||
|
||||
|
|
|
@ -2379,10 +2379,6 @@ dbxout_type (tree type, int full)
|
|||
dbxout_type (TREE_TYPE (type), 0);
|
||||
break;
|
||||
|
||||
case POINTER_BOUNDS_TYPE:
|
||||
/* No debug info for pointer bounds type supported yet. */
|
||||
break;
|
||||
|
||||
default:
|
||||
/* A C++ function with deduced return type can have a TEMPLATE_TYPE_PARM
|
||||
named 'auto' in its type.
|
||||
|
|
|
@ -84,7 +84,6 @@ extensions, accepted by GCC in C90 mode and in C++.
|
|||
* x86 specific memory model extensions for transactional memory:: x86 memory models.
|
||||
* Object Size Checking:: Built-in functions for limited buffer overflow
|
||||
checking.
|
||||
* Pointer Bounds Checker builtins:: Built-in functions for Pointer Bounds Checker.
|
||||
* Other Builtins:: Other built-in functions.
|
||||
* Target Builtins:: Built-in functions specific to particular targets.
|
||||
* Target Format Checks:: Format checks specific to particular targets.
|
||||
|
@ -2465,19 +2464,6 @@ declares that @code{my_alloc1} returns 16-byte aligned pointer and
|
|||
that @code{my_alloc2} returns a pointer whose value modulo 32 is equal
|
||||
to 8.
|
||||
|
||||
@item bnd_instrument
|
||||
@cindex @code{bnd_instrument} function attribute
|
||||
The @code{bnd_instrument} attribute on functions is used to inform the
|
||||
compiler that the function should be instrumented when compiled
|
||||
with the @option{-fchkp-instrument-marked-only} option.
|
||||
|
||||
@item bnd_legacy
|
||||
@cindex @code{bnd_legacy} function attribute
|
||||
@cindex Pointer Bounds Checker attributes
|
||||
The @code{bnd_legacy} attribute on functions is used to inform the
|
||||
compiler that the function should not be instrumented when compiled
|
||||
with the @option{-fcheck-pointer-bounds} option.
|
||||
|
||||
@item cold
|
||||
@cindex @code{cold} function attribute
|
||||
The @code{cold} attribute on functions is used to inform the compiler that
|
||||
|
@ -5589,7 +5575,7 @@ caller-saved registers. That is, all registers are callee-saved. For
|
|||
example, this attribute can be used for a function called from an
|
||||
interrupt handler. The compiler generates proper function entry and
|
||||
exit sequences to save and restore any modified registers, except for
|
||||
the EFLAGS register. Since GCC doesn't preserve MPX, SSE, MMX nor x87
|
||||
the EFLAGS register. Since GCC doesn't preserve SSE, MMX nor x87
|
||||
states, the GCC option @option{-mgeneral-regs-only} should be used to
|
||||
compile functions with @code{no_caller_saved_registers} attribute.
|
||||
|
||||
|
@ -5603,7 +5589,7 @@ this attribute is present. The @code{IRET} instruction, instead of the
|
|||
@code{RET} instruction, is used to return from interrupt handlers. All
|
||||
registers, except for the EFLAGS register which is restored by the
|
||||
@code{IRET} instruction, are preserved by the compiler. Since GCC
|
||||
doesn't preserve MPX, SSE, MMX nor x87 states, the GCC option
|
||||
doesn't preserve SSE, MMX nor x87 states, the GCC option
|
||||
@option{-mgeneral-regs-only} should be used to compile interrupt and
|
||||
exception handlers.
|
||||
|
||||
|
@ -7004,38 +6990,6 @@ struct foo
|
|||
|
||||
This warning can be disabled by @option{-Wno-if-not-aligned}.
|
||||
|
||||
@item bnd_variable_size
|
||||
@cindex @code{bnd_variable_size} type attribute
|
||||
@cindex Pointer Bounds Checker attributes
|
||||
When applied to a structure field, this attribute tells Pointer
|
||||
Bounds Checker that the size of this field should not be computed
|
||||
using static type information. It may be used to mark variably-sized
|
||||
static array fields placed at the end of a structure.
|
||||
|
||||
@smallexample
|
||||
struct S
|
||||
@{
|
||||
int size;
|
||||
char data[1];
|
||||
@}
|
||||
S *p = (S *)malloc (sizeof(S) + 100);
|
||||
p->data[10] = 0; //Bounds violation
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
By using an attribute for the field we may avoid unwanted bound
|
||||
violation checks:
|
||||
|
||||
@smallexample
|
||||
struct S
|
||||
@{
|
||||
int size;
|
||||
char data[1] __attribute__((bnd_variable_size));
|
||||
@}
|
||||
S *p = (S *)malloc (sizeof(S) + 100);
|
||||
p->data[10] = 0; //OK
|
||||
@end smallexample
|
||||
|
||||
@item deprecated
|
||||
@itemx deprecated (@var{msg})
|
||||
@cindex @code{deprecated} type attribute
|
||||
|
@ -10924,182 +10878,6 @@ format string @var{fmt}. If the compiler is able to optimize them to
|
|||
@code{fputc} etc.@: functions, it does, otherwise the checking function
|
||||
is called and the @var{flag} argument passed to it.
|
||||
|
||||
@node Pointer Bounds Checker builtins
|
||||
@section Pointer Bounds Checker Built-in Functions
|
||||
@cindex Pointer Bounds Checker builtins
|
||||
@findex __builtin___bnd_set_ptr_bounds
|
||||
@findex __builtin___bnd_narrow_ptr_bounds
|
||||
@findex __builtin___bnd_copy_ptr_bounds
|
||||
@findex __builtin___bnd_init_ptr_bounds
|
||||
@findex __builtin___bnd_null_ptr_bounds
|
||||
@findex __builtin___bnd_store_ptr_bounds
|
||||
@findex __builtin___bnd_chk_ptr_lbounds
|
||||
@findex __builtin___bnd_chk_ptr_ubounds
|
||||
@findex __builtin___bnd_chk_ptr_bounds
|
||||
@findex __builtin___bnd_get_ptr_lbound
|
||||
@findex __builtin___bnd_get_ptr_ubound
|
||||
|
||||
GCC provides a set of built-in functions to control Pointer Bounds Checker
|
||||
instrumentation. Note that all Pointer Bounds Checker builtins can be used
|
||||
even if you compile with Pointer Bounds Checker off
|
||||
(@option{-fno-check-pointer-bounds}).
|
||||
The behavior may differ in such case as documented below.
|
||||
|
||||
@deftypefn {Built-in Function} {void *} __builtin___bnd_set_ptr_bounds (const void *@var{q}, size_t @var{size})
|
||||
|
||||
This built-in function returns a new pointer with the value of @var{q}, and
|
||||
associate it with the bounds [@var{q}, @var{q}+@var{size}-1]. With Pointer
|
||||
Bounds Checker off, the built-in function just returns the first argument.
|
||||
|
||||
@smallexample
|
||||
extern void *__wrap_malloc (size_t n)
|
||||
@{
|
||||
void *p = (void *)__real_malloc (n);
|
||||
if (!p) return __builtin___bnd_null_ptr_bounds (p);
|
||||
return __builtin___bnd_set_ptr_bounds (p, n);
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {void *} __builtin___bnd_narrow_ptr_bounds (const void *@var{p}, const void *@var{q}, size_t @var{size})
|
||||
|
||||
This built-in function returns a new pointer with the value of @var{p}
|
||||
and associates it with the narrowed bounds formed by the intersection
|
||||
of bounds associated with @var{q} and the bounds
|
||||
[@var{p}, @var{p} + @var{size} - 1].
|
||||
With Pointer Bounds Checker off, the built-in function just returns the first
|
||||
argument.
|
||||
|
||||
@smallexample
|
||||
void init_objects (object *objs, size_t size)
|
||||
@{
|
||||
size_t i;
|
||||
/* Initialize objects one-by-one passing pointers with bounds of
|
||||
an object, not the full array of objects. */
|
||||
for (i = 0; i < size; i++)
|
||||
init_object (__builtin___bnd_narrow_ptr_bounds (objs + i, objs,
|
||||
sizeof(object)));
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {void *} __builtin___bnd_copy_ptr_bounds (const void *@var{q}, const void *@var{r})
|
||||
|
||||
This built-in function returns a new pointer with the value of @var{q},
|
||||
and associates it with the bounds already associated with pointer @var{r}.
|
||||
With Pointer Bounds Checker off, the built-in function just returns the first
|
||||
argument.
|
||||
|
||||
@smallexample
|
||||
/* Here is a way to get pointer to object's field but
|
||||
still with the full object's bounds. */
|
||||
int *field_ptr = __builtin___bnd_copy_ptr_bounds (&objptr->int_field,
|
||||
objptr);
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {void *} __builtin___bnd_init_ptr_bounds (const void *@var{q})
|
||||
|
||||
This built-in function returns a new pointer with the value of @var{q}, and
|
||||
associates it with INIT (allowing full memory access) bounds. With Pointer
|
||||
Bounds Checker off, the built-in function just returns the first argument.
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {void *} __builtin___bnd_null_ptr_bounds (const void *@var{q})
|
||||
|
||||
This built-in function returns a new pointer with the value of @var{q}, and
|
||||
associates it with NULL (allowing no memory access) bounds. With Pointer
|
||||
Bounds Checker off, the built-in function just returns the first argument.
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __builtin___bnd_store_ptr_bounds (const void **@var{ptr_addr}, const void *@var{ptr_val})
|
||||
|
||||
This built-in function stores the bounds associated with pointer @var{ptr_val}
|
||||
and location @var{ptr_addr} into Bounds Table. This can be useful to propagate
|
||||
bounds from legacy code without touching the associated pointer's memory when
|
||||
pointers are copied as integers. With Pointer Bounds Checker off, the built-in
|
||||
function call is ignored.
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __builtin___bnd_chk_ptr_lbounds (const void *@var{q})
|
||||
|
||||
This built-in function checks if the pointer @var{q} is within the lower
|
||||
bound of its associated bounds. With Pointer Bounds Checker off, the built-in
|
||||
function call is ignored.
|
||||
|
||||
@smallexample
|
||||
extern void *__wrap_memset (void *dst, int c, size_t len)
|
||||
@{
|
||||
if (len > 0)
|
||||
@{
|
||||
__builtin___bnd_chk_ptr_lbounds (dst);
|
||||
__builtin___bnd_chk_ptr_ubounds ((char *)dst + len - 1);
|
||||
__real_memset (dst, c, len);
|
||||
@}
|
||||
return dst;
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __builtin___bnd_chk_ptr_ubounds (const void *@var{q})
|
||||
|
||||
This built-in function checks if the pointer @var{q} is within the upper
|
||||
bound of its associated bounds. With Pointer Bounds Checker off, the built-in
|
||||
function call is ignored.
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __builtin___bnd_chk_ptr_bounds (const void *@var{q}, size_t @var{size})
|
||||
|
||||
This built-in function checks if [@var{q}, @var{q} + @var{size} - 1] is within
|
||||
the lower and upper bounds associated with @var{q}. With Pointer Bounds Checker
|
||||
off, the built-in function call is ignored.
|
||||
|
||||
@smallexample
|
||||
extern void *__wrap_memcpy (void *dst, const void *src, size_t n)
|
||||
@{
|
||||
if (n > 0)
|
||||
@{
|
||||
__bnd_chk_ptr_bounds (dst, n);
|
||||
__bnd_chk_ptr_bounds (src, n);
|
||||
__real_memcpy (dst, src, n);
|
||||
@}
|
||||
return dst;
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {const void *} __builtin___bnd_get_ptr_lbound (const void *@var{q})
|
||||
|
||||
This built-in function returns the lower bound associated
|
||||
with the pointer @var{q}, as a pointer value.
|
||||
This is useful for debugging using @code{printf}.
|
||||
With Pointer Bounds Checker off, the built-in function returns 0.
|
||||
|
||||
@smallexample
|
||||
void *lb = __builtin___bnd_get_ptr_lbound (q);
|
||||
void *ub = __builtin___bnd_get_ptr_ubound (q);
|
||||
printf ("q = %p lb(q) = %p ub(q) = %p", q, lb, ub);
|
||||
@end smallexample
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} {const void *} __builtin___bnd_get_ptr_ubound (const void *@var{q})
|
||||
|
||||
This built-in function returns the upper bound (which is a pointer) associated
|
||||
with the pointer @var{q}. With Pointer Bounds Checker off,
|
||||
the built-in function returns -1.
|
||||
|
||||
@end deftypefn
|
||||
|
||||
@node Other Builtins
|
||||
@section Other Built-in Functions Provided by GCC
|
||||
@cindex built-in functions
|
||||
|
|
|
@ -269,7 +269,7 @@ Objective-C and Objective-C++ Dialects}.
|
|||
-Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat @gol
|
||||
-Wc++-compat -Wc++11-compat -Wc++14-compat @gol
|
||||
-Wcast-align -Wcast-align=strict -Wcast-function-type -Wcast-qual @gol
|
||||
-Wchar-subscripts -Wchkp -Wcatch-value -Wcatch-value=@var{n} @gol
|
||||
-Wchar-subscripts -Wcatch-value -Wcatch-value=@var{n} @gol
|
||||
-Wclobbered -Wcomment -Wconditionally-supported @gol
|
||||
-Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol
|
||||
-Wdelete-incomplete @gol
|
||||
|
@ -459,15 +459,6 @@ Objective-C and Objective-C++ Dialects}.
|
|||
-fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
|
||||
-fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
|
||||
-fsanitize-undefined-trap-on-error -fbounds-check @gol
|
||||
-fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
|
||||
-fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
|
||||
-fchkp-narrow-to-innermost-array -fchkp-optimize @gol
|
||||
-fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
|
||||
-fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
|
||||
-fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
|
||||
-fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
|
||||
-fchkp-instrument-calls -fchkp-instrument-marked-only @gol
|
||||
-fchkp-use-wrappers -fchkp-flexible-struct-trailing-arrays@gol
|
||||
-fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]} @gol
|
||||
-fstack-protector -fstack-protector-all -fstack-protector-strong @gol
|
||||
-fstack-protector-explicit -fstack-check @gol
|
||||
|
@ -508,7 +499,6 @@ Objective-C and Objective-C++ Dialects}.
|
|||
-nostartfiles -nodefaultlibs -nostdlib -pie -pthread -rdynamic @gol
|
||||
-s -static -static-pie -static-libgcc -static-libstdc++ @gol
|
||||
-static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
|
||||
-static-libmpx -static-libmpxwrappers @gol
|
||||
-shared -shared-libgcc -symbolic @gol
|
||||
-T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
|
||||
-u @var{symbol} -z @var{keyword}}
|
||||
|
@ -1258,7 +1248,7 @@ See RS/6000 and PowerPC Options.
|
|||
-mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mpconfig -mwbnoinvd @gol
|
||||
-mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
|
||||
-msse4a -m3dnow -m3dnowa -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop @gol
|
||||
-mlzcnt -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx @gol
|
||||
-mlzcnt -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp @gol
|
||||
-mmwaitx -mclzero -mpku -mthreads -mgfni -mvaes -mwaitpkg @gol
|
||||
-mshstk -mforce-indirect-call -mavx512vbmi2 @gol
|
||||
-mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b -mavx512vpopcntdq
|
||||
|
@ -4061,11 +4051,6 @@ of error, as programmers often forget that this type is signed on some
|
|||
machines.
|
||||
This warning is enabled by @option{-Wall}.
|
||||
|
||||
@item -Wchkp
|
||||
@opindex Wchkp
|
||||
Warn about an invalid memory access that is found by Pointer Bounds Checker
|
||||
(@option{-fcheck-pointer-bounds}).
|
||||
|
||||
@item -Wno-coverage-mismatch
|
||||
@opindex Wno-coverage-mismatch
|
||||
Warn if feedback profiles do not match when using the
|
||||
|
@ -11135,12 +11120,6 @@ If the size of a local variable in bytes is smaller or equal to this
|
|||
number, directly poison (or unpoison) shadow memory instead of using
|
||||
run-time callbacks. The default value is 256.
|
||||
|
||||
@item chkp-max-ctor-size
|
||||
Static constructors generated by Pointer Bounds Checker may become very
|
||||
large and significantly increase compile time at optimization level
|
||||
@option{-O1} and higher. This parameter is a maximum number of statements
|
||||
in a single generated constructor. Default value is 5000.
|
||||
|
||||
@item max-fsm-thread-path-insns
|
||||
Maximum number of instructions to copy when duplicating blocks on a
|
||||
finite state automaton jump thread path. The default is 100.
|
||||
|
@ -11403,22 +11382,19 @@ more details. The run-time behavior can be influenced using the
|
|||
the available options are shown at startup of the instrumented program. See
|
||||
@url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
|
||||
for a list of supported options.
|
||||
The option cannot be combined with @option{-fsanitize=thread}
|
||||
and/or @option{-fcheck-pointer-bounds}.
|
||||
The option cannot be combined with @option{-fsanitize=thread}.
|
||||
|
||||
@item -fsanitize=kernel-address
|
||||
@opindex fsanitize=kernel-address
|
||||
Enable AddressSanitizer for Linux kernel.
|
||||
See @uref{https://github.com/google/kasan/wiki} for more details.
|
||||
The option cannot be combined with @option{-fcheck-pointer-bounds}.
|
||||
|
||||
@item -fsanitize=pointer-compare
|
||||
@opindex fsanitize=pointer-compare
|
||||
Instrument comparison operation (<, <=, >, >=) with pointer operands.
|
||||
The option must be combined with either @option{-fsanitize=kernel-address} or
|
||||
@option{-fsanitize=address}
|
||||
The option cannot be combined with @option{-fsanitize=thread}
|
||||
and/or @option{-fcheck-pointer-bounds}.
|
||||
The option cannot be combined with @option{-fsanitize=thread}.
|
||||
Note: By default the check is disabled at run time. To enable it,
|
||||
add @code{detect_invalid_pointer_pairs=2} to the environment variable
|
||||
@env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
|
||||
|
@ -11429,8 +11405,7 @@ invalid operation only when both pointers are non-null.
|
|||
Instrument subtraction with pointer operands.
|
||||
The option must be combined with either @option{-fsanitize=kernel-address} or
|
||||
@option{-fsanitize=address}
|
||||
The option cannot be combined with @option{-fsanitize=thread}
|
||||
and/or @option{-fcheck-pointer-bounds}.
|
||||
The option cannot be combined with @option{-fsanitize=thread}.
|
||||
Note: By default the check is disabled at run time. To enable it,
|
||||
add @code{detect_invalid_pointer_pairs=2} to the environment variable
|
||||
@env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
|
||||
|
@ -11446,7 +11421,7 @@ environment variable; see
|
|||
@url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
|
||||
supported options.
|
||||
The option cannot be combined with @option{-fsanitize=address},
|
||||
@option{-fsanitize=leak} and/or @option{-fcheck-pointer-bounds}.
|
||||
@option{-fsanitize=leak}.
|
||||
|
||||
Note that sanitized atomic builtins cannot throw exceptions when
|
||||
operating on invalid memory addresses with non-call exceptions
|
||||
|
@ -11539,15 +11514,13 @@ a++;
|
|||
This option enables instrumentation of array bounds. Various out of bounds
|
||||
accesses are detected. Flexible array members, flexible array member-like
|
||||
arrays, and initializers of variables with static storage are not instrumented.
|
||||
The option cannot be combined with @option{-fcheck-pointer-bounds}.
|
||||
|
||||
@item -fsanitize=bounds-strict
|
||||
@opindex fsanitize=bounds-strict
|
||||
This option enables strict instrumentation of array bounds. Most out of bounds
|
||||
accesses are detected, including flexible array members and flexible array
|
||||
member-like arrays. Initializers of variables with static storage are not
|
||||
instrumented. The option cannot be combined
|
||||
with @option{-fcheck-pointer-bounds}.
|
||||
instrumented.
|
||||
|
||||
@item -fsanitize=alignment
|
||||
@opindex fsanitize=alignment
|
||||
|
@ -11721,171 +11694,6 @@ operand constant, @code{__sanitizer_cov_trace_cmpf} or
|
|||
@code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
|
||||
@code{__sanitizer_cov_trace_switch} for switch statements.
|
||||
|
||||
@item -fbounds-check
|
||||
@opindex fbounds-check
|
||||
For front ends that support it, generate additional code to check that
|
||||
indices used to access arrays are within the declared range. This is
|
||||
currently only supported by the Fortran front end, where this option
|
||||
defaults to false.
|
||||
|
||||
@item -fcheck-pointer-bounds
|
||||
@opindex fcheck-pointer-bounds
|
||||
@opindex fno-check-pointer-bounds
|
||||
@cindex Pointer Bounds Checker options
|
||||
Enable Pointer Bounds Checker instrumentation. Each memory reference
|
||||
is instrumented with checks of the pointer used for memory access against
|
||||
bounds associated with that pointer.
|
||||
|
||||
Currently there
|
||||
is only an implementation for Intel MPX available, thus x86 GNU/Linux target
|
||||
and @option{-mmpx} are required to enable this feature.
|
||||
MPX-based instrumentation requires
|
||||
a runtime library to enable MPX in hardware and handle bounds
|
||||
violation signals. By default when @option{-fcheck-pointer-bounds}
|
||||
and @option{-mmpx} options are used to link a program, the GCC driver
|
||||
links against the @file{libmpx} and @file{libmpxwrappers} libraries.
|
||||
Bounds checking on calls to dynamic libraries requires a linker
|
||||
with @option{-z bndplt} support; if GCC was configured with a linker
|
||||
without support for this option (including the Gold linker and older
|
||||
versions of ld), a warning is given if you link with @option{-mmpx}
|
||||
without also specifying @option{-static}, since the overall effectiveness
|
||||
of the bounds checking protection is reduced.
|
||||
See also @option{-static-libmpxwrappers}.
|
||||
|
||||
MPX-based instrumentation
|
||||
may be used for debugging and also may be included in production code
|
||||
to increase program security. Depending on usage, you may
|
||||
have different requirements for the runtime library. The current version
|
||||
of the MPX runtime library is more oriented for use as a debugging
|
||||
tool. MPX runtime library usage implies @option{-lpthread}. See
|
||||
also @option{-static-libmpx}. The runtime library behavior can be
|
||||
influenced using various @env{CHKP_RT_*} environment variables. See
|
||||
@uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
|
||||
for more details.
|
||||
|
||||
Generated instrumentation may be controlled by various
|
||||
@option{-fchkp-*} options and by the @code{bnd_variable_size}
|
||||
structure field attribute (@pxref{Type Attributes}) and
|
||||
@code{bnd_legacy}, and @code{bnd_instrument} function attributes
|
||||
(@pxref{Function Attributes}). GCC also provides a number of built-in
|
||||
functions for controlling the Pointer Bounds Checker. @xref{Pointer
|
||||
Bounds Checker builtins}, for more information.
|
||||
|
||||
@item -fchkp-check-incomplete-type
|
||||
@opindex fchkp-check-incomplete-type
|
||||
@opindex fno-chkp-check-incomplete-type
|
||||
Generate pointer bounds checks for variables with incomplete type.
|
||||
Enabled by default.
|
||||
|
||||
@item -fchkp-narrow-bounds
|
||||
@opindex fchkp-narrow-bounds
|
||||
@opindex fno-chkp-narrow-bounds
|
||||
Controls bounds used by Pointer Bounds Checker for pointers to object
|
||||
fields. If narrowing is enabled then field bounds are used. Otherwise
|
||||
object bounds are used. See also @option{-fchkp-narrow-to-innermost-array}
|
||||
and @option{-fchkp-first-field-has-own-bounds}. Enabled by default.
|
||||
|
||||
@item -fchkp-first-field-has-own-bounds
|
||||
@opindex fchkp-first-field-has-own-bounds
|
||||
@opindex fno-chkp-first-field-has-own-bounds
|
||||
Forces Pointer Bounds Checker to use narrowed bounds for the address of the
|
||||
first field in the structure. By default a pointer to the first field has
|
||||
the same bounds as a pointer to the whole structure.
|
||||
|
||||
@item -fchkp-flexible-struct-trailing-arrays
|
||||
@opindex fchkp-flexible-struct-trailing-arrays
|
||||
@opindex fno-chkp-flexible-struct-trailing-arrays
|
||||
Forces Pointer Bounds Checker to treat all trailing arrays in structures as
|
||||
possibly flexible. By default only array fields with zero length or that are
|
||||
marked with attribute bnd_variable_size are treated as flexible.
|
||||
|
||||
@item -fchkp-narrow-to-innermost-array
|
||||
@opindex fchkp-narrow-to-innermost-array
|
||||
@opindex fno-chkp-narrow-to-innermost-array
|
||||
Forces Pointer Bounds Checker to use bounds of the innermost arrays in
|
||||
case of nested static array access. By default this option is disabled and
|
||||
bounds of the outermost array are used.
|
||||
|
||||
@item -fchkp-optimize
|
||||
@opindex fchkp-optimize
|
||||
@opindex fno-chkp-optimize
|
||||
Enables Pointer Bounds Checker optimizations. Enabled by default at
|
||||
optimization levels @option{-O}, @option{-O2}, @option{-O3}.
|
||||
|
||||
@item -fchkp-use-fast-string-functions
|
||||
@opindex fchkp-use-fast-string-functions
|
||||
@opindex fno-chkp-use-fast-string-functions
|
||||
Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
|
||||
by Pointer Bounds Checker. Disabled by default.
|
||||
|
||||
@item -fchkp-use-nochk-string-functions
|
||||
@opindex fchkp-use-nochk-string-functions
|
||||
@opindex fno-chkp-use-nochk-string-functions
|
||||
Enables use of @code{*_nochk} versions of string functions (not checking bounds)
|
||||
by Pointer Bounds Checker. Disabled by default.
|
||||
|
||||
@item -fchkp-use-static-bounds
|
||||
@opindex fchkp-use-static-bounds
|
||||
@opindex fno-chkp-use-static-bounds
|
||||
Allow Pointer Bounds Checker to generate static bounds holding
|
||||
bounds of static variables. Enabled by default.
|
||||
|
||||
@item -fchkp-use-static-const-bounds
|
||||
@opindex fchkp-use-static-const-bounds
|
||||
@opindex fno-chkp-use-static-const-bounds
|
||||
Use statically-initialized bounds for constant bounds instead of
|
||||
generating them each time they are required. By default enabled when
|
||||
@option{-fchkp-use-static-bounds} is enabled.
|
||||
|
||||
@item -fchkp-treat-zero-dynamic-size-as-infinite
|
||||
@opindex fchkp-treat-zero-dynamic-size-as-infinite
|
||||
@opindex fno-chkp-treat-zero-dynamic-size-as-infinite
|
||||
With this option, objects with incomplete type whose
|
||||
dynamically-obtained size is zero are treated as having infinite size
|
||||
instead by Pointer Bounds
|
||||
Checker. This option may be helpful if a program is linked with a library
|
||||
missing size information for some symbols. Disabled by default.
|
||||
|
||||
@item -fchkp-check-read
|
||||
@opindex fchkp-check-read
|
||||
@opindex fno-chkp-check-read
|
||||
Instructs Pointer Bounds Checker to generate checks for all read
|
||||
accesses to memory. Enabled by default.
|
||||
|
||||
@item -fchkp-check-write
|
||||
@opindex fchkp-check-write
|
||||
@opindex fno-chkp-check-write
|
||||
Instructs Pointer Bounds Checker to generate checks for all write
|
||||
accesses to memory. Enabled by default.
|
||||
|
||||
@item -fchkp-store-bounds
|
||||
@opindex fchkp-store-bounds
|
||||
@opindex fno-chkp-store-bounds
|
||||
Instructs Pointer Bounds Checker to generate bounds stores for
|
||||
pointer writes. Enabled by default.
|
||||
|
||||
@item -fchkp-instrument-calls
|
||||
@opindex fchkp-instrument-calls
|
||||
@opindex fno-chkp-instrument-calls
|
||||
Instructs Pointer Bounds Checker to pass pointer bounds to calls.
|
||||
Enabled by default.
|
||||
|
||||
@item -fchkp-instrument-marked-only
|
||||
@opindex fchkp-instrument-marked-only
|
||||
@opindex fno-chkp-instrument-marked-only
|
||||
Instructs Pointer Bounds Checker to instrument only functions
|
||||
marked with the @code{bnd_instrument} attribute
|
||||
(@pxref{Function Attributes}). Disabled by default.
|
||||
|
||||
@item -fchkp-use-wrappers
|
||||
@opindex fchkp-use-wrappers
|
||||
@opindex fno-chkp-use-wrappers
|
||||
Allows Pointer Bounds Checker to replace calls to built-in functions
|
||||
with calls to wrapper functions. When @option{-fchkp-use-wrappers}
|
||||
is used to link a program, the GCC driver automatically links
|
||||
against @file{libmpxwrappers}. See also @option{-static-libmpxwrappers}.
|
||||
Enabled by default.
|
||||
|
||||
@item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{]}
|
||||
@opindex fcf-protection
|
||||
Enable code instrumentation of control-flow transfers to increase
|
||||
|
@ -12590,27 +12398,6 @@ option is not used, then this links against the shared version of
|
|||
driver to link @file{libubsan} statically, without necessarily linking
|
||||
other libraries statically.
|
||||
|
||||
@item -static-libmpx
|
||||
@opindex static-libmpx
|
||||
When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
|
||||
used to link a program, the GCC driver automatically links against
|
||||
@file{libmpx}. If @file{libmpx} is available as a shared library,
|
||||
and the @option{-static} option is not used, then this links against
|
||||
the shared version of @file{libmpx}. The @option{-static-libmpx}
|
||||
option directs the GCC driver to link @file{libmpx} statically,
|
||||
without necessarily linking other libraries statically.
|
||||
|
||||
@item -static-libmpxwrappers
|
||||
@opindex static-libmpxwrappers
|
||||
When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
|
||||
to link a program without also using @option{-fno-chkp-use-wrappers}, the
|
||||
GCC driver automatically links against @file{libmpxwrappers}. If
|
||||
@file{libmpxwrappers} is available as a shared library, and the
|
||||
@option{-static} option is not used, then this links against the shared
|
||||
version of @file{libmpxwrappers}. The @option{-static-libmpxwrappers}
|
||||
option directs the GCC driver to link @file{libmpxwrappers} statically,
|
||||
without necessarily linking other libraries statically.
|
||||
|
||||
@item -static-libstdc++
|
||||
@opindex static-libstdc++
|
||||
When the @command{g++} program is used to link a C++ program, it
|
||||
|
@ -27387,9 +27174,6 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
|
|||
@itemx -mtbm
|
||||
@opindex mtbm
|
||||
@need 200
|
||||
@itemx -mmpx
|
||||
@opindex mmpx
|
||||
@need 200
|
||||
@itemx -mmwaitx
|
||||
@opindex mmwaitx
|
||||
@need 200
|
||||
|
@ -27432,7 +27216,7 @@ These switches enable the use of instructions in the MMX, SSE,
|
|||
SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
|
||||
SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
|
||||
AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, BMI, BMI2, VAES, WAITPKG,
|
||||
FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2,
|
||||
FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2,
|
||||
GFNI, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B,
|
||||
AVX512VPOPCNTDQ, CLDEMOTE, 3DNow!@: or enhanced 3DNow!@: extended instruction
|
||||
sets. Each has a corresponding @option{-mno-} option to disable use of these
|
||||
|
@ -28018,9 +27802,8 @@ Note that @option{-mcmodel=large} is incompatible with
|
|||
not be reachable in the large code model.
|
||||
|
||||
Note that @option{-mindirect-branch=thunk-extern} is incompatible with
|
||||
@option{-fcf-protection=branch} and @option{-fcheck-pointer-bounds}
|
||||
since the external thunk can not be modified to disable control-flow
|
||||
check.
|
||||
@option{-fcf-protection=branch} since the external thunk can not be modified
|
||||
to disable control-flow check.
|
||||
|
||||
@item -mfunction-return=@var{choice}
|
||||
@opindex -mfunction-return
|
||||
|
|
|
@ -4189,12 +4189,6 @@ VSIB address operand.
|
|||
@item Ts
|
||||
Address operand without segment register.
|
||||
|
||||
@item Ti
|
||||
MPX address operand without index.
|
||||
|
||||
@item Tb
|
||||
MPX address operand without base.
|
||||
|
||||
@end table
|
||||
|
||||
@item Xstormy16---@file{config/stormy16/stormy16.h}
|
||||
|
|
|
@ -5252,12 +5252,6 @@ This hook is used by expand pass to emit insn to store @var{bounds}
|
|||
returned by function call into @var{slot}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Target Hook} rtx TARGET_CHKP_FUNCTION_VALUE_BOUNDS (const_tree @var{ret_type}, const_tree @var{fn_decl_or_type}, bool @var{outgoing})
|
||||
Define this to return an RTX representing the place where a function
|
||||
returns bounds for returned pointers. Arguments meaning is similar to
|
||||
@code{TARGET_FUNCTION_VALUE}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARG_BOUNDS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
|
||||
Use it to store bounds for anonymous register arguments stored
|
||||
into the stack. Arguments meaning is similar to
|
||||
|
@ -11417,93 +11411,6 @@ ignored. This function should return the result of the call to the
|
|||
built-in function.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Target Hook} tree TARGET_BUILTIN_CHKP_FUNCTION (unsigned @var{fcode})
|
||||
This hook allows target to redefine built-in functions used by
|
||||
Pointer Bounds Checker for code instrumentation. Hook should return
|
||||
fndecl of function implementing generic builtin whose code is
|
||||
passed in @var{fcode}. Currently following built-in functions are
|
||||
obtained using this hook:
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndmk (const void *@var{lb}, size_t @var{size})
|
||||
Function code - BUILT_IN_CHKP_BNDMK. This built-in function is used
|
||||
by Pointer Bounds Checker to create bound values. @var{lb} holds low
|
||||
bound of the resulting bounds. @var{size} holds size of created bounds.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __chkp_bndstx (const void *@var{ptr}, __bounds_type @var{b}, const void **@var{loc})
|
||||
Function code - @code{BUILT_IN_CHKP_BNDSTX}. This built-in function is used
|
||||
by Pointer Bounds Checker to store bounds @var{b} for pointer @var{ptr}
|
||||
when @var{ptr} is stored by address @var{loc}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndldx (const void **@var{loc}, const void *@var{ptr})
|
||||
Function code - @code{BUILT_IN_CHKP_BNDLDX}. This built-in function is used
|
||||
by Pointer Bounds Checker to get bounds of pointer @var{ptr} loaded by
|
||||
address @var{loc}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __chkp_bndcl (const void *@var{ptr}, __bounds_type @var{b})
|
||||
Function code - @code{BUILT_IN_CHKP_BNDCL}. This built-in function is used
|
||||
by Pointer Bounds Checker to perform check for pointer @var{ptr} against
|
||||
lower bound of bounds @var{b}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} void __chkp_bndcu (const void *@var{ptr}, __bounds_type @var{b})
|
||||
Function code - @code{BUILT_IN_CHKP_BNDCU}. This built-in function is used
|
||||
by Pointer Bounds Checker to perform check for pointer @var{ptr} against
|
||||
upper bound of bounds @var{b}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndret (void *@var{ptr})
|
||||
Function code - @code{BUILT_IN_CHKP_BNDRET}. This built-in function is used
|
||||
by Pointer Bounds Checker to obtain bounds returned by a call statement.
|
||||
@var{ptr} passed to built-in is @code{SSA_NAME} returned by the call.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_intersect (__bounds_type @var{b1}, __bounds_type @var{b2})
|
||||
Function code - @code{BUILT_IN_CHKP_INTERSECT}. This built-in function
|
||||
returns intersection of bounds @var{b1} and @var{b2}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_narrow (const void *@var{ptr}, __bounds_type @var{b}, size_t @var{s})
|
||||
Function code - @code{BUILT_IN_CHKP_NARROW}. This built-in function
|
||||
returns intersection of bounds @var{b} and
|
||||
[@var{ptr}, @var{ptr} + @var{s} - @code{1}].
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} size_t __chkp_sizeof (const void *@var{ptr})
|
||||
Function code - @code{BUILT_IN_CHKP_SIZEOF}. This built-in function
|
||||
returns size of object referenced by @var{ptr}. @var{ptr} is always
|
||||
@code{ADDR_EXPR} of @code{VAR_DECL}. This built-in is used by
|
||||
Pointer Bounds Checker when bounds of object cannot be computed statically
|
||||
(e.g. object has incomplete type).
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} const void *__chkp_extract_lower (__bounds_type @var{b})
|
||||
Function code - @code{BUILT_IN_CHKP_EXTRACT_LOWER}. This built-in function
|
||||
returns lower bound of bounds @var{b}.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Built-in Function} const void *__chkp_extract_upper (__bounds_type @var{b})
|
||||
Function code - @code{BUILT_IN_CHKP_EXTRACT_UPPER}. This built-in function
|
||||
returns upper bound of bounds @var{b}.
|
||||
@end deftypefn
|
||||
@end deftypefn
|
||||
@deftypefn {Target Hook} tree TARGET_CHKP_BOUND_TYPE (void)
|
||||
Return type to be used for bounds
|
||||
@end deftypefn
|
||||
@deftypefn {Target Hook} machine_mode TARGET_CHKP_BOUND_MODE (void)
|
||||
Return mode to be used for bounds.
|
||||
@end deftypefn
|
||||
@deftypefn {Target Hook} tree TARGET_CHKP_MAKE_BOUNDS_CONSTANT (HOST_WIDE_INT @var{lb}, HOST_WIDE_INT @var{ub})
|
||||
Return constant used to statically initialize constant bounds
|
||||
with specified lower bound @var{lb} and upper bounds @var{ub}.
|
||||
@end deftypefn
|
||||
@deftypefn {Target Hook} int TARGET_CHKP_INITIALIZE_BOUNDS (tree @var{var}, tree @var{lb}, tree @var{ub}, tree *@var{stmts})
|
||||
Generate a list of statements @var{stmts} to initialize pointer
|
||||
bounds variable @var{var} with bounds @var{lb} and @var{ub}. Return
|
||||
the number of generated statements.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int @var{loc}, tree @var{fndecl}, void *@var{arglist})
|
||||
Select a replacement for a machine specific built-in function that
|
||||
was set up by @samp{TARGET_INIT_BUILTINS}. This is done
|
||||
|
|
|
@ -3761,8 +3761,6 @@ These machine description macros help implement varargs:
|
|||
|
||||
@hook TARGET_STORE_RETURNED_BOUNDS
|
||||
|
||||
@hook TARGET_CHKP_FUNCTION_VALUE_BOUNDS
|
||||
|
||||
@hook TARGET_SETUP_INCOMING_VARARG_BOUNDS
|
||||
|
||||
@node Trampolines
|
||||
|
@ -7866,12 +7864,6 @@ to by @var{ce_info}.
|
|||
|
||||
@hook TARGET_EXPAND_BUILTIN
|
||||
|
||||
@hook TARGET_BUILTIN_CHKP_FUNCTION
|
||||
@hook TARGET_CHKP_BOUND_TYPE
|
||||
@hook TARGET_CHKP_BOUND_MODE
|
||||
@hook TARGET_CHKP_MAKE_BOUNDS_CONSTANT
|
||||
@hook TARGET_CHKP_INITIALIZE_BOUNDS
|
||||
|
||||
@hook TARGET_RESOLVE_OVERLOADED_BUILTIN
|
||||
|
||||
@hook TARGET_FOLD_BUILTIN
|
||||
|
|
|
@ -12918,7 +12918,6 @@ is_base_type (tree type)
|
|||
case FIXED_POINT_TYPE:
|
||||
case COMPLEX_TYPE:
|
||||
case BOOLEAN_TYPE:
|
||||
case POINTER_BOUNDS_TYPE:
|
||||
return 1;
|
||||
|
||||
case VOID_TYPE:
|
||||
|
@ -22295,21 +22294,18 @@ gen_formal_types_die (tree function_or_method_type, dw_die_ref context_die)
|
|||
break;
|
||||
|
||||
/* Output a (nameless) DIE to represent the formal parameter itself. */
|
||||
if (!POINTER_BOUNDS_TYPE_P (formal_type))
|
||||
parm_die = gen_formal_parameter_die (formal_type, NULL,
|
||||
true /* Emit name attribute. */,
|
||||
context_die);
|
||||
if (TREE_CODE (function_or_method_type) == METHOD_TYPE
|
||||
&& link == first_parm_type)
|
||||
{
|
||||
parm_die = gen_formal_parameter_die (formal_type, NULL,
|
||||
true /* Emit name attribute. */,
|
||||
context_die);
|
||||
if (TREE_CODE (function_or_method_type) == METHOD_TYPE
|
||||
&& link == first_parm_type)
|
||||
{
|
||||
add_AT_flag (parm_die, DW_AT_artificial, 1);
|
||||
if (dwarf_version >= 3 || !dwarf_strict)
|
||||
add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die);
|
||||
}
|
||||
else if (arg && DECL_ARTIFICIAL (arg))
|
||||
add_AT_flag (parm_die, DW_AT_artificial, 1);
|
||||
add_AT_flag (parm_die, DW_AT_artificial, 1);
|
||||
if (dwarf_version >= 3 || !dwarf_strict)
|
||||
add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die);
|
||||
}
|
||||
else if (arg && DECL_ARTIFICIAL (arg))
|
||||
add_AT_flag (parm_die, DW_AT_artificial, 1);
|
||||
|
||||
link = TREE_CHAIN (link);
|
||||
if (arg)
|
||||
|
@ -23176,7 +23172,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
|
|||
gen_formal_parameter_pack_die (generic_decl_parm,
|
||||
parm, subr_die,
|
||||
&parm);
|
||||
else if (parm && !POINTER_BOUNDS_P (parm))
|
||||
else if (parm)
|
||||
{
|
||||
dw_die_ref parm_die = gen_decl_die (parm, NULL, NULL, subr_die);
|
||||
|
||||
|
@ -25561,7 +25557,6 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
|
|||
case FIXED_POINT_TYPE:
|
||||
case COMPLEX_TYPE:
|
||||
case BOOLEAN_TYPE:
|
||||
case POINTER_BOUNDS_TYPE:
|
||||
/* No DIEs needed for fundamental types. */
|
||||
break;
|
||||
|
||||
|
@ -26141,12 +26136,6 @@ gen_decl_die (tree decl, tree origin, struct vlr_context *ctx,
|
|||
if (DECL_P (decl_or_origin) && DECL_IGNORED_P (decl_or_origin))
|
||||
return NULL;
|
||||
|
||||
/* Ignore pointer bounds decls. */
|
||||
if (DECL_P (decl_or_origin)
|
||||
&& TREE_TYPE (decl_or_origin)
|
||||
&& POINTER_BOUNDS_P (decl_or_origin))
|
||||
return NULL;
|
||||
|
||||
switch (TREE_CODE (decl_or_origin))
|
||||
{
|
||||
case ERROR_MARK:
|
||||
|
@ -26480,7 +26469,7 @@ dwarf2out_late_global_decl (tree decl)
|
|||
{
|
||||
/* Fill-in any location information we were unable to determine
|
||||
on the first pass. */
|
||||
if (VAR_P (decl) && !POINTER_BOUNDS_P (decl))
|
||||
if (VAR_P (decl))
|
||||
{
|
||||
dw_die_ref die = lookup_decl_die (decl);
|
||||
|
||||
|
|
78
gcc/expr.c
78
gcc/expr.c
|
@ -58,8 +58,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tree-outof-ssa.h"
|
||||
#include "tree-ssa-address.h"
|
||||
#include "builtins.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "rtl-chkp.h"
|
||||
#include "ccmp.h"
|
||||
#include "rtx-vector-builder.h"
|
||||
|
||||
|
@ -5283,14 +5281,10 @@ expand_assignment (tree to, tree from, bool nontemporal)
|
|||
|| TREE_CODE (to) == SSA_NAME))
|
||||
{
|
||||
rtx value;
|
||||
rtx bounds;
|
||||
|
||||
push_temp_slots ();
|
||||
value = expand_normal (from);
|
||||
|
||||
/* Split value and bounds to store them separately. */
|
||||
chkp_split_slot (value, &value, &bounds);
|
||||
|
||||
if (to_rtx == 0)
|
||||
to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_WRITE);
|
||||
|
||||
|
@ -5325,14 +5319,6 @@ expand_assignment (tree to, tree from, bool nontemporal)
|
|||
emit_move_insn (to_rtx, value);
|
||||
}
|
||||
|
||||
/* Store bounds if required. */
|
||||
if (bounds
|
||||
&& (BOUNDED_P (to) || chkp_type_has_pointer (TREE_TYPE (to))))
|
||||
{
|
||||
gcc_assert (MEM_P (to_rtx));
|
||||
chkp_emit_bounds_store (bounds, value, to_rtx);
|
||||
}
|
||||
|
||||
preserve_temp_slots (to_rtx);
|
||||
pop_temp_slots ();
|
||||
return;
|
||||
|
@ -5403,7 +5389,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
|
|||
/* Compute FROM and store the value in the rtx we got. */
|
||||
|
||||
push_temp_slots ();
|
||||
result = store_expr_with_bounds (from, to_rtx, 0, nontemporal, false, to);
|
||||
result = store_expr (from, to_rtx, 0, nontemporal, false);
|
||||
preserve_temp_slots (result);
|
||||
pop_temp_slots ();
|
||||
return;
|
||||
|
@ -5442,14 +5428,11 @@ emit_storent_insn (rtx to, rtx from)
|
|||
|
||||
If NONTEMPORAL is true, try using a nontemporal store instruction.
|
||||
|
||||
If REVERSE is true, the store is to be done in reverse order.
|
||||
|
||||
If BTARGET is not NULL then computed bounds of EXP are
|
||||
associated with BTARGET. */
|
||||
If REVERSE is true, the store is to be done in reverse order. */
|
||||
|
||||
rtx
|
||||
store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
||||
bool nontemporal, bool reverse, tree btarget)
|
||||
store_expr (tree exp, rtx target, int call_param_p,
|
||||
bool nontemporal, bool reverse)
|
||||
{
|
||||
rtx temp;
|
||||
rtx alt_rtl = NULL_RTX;
|
||||
|
@ -5470,9 +5453,8 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
|||
part. */
|
||||
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode,
|
||||
call_param_p ? EXPAND_STACK_PARM : EXPAND_NORMAL);
|
||||
return store_expr_with_bounds (TREE_OPERAND (exp, 1), target,
|
||||
call_param_p, nontemporal, reverse,
|
||||
btarget);
|
||||
return store_expr (TREE_OPERAND (exp, 1), target,
|
||||
call_param_p, nontemporal, reverse);
|
||||
}
|
||||
else if (TREE_CODE (exp) == COND_EXPR && GET_MODE (target) == BLKmode)
|
||||
{
|
||||
|
@ -5487,13 +5469,13 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
|||
NO_DEFER_POP;
|
||||
jumpifnot (TREE_OPERAND (exp, 0), lab1,
|
||||
profile_probability::uninitialized ());
|
||||
store_expr_with_bounds (TREE_OPERAND (exp, 1), target, call_param_p,
|
||||
nontemporal, reverse, btarget);
|
||||
store_expr (TREE_OPERAND (exp, 1), target, call_param_p,
|
||||
nontemporal, reverse);
|
||||
emit_jump_insn (targetm.gen_jump (lab2));
|
||||
emit_barrier ();
|
||||
emit_label (lab1);
|
||||
store_expr_with_bounds (TREE_OPERAND (exp, 2), target, call_param_p,
|
||||
nontemporal, reverse, btarget);
|
||||
store_expr (TREE_OPERAND (exp, 2), target, call_param_p,
|
||||
nontemporal, reverse);
|
||||
emit_label (lab2);
|
||||
OK_DEFER_POP;
|
||||
|
||||
|
@ -5546,18 +5528,6 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
|||
temp = expand_expr (exp, inner_target, VOIDmode,
|
||||
call_param_p ? EXPAND_STACK_PARM : EXPAND_NORMAL);
|
||||
|
||||
/* Handle bounds returned by call. */
|
||||
if (TREE_CODE (exp) == CALL_EXPR)
|
||||
{
|
||||
rtx bounds;
|
||||
chkp_split_slot (temp, &temp, &bounds);
|
||||
if (bounds && btarget)
|
||||
{
|
||||
gcc_assert (TREE_CODE (btarget) == SSA_NAME);
|
||||
rtx tmp = targetm.calls.load_returned_bounds (bounds);
|
||||
chkp_set_rtl_bounds (btarget, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/* If TEMP is a VOIDmode constant, use convert_modes to make
|
||||
sure that we properly convert it. */
|
||||
|
@ -5639,19 +5609,6 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
|||
(call_param_p
|
||||
? EXPAND_STACK_PARM : EXPAND_NORMAL),
|
||||
&alt_rtl, false);
|
||||
|
||||
/* Handle bounds returned by call. */
|
||||
if (TREE_CODE (exp) == CALL_EXPR)
|
||||
{
|
||||
rtx bounds;
|
||||
chkp_split_slot (temp, &temp, &bounds);
|
||||
if (bounds && btarget)
|
||||
{
|
||||
gcc_assert (TREE_CODE (btarget) == SSA_NAME);
|
||||
rtx tmp = targetm.calls.load_returned_bounds (bounds);
|
||||
chkp_set_rtl_bounds (btarget, tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If TEMP is a VOIDmode constant and the mode of the type of EXP is not
|
||||
|
@ -5831,15 +5788,6 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
|
|||
|
||||
return NULL_RTX;
|
||||
}
|
||||
|
||||
/* Same as store_expr_with_bounds but ignoring bounds of EXP. */
|
||||
rtx
|
||||
store_expr (tree exp, rtx target, int call_param_p, bool nontemporal,
|
||||
bool reverse)
|
||||
{
|
||||
return store_expr_with_bounds (exp, target, call_param_p, nontemporal,
|
||||
reverse, NULL);
|
||||
}
|
||||
|
||||
/* Return true if field F of structure TYPE is a flexible array. */
|
||||
|
||||
|
@ -10954,11 +10902,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
|
|||
if (fndecl && DECL_BUILT_IN (fndecl))
|
||||
{
|
||||
gcc_assert (DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_FRONTEND);
|
||||
if (CALL_WITH_BOUNDS_P (exp))
|
||||
return expand_builtin_with_bounds (exp, target, subtarget,
|
||||
tmode, ignore);
|
||||
else
|
||||
return expand_builtin (exp, target, subtarget, tmode, ignore);
|
||||
return expand_builtin (exp, target, subtarget, tmode, ignore);
|
||||
}
|
||||
}
|
||||
return expand_call (exp, target, ignore);
|
||||
|
|
|
@ -254,7 +254,6 @@ extern void expand_assignment (tree, tree, bool);
|
|||
and storing the value into TARGET.
|
||||
If SUGGEST_REG is nonzero, copy the value through a register
|
||||
and return that register, if that is possible. */
|
||||
extern rtx store_expr_with_bounds (tree, rtx, int, bool, bool, tree);
|
||||
extern rtx store_expr (tree, rtx, int, bool, bool);
|
||||
|
||||
/* Given an rtx that may include add and multiply operations,
|
||||
|
|
241
gcc/function.c
241
gcc/function.c
|
@ -73,8 +73,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "shrink-wrap.h"
|
||||
#include "toplev.h"
|
||||
#include "rtl-iter.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "rtl-chkp.h"
|
||||
#include "tree-dfa.h"
|
||||
#include "tree-ssa.h"
|
||||
#include "stringpool.h"
|
||||
|
@ -2201,14 +2199,6 @@ use_register_for_decl (const_tree decl)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Decl is implicitly addressible by bound stores and loads
|
||||
if it is an aggregate holding bounds. */
|
||||
if (chkp_function_instrumented_p (current_function_decl)
|
||||
&& TREE_TYPE (decl)
|
||||
&& !BOUNDED_P (decl)
|
||||
&& chkp_type_has_pointer (TREE_TYPE (decl)))
|
||||
return false;
|
||||
|
||||
/* Only register-like things go in registers. */
|
||||
if (DECL_MODE (decl) == BLKmode)
|
||||
return false;
|
||||
|
@ -2280,15 +2270,6 @@ struct assign_parm_data_one
|
|||
BOOL_BITFIELD loaded_in_reg : 1;
|
||||
};
|
||||
|
||||
struct bounds_parm_data
|
||||
{
|
||||
assign_parm_data_one parm_data;
|
||||
tree bounds_parm;
|
||||
tree ptr_parm;
|
||||
rtx ptr_entry;
|
||||
int bound_no;
|
||||
};
|
||||
|
||||
/* A subroutine of assign_parms. Initialize ALL. */
|
||||
|
||||
static void
|
||||
|
@ -2403,23 +2384,6 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
|
|||
fnargs.safe_insert (0, decl);
|
||||
|
||||
all->function_result_decl = decl;
|
||||
|
||||
/* If function is instrumented then bounds of the
|
||||
passed structure address is the second argument. */
|
||||
if (chkp_function_instrumented_p (fndecl))
|
||||
{
|
||||
decl = build_decl (DECL_SOURCE_LOCATION (fndecl),
|
||||
PARM_DECL, get_identifier (".result_bnd"),
|
||||
pointer_bounds_type_node);
|
||||
DECL_ARG_TYPE (decl) = pointer_bounds_type_node;
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
DECL_NAMELESS (decl) = 1;
|
||||
TREE_CONSTANT (decl) = 1;
|
||||
|
||||
DECL_CHAIN (decl) = DECL_CHAIN (all->orig_fnargs);
|
||||
DECL_CHAIN (all->orig_fnargs) = decl;
|
||||
fnargs.safe_insert (1, decl);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the target wants to split complex arguments into scalars, do so. */
|
||||
|
@ -2563,7 +2527,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
|
|||
it came in a register so that REG_PARM_STACK_SPACE isn't skipped.
|
||||
In this case, we call FUNCTION_ARG with NAMED set to 1 instead of 0
|
||||
as it was the previous time. */
|
||||
in_regs = (entry_parm != 0) || POINTER_BOUNDS_TYPE_P (data->passed_type);
|
||||
in_regs = (entry_parm != 0);
|
||||
#ifdef STACK_PARMS_IN_REG_PARM_AREA
|
||||
in_regs = true;
|
||||
#endif
|
||||
|
@ -2652,12 +2616,8 @@ static bool
|
|||
assign_parm_is_stack_parm (struct assign_parm_data_all *all,
|
||||
struct assign_parm_data_one *data)
|
||||
{
|
||||
/* Bounds are never passed on the stack to keep compatibility
|
||||
with not instrumented code. */
|
||||
if (POINTER_BOUNDS_TYPE_P (data->passed_type))
|
||||
return false;
|
||||
/* Trivially true if we've no incoming register. */
|
||||
else if (data->entry_parm == NULL)
|
||||
if (data->entry_parm == NULL)
|
||||
;
|
||||
/* Also true if we're partially in registers and partially not,
|
||||
since we've arranged to drop the entire argument on the stack. */
|
||||
|
@ -3572,121 +3532,6 @@ assign_parms_unsplit_complex (struct assign_parm_data_all *all,
|
|||
}
|
||||
}
|
||||
|
||||
/* Load bounds of PARM from bounds table. */
|
||||
static void
|
||||
assign_parm_load_bounds (struct assign_parm_data_one *data,
|
||||
tree parm,
|
||||
rtx entry,
|
||||
unsigned bound_no)
|
||||
{
|
||||
bitmap_iterator bi;
|
||||
unsigned i, offs = 0;
|
||||
int bnd_no = -1;
|
||||
rtx slot = NULL, ptr = NULL;
|
||||
|
||||
if (parm)
|
||||
{
|
||||
bitmap slots;
|
||||
bitmap_obstack_initialize (NULL);
|
||||
slots = BITMAP_ALLOC (NULL);
|
||||
chkp_find_bound_slots (TREE_TYPE (parm), slots);
|
||||
EXECUTE_IF_SET_IN_BITMAP (slots, 0, i, bi)
|
||||
{
|
||||
if (bound_no)
|
||||
bound_no--;
|
||||
else
|
||||
{
|
||||
bnd_no = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
BITMAP_FREE (slots);
|
||||
bitmap_obstack_release (NULL);
|
||||
}
|
||||
|
||||
/* We may have bounds not associated with any pointer. */
|
||||
if (bnd_no != -1)
|
||||
offs = bnd_no * POINTER_SIZE / BITS_PER_UNIT;
|
||||
|
||||
/* Find associated pointer. */
|
||||
if (bnd_no == -1)
|
||||
{
|
||||
/* If bounds are not associated with any bounds,
|
||||
then it is passed in a register or special slot. */
|
||||
gcc_assert (data->entry_parm);
|
||||
ptr = const0_rtx;
|
||||
}
|
||||
else if (MEM_P (entry))
|
||||
slot = adjust_address (entry, Pmode, offs);
|
||||
else if (REG_P (entry))
|
||||
ptr = gen_rtx_REG (Pmode, REGNO (entry) + bnd_no);
|
||||
else if (GET_CODE (entry) == PARALLEL)
|
||||
ptr = chkp_get_value_with_offs (entry, GEN_INT (offs));
|
||||
else
|
||||
gcc_unreachable ();
|
||||
data->entry_parm = targetm.calls.load_bounds_for_arg (slot, ptr,
|
||||
data->entry_parm);
|
||||
}
|
||||
|
||||
/* Assign RTL expressions to the function's bounds parameters BNDARGS. */
|
||||
|
||||
static void
|
||||
assign_bounds (vec<bounds_parm_data> &bndargs,
|
||||
struct assign_parm_data_all &all,
|
||||
bool assign_regs, bool assign_special,
|
||||
bool assign_bt)
|
||||
{
|
||||
unsigned i, pass;
|
||||
bounds_parm_data *pbdata;
|
||||
|
||||
if (!bndargs.exists ())
|
||||
return;
|
||||
|
||||
/* We make few passes to store input bounds. Firstly handle bounds
|
||||
passed in registers. After that we load bounds passed in special
|
||||
slots. Finally we load bounds from Bounds Table. */
|
||||
for (pass = 0; pass < 3; pass++)
|
||||
FOR_EACH_VEC_ELT (bndargs, i, pbdata)
|
||||
{
|
||||
/* Pass 0 => regs only. */
|
||||
if (pass == 0
|
||||
&& (!assign_regs
|
||||
||(!pbdata->parm_data.entry_parm
|
||||
|| GET_CODE (pbdata->parm_data.entry_parm) != REG)))
|
||||
continue;
|
||||
/* Pass 1 => slots only. */
|
||||
else if (pass == 1
|
||||
&& (!assign_special
|
||||
|| (!pbdata->parm_data.entry_parm
|
||||
|| GET_CODE (pbdata->parm_data.entry_parm) == REG)))
|
||||
continue;
|
||||
/* Pass 2 => BT only. */
|
||||
else if (pass == 2
|
||||
&& (!assign_bt
|
||||
|| pbdata->parm_data.entry_parm))
|
||||
continue;
|
||||
|
||||
if (!pbdata->parm_data.entry_parm
|
||||
|| GET_CODE (pbdata->parm_data.entry_parm) != REG)
|
||||
assign_parm_load_bounds (&pbdata->parm_data, pbdata->ptr_parm,
|
||||
pbdata->ptr_entry, pbdata->bound_no);
|
||||
|
||||
set_decl_incoming_rtl (pbdata->bounds_parm,
|
||||
pbdata->parm_data.entry_parm, false);
|
||||
|
||||
if (assign_parm_setup_block_p (&pbdata->parm_data))
|
||||
assign_parm_setup_block (&all, pbdata->bounds_parm,
|
||||
&pbdata->parm_data);
|
||||
else if (pbdata->parm_data.passed_pointer
|
||||
|| use_register_for_decl (pbdata->bounds_parm))
|
||||
assign_parm_setup_reg (&all, pbdata->bounds_parm,
|
||||
&pbdata->parm_data);
|
||||
else
|
||||
assign_parm_setup_stack (&all, pbdata->bounds_parm,
|
||||
&pbdata->parm_data);
|
||||
}
|
||||
}
|
||||
|
||||
/* Assign RTL expressions to the function's parameters. This may involve
|
||||
copying them into registers and using those registers as the DECL_RTL. */
|
||||
|
||||
|
@ -3696,11 +3541,7 @@ assign_parms (tree fndecl)
|
|||
struct assign_parm_data_all all;
|
||||
tree parm;
|
||||
vec<tree> fnargs;
|
||||
unsigned i, bound_no = 0;
|
||||
tree last_arg = NULL;
|
||||
rtx last_arg_entry = NULL;
|
||||
vec<bounds_parm_data> bndargs = vNULL;
|
||||
bounds_parm_data bdata;
|
||||
unsigned i;
|
||||
|
||||
crtl->args.internal_arg_pointer
|
||||
= targetm.calls.internal_arg_pointer ();
|
||||
|
@ -3751,15 +3592,6 @@ assign_parms (tree fndecl)
|
|||
assign_parm_find_stack_rtl (parm, &data);
|
||||
assign_parm_adjust_entry_rtl (&data);
|
||||
}
|
||||
if (!POINTER_BOUNDS_TYPE_P (data.passed_type))
|
||||
{
|
||||
/* Remember where last non bounds arg was passed in case
|
||||
we have to load associated bounds for it from Bounds
|
||||
Table. */
|
||||
last_arg = parm;
|
||||
last_arg_entry = data.entry_parm;
|
||||
bound_no = 0;
|
||||
}
|
||||
/* Record permanently how this parm was passed. */
|
||||
if (data.passed_pointer)
|
||||
{
|
||||
|
@ -3773,64 +3605,21 @@ assign_parms (tree fndecl)
|
|||
|
||||
assign_parm_adjust_stack_rtl (&data);
|
||||
|
||||
/* Bounds should be loaded in the particular order to
|
||||
have registers allocated correctly. Collect info about
|
||||
input bounds and load them later. */
|
||||
if (POINTER_BOUNDS_TYPE_P (data.passed_type))
|
||||
{
|
||||
/* Expect bounds in instrumented functions only. */
|
||||
gcc_assert (chkp_function_instrumented_p (fndecl));
|
||||
|
||||
bdata.parm_data = data;
|
||||
bdata.bounds_parm = parm;
|
||||
bdata.ptr_parm = last_arg;
|
||||
bdata.ptr_entry = last_arg_entry;
|
||||
bdata.bound_no = bound_no;
|
||||
bndargs.safe_push (bdata);
|
||||
}
|
||||
if (assign_parm_setup_block_p (&data))
|
||||
assign_parm_setup_block (&all, parm, &data);
|
||||
else if (data.passed_pointer || use_register_for_decl (parm))
|
||||
assign_parm_setup_reg (&all, parm, &data);
|
||||
else
|
||||
{
|
||||
if (assign_parm_setup_block_p (&data))
|
||||
assign_parm_setup_block (&all, parm, &data);
|
||||
else if (data.passed_pointer || use_register_for_decl (parm))
|
||||
assign_parm_setup_reg (&all, parm, &data);
|
||||
else
|
||||
assign_parm_setup_stack (&all, parm, &data);
|
||||
}
|
||||
assign_parm_setup_stack (&all, parm, &data);
|
||||
|
||||
if (cfun->stdarg && !DECL_CHAIN (parm))
|
||||
{
|
||||
int pretend_bytes = 0;
|
||||
|
||||
assign_parms_setup_varargs (&all, &data, false);
|
||||
|
||||
if (chkp_function_instrumented_p (fndecl))
|
||||
{
|
||||
/* We expect this is the last parm. Otherwise it is wrong
|
||||
to assign bounds right now. */
|
||||
gcc_assert (i == (fnargs.length () - 1));
|
||||
assign_bounds (bndargs, all, true, false, false);
|
||||
targetm.calls.setup_incoming_vararg_bounds (all.args_so_far,
|
||||
data.promoted_mode,
|
||||
data.passed_type,
|
||||
&pretend_bytes,
|
||||
false);
|
||||
assign_bounds (bndargs, all, false, true, true);
|
||||
bndargs.release ();
|
||||
}
|
||||
}
|
||||
assign_parms_setup_varargs (&all, &data, false);
|
||||
|
||||
/* Update info on where next arg arrives in registers. */
|
||||
targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode,
|
||||
data.passed_type, data.named_arg);
|
||||
|
||||
if (POINTER_BOUNDS_TYPE_P (data.passed_type))
|
||||
bound_no++;
|
||||
}
|
||||
|
||||
assign_bounds (bndargs, all, true, true, true);
|
||||
bndargs.release ();
|
||||
|
||||
if (targetm.calls.split_complex_arg)
|
||||
assign_parms_unsplit_complex (&all, fnargs);
|
||||
|
||||
|
@ -3953,10 +3742,6 @@ assign_parms (tree fndecl)
|
|||
|
||||
real_decl_rtl = targetm.calls.function_value (TREE_TYPE (decl_result),
|
||||
fndecl, true);
|
||||
if (chkp_function_instrumented_p (fndecl))
|
||||
crtl->return_bnd
|
||||
= targetm.calls.chkp_function_value_bounds (TREE_TYPE (decl_result),
|
||||
fndecl, true);
|
||||
REG_FUNCTION_VALUE_P (real_decl_rtl) = 1;
|
||||
/* The delay slot scheduler assumes that crtl->return_rtx
|
||||
holds the hard register containing the return value, not a
|
||||
|
@ -5238,14 +5023,6 @@ expand_function_start (tree subr)
|
|||
/* Set DECL_REGISTER flag so that expand_function_end will copy the
|
||||
result to the real return register(s). */
|
||||
DECL_REGISTER (res) = 1;
|
||||
|
||||
if (chkp_function_instrumented_p (current_function_decl))
|
||||
{
|
||||
tree return_type = TREE_TYPE (res);
|
||||
rtx bounds = targetm.calls.chkp_function_value_bounds (return_type,
|
||||
subr, 1);
|
||||
SET_DECL_BOUNDS_RTL (res, bounds);
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize rtx for parameters and local variables.
|
||||
|
|
|
@ -1012,10 +1012,6 @@ proper position among the other output files. */
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CHKP_SPEC
|
||||
#define CHKP_SPEC ""
|
||||
#endif
|
||||
|
||||
/* -u* was put back because both BSD and SysV seem to support it. */
|
||||
/* %{static|no-pie|static-pie:} simply prevents an error message:
|
||||
1. If the target machine doesn't handle -static.
|
||||
|
@ -1039,7 +1035,7 @@ proper position among the other output files. */
|
|||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
|
||||
%{static|no-pie|static-pie:} %{L*} %(mfwrap) %(link_libgcc) " \
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
|
||||
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
|
||||
%:include(libgomp.spec)%(link_gomp)}\
|
||||
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
|
||||
|
|
|
@ -55,7 +55,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "gomp-constants.h"
|
||||
#include "optabs-query.h"
|
||||
#include "omp-general.h"
|
||||
#include "ipa-chkp.h"
|
||||
#include "tree-cfg.h"
|
||||
#include "fold-const-call.h"
|
||||
#include "stringpool.h"
|
||||
|
@ -728,18 +727,6 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
|
|||
unsigned int src_align, dest_align;
|
||||
tree off0;
|
||||
|
||||
/* Inlining of memcpy/memmove may cause bounds lost (if we copy
|
||||
pointers as wide integer) and also may result in huge function
|
||||
size because of inlined bounds copy. Thus don't inline for
|
||||
functions we want to instrument. */
|
||||
if (flag_check_pointer_bounds
|
||||
&& chkp_instrumentable_p (cfun->decl)
|
||||
/* Even if data may contain pointers we can inline if copy
|
||||
less than a pointer size. */
|
||||
&& (!tree_fits_uhwi_p (len)
|
||||
|| compare_tree_int (len, POINTER_SIZE_UNITS) >= 0))
|
||||
return false;
|
||||
|
||||
/* Build accesses at offset zero with a ref-all character type. */
|
||||
off0 = build_int_cst (build_pointer_type_for_mode (char_type_node,
|
||||
ptr_mode, true), 0);
|
||||
|
|
|
@ -589,20 +589,14 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
|
|||
|
||||
/* The size argument number (depends on the built-in). */
|
||||
unsigned sizeargno = 2;
|
||||
if (gimple_call_with_bounds_p (call))
|
||||
sizeargno += 2;
|
||||
|
||||
tree func = gimple_call_fndecl (call);
|
||||
switch (DECL_FUNCTION_CODE (func))
|
||||
{
|
||||
case BUILT_IN_MEMCPY:
|
||||
case BUILT_IN_MEMCPY_CHK:
|
||||
case BUILT_IN_MEMCPY_CHKP:
|
||||
case BUILT_IN_MEMCPY_CHK_CHKP:
|
||||
case BUILT_IN_MEMPCPY:
|
||||
case BUILT_IN_MEMPCPY_CHK:
|
||||
case BUILT_IN_MEMPCPY_CHKP:
|
||||
case BUILT_IN_MEMPCPY_CHK_CHKP:
|
||||
ostype = 0;
|
||||
depends_p = false;
|
||||
detect_overlap = &builtin_access::generic_overlap;
|
||||
|
@ -610,8 +604,6 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
|
|||
|
||||
case BUILT_IN_MEMMOVE:
|
||||
case BUILT_IN_MEMMOVE_CHK:
|
||||
case BUILT_IN_MEMMOVE_CHKP:
|
||||
case BUILT_IN_MEMMOVE_CHK_CHKP:
|
||||
/* For memmove there is never any overlap to check for. */
|
||||
ostype = 0;
|
||||
depends_p = false;
|
||||
|
@ -628,19 +620,13 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
|
|||
|
||||
case BUILT_IN_STPCPY:
|
||||
case BUILT_IN_STPCPY_CHK:
|
||||
case BUILT_IN_STPCPY_CHKP:
|
||||
case BUILT_IN_STPCPY_CHK_CHKP:
|
||||
case BUILT_IN_STRCPY:
|
||||
case BUILT_IN_STRCPY_CHK:
|
||||
case BUILT_IN_STRCPY_CHKP:
|
||||
case BUILT_IN_STRCPY_CHK_CHKP:
|
||||
detect_overlap = &builtin_access::strcpy_overlap;
|
||||
break;
|
||||
|
||||
case BUILT_IN_STRCAT:
|
||||
case BUILT_IN_STRCAT_CHK:
|
||||
case BUILT_IN_STRCAT_CHKP:
|
||||
case BUILT_IN_STRCAT_CHK_CHKP:
|
||||
detect_overlap = &builtin_access::strcat_overlap;
|
||||
break;
|
||||
|
||||
|
@ -654,8 +640,7 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
|
|||
default:
|
||||
/* Handle other string functions here whose access may need
|
||||
to be validated for in-bounds offsets and non-overlapping
|
||||
copies. (Not all _chkp functions have BUILT_IN_XXX_CHKP
|
||||
macros so they need to be handled here.) */
|
||||
copies. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1738,8 +1723,6 @@ wrestrict_dom_walker::check_call (gcall *call)
|
|||
if (!func || DECL_BUILT_IN_CLASS (func) != BUILT_IN_NORMAL)
|
||||
return;
|
||||
|
||||
bool with_bounds = gimple_call_with_bounds_p (call);
|
||||
|
||||
/* Argument number to extract from the call (depends on the built-in
|
||||
and its kind). */
|
||||
unsigned dst_idx = -1;
|
||||
|
@ -1754,16 +1737,10 @@ wrestrict_dom_walker::check_call (gcall *call)
|
|||
{
|
||||
case BUILT_IN_MEMCPY:
|
||||
case BUILT_IN_MEMCPY_CHK:
|
||||
case BUILT_IN_MEMCPY_CHKP:
|
||||
case BUILT_IN_MEMCPY_CHK_CHKP:
|
||||
case BUILT_IN_MEMPCPY:
|
||||
case BUILT_IN_MEMPCPY_CHK:
|
||||
case BUILT_IN_MEMPCPY_CHKP:
|
||||
case BUILT_IN_MEMPCPY_CHK_CHKP:
|
||||
case BUILT_IN_MEMMOVE:
|
||||
case BUILT_IN_MEMMOVE_CHK:
|
||||
case BUILT_IN_MEMMOVE_CHKP:
|
||||
case BUILT_IN_MEMMOVE_CHK_CHKP:
|
||||
strfun = false;
|
||||
/* Fall through. */
|
||||
|
||||
|
@ -1774,31 +1751,24 @@ wrestrict_dom_walker::check_call (gcall *call)
|
|||
case BUILT_IN_STRNCPY:
|
||||
case BUILT_IN_STRNCPY_CHK:
|
||||
dst_idx = 0;
|
||||
src_idx = 1 + with_bounds;
|
||||
bnd_idx = 2 + 2 * with_bounds;
|
||||
src_idx = 1;
|
||||
bnd_idx = 2;
|
||||
break;
|
||||
|
||||
case BUILT_IN_STPCPY:
|
||||
case BUILT_IN_STPCPY_CHK:
|
||||
case BUILT_IN_STPCPY_CHKP:
|
||||
case BUILT_IN_STPCPY_CHK_CHKP:
|
||||
case BUILT_IN_STRCPY:
|
||||
case BUILT_IN_STRCPY_CHK:
|
||||
case BUILT_IN_STRCPY_CHKP:
|
||||
case BUILT_IN_STRCPY_CHK_CHKP:
|
||||
case BUILT_IN_STRCAT:
|
||||
case BUILT_IN_STRCAT_CHK:
|
||||
case BUILT_IN_STRCAT_CHKP:
|
||||
case BUILT_IN_STRCAT_CHK_CHKP:
|
||||
dst_idx = 0;
|
||||
src_idx = 1 + with_bounds;
|
||||
src_idx = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Handle other string functions here whose access may need
|
||||
to be validated for in-bounds offsets and non-overlapping
|
||||
copies. (Not all _chkp functions have BUILT_IN_XXX_CHKP
|
||||
macros so they need to be handled here.) */
|
||||
copies. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -385,7 +385,6 @@ gimple_build_call_from_tree (tree t, tree fnptrtype)
|
|||
gimple_call_set_nothrow (call, TREE_NOTHROW (t));
|
||||
gimple_call_set_by_descriptor (call, CALL_EXPR_BY_DESCRIPTOR (t));
|
||||
gimple_set_no_warning (call, TREE_NO_WARNING (t));
|
||||
gimple_call_set_with_bounds (call, CALL_WITH_BOUNDS_P (t));
|
||||
|
||||
if (fnptrtype)
|
||||
{
|
||||
|
|
39
gcc/gimple.h
39
gcc/gimple.h
|
@ -145,7 +145,6 @@ enum gf_mask {
|
|||
GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
|
||||
GF_CALL_INTERNAL = 1 << 6,
|
||||
GF_CALL_CTRL_ALTERING = 1 << 7,
|
||||
GF_CALL_WITH_BOUNDS = 1 << 8,
|
||||
GF_CALL_MUST_TAIL_CALL = 1 << 9,
|
||||
GF_CALL_BY_DESCRIPTOR = 1 << 10,
|
||||
GF_CALL_NOCF_CHECK = 1 << 11,
|
||||
|
@ -2856,44 +2855,6 @@ gimple_call_internal_p (const gimple *gs)
|
|||
return gimple_call_internal_p (gc);
|
||||
}
|
||||
|
||||
|
||||
/* Return true if call GS is marked as instrumented by
|
||||
Pointer Bounds Checker. */
|
||||
|
||||
static inline bool
|
||||
gimple_call_with_bounds_p (const gcall *gs)
|
||||
{
|
||||
return (gs->subcode & GF_CALL_WITH_BOUNDS) != 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
gimple_call_with_bounds_p (const gimple *gs)
|
||||
{
|
||||
const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
|
||||
return gimple_call_with_bounds_p (gc);
|
||||
}
|
||||
|
||||
|
||||
/* If INSTRUMENTED_P is true, marm statement GS as instrumented by
|
||||
Pointer Bounds Checker. */
|
||||
|
||||
static inline void
|
||||
gimple_call_set_with_bounds (gcall *gs, bool with_bounds)
|
||||
{
|
||||
if (with_bounds)
|
||||
gs->subcode |= GF_CALL_WITH_BOUNDS;
|
||||
else
|
||||
gs->subcode &= ~GF_CALL_WITH_BOUNDS;
|
||||
}
|
||||
|
||||
static inline void
|
||||
gimple_call_set_with_bounds (gimple *gs, bool with_bounds)
|
||||
{
|
||||
gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
|
||||
gimple_call_set_with_bounds (gc, with_bounds);
|
||||
}
|
||||
|
||||
|
||||
/* Return true if call GS is marked as nocf_check. */
|
||||
|
||||
static inline bool
|
||||
|
|
|
@ -4859,19 +4859,11 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
|||
individual element initialization. Also don't do this for small
|
||||
all-zero initializers (which aren't big enough to merit
|
||||
clearing), and don't try to make bitwise copies of
|
||||
TREE_ADDRESSABLE types.
|
||||
TREE_ADDRESSABLE types. */
|
||||
|
||||
We cannot apply such transformation when compiling chkp static
|
||||
initializer because creation of initializer image in the memory
|
||||
will require static initialization of bounds for it. It should
|
||||
result in another gimplification of similar initializer and we
|
||||
may fall into infinite loop. */
|
||||
if (valid_const_initializer
|
||||
&& !(cleared || num_nonzero_elements == 0)
|
||||
&& !TREE_ADDRESSABLE (type)
|
||||
&& (!current_function_decl
|
||||
|| !lookup_attribute ("chkp ctor",
|
||||
DECL_ATTRIBUTES (current_function_decl))))
|
||||
&& !TREE_ADDRESSABLE (type))
|
||||
{
|
||||
HOST_WIDE_INT size = int_size_in_bytes (type);
|
||||
unsigned int align;
|
||||
|
|
876
gcc/ipa-chkp.c
876
gcc/ipa-chkp.c
|
@ -1,876 +0,0 @@
|
|||
/* Pointer Bounds Checker IPA passes.
|
||||
Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
||||
Contributed by Ilya Enkovich (ilya.enkovich@intel.com)
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#define INCLUDE_STRING
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "backend.h"
|
||||
#include "tree.h"
|
||||
#include "gimple.h"
|
||||
#include "tree-pass.h"
|
||||
#include "stringpool.h"
|
||||
#include "lto-streamer.h"
|
||||
#include "stor-layout.h"
|
||||
#include "calls.h"
|
||||
#include "cgraph.h"
|
||||
#include "tree-chkp.h"
|
||||
#include "tree-inline.h"
|
||||
#include "ipa-chkp.h"
|
||||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
|
||||
/* Pointer Bounds Checker has two IPA passes to support code instrumentation.
|
||||
|
||||
In instrumented code each pointer is provided with bounds. For input
|
||||
pointer parameters it means we also have bounds passed. For calls it
|
||||
means we have additional bounds arguments for pointer arguments.
|
||||
|
||||
To have all IPA optimizations working correctly we have to express
|
||||
dataflow between passed and received bounds explicitly via additional
|
||||
entries in function declaration arguments list and in function type.
|
||||
Since we may have both instrumented and not instrumented code at the
|
||||
same time, we cannot replace all original functions with their
|
||||
instrumented variants. Therefore we create clones (versions) instead.
|
||||
|
||||
Instrumentation clones creation is a separate IPA pass which is a part
|
||||
of early local passes. Clones are created after SSA is built (because
|
||||
instrumentation pass works on SSA) and before any transformations
|
||||
which may change pointer flow and therefore lead to incorrect code
|
||||
instrumentation (possibly causing false bounds check failures).
|
||||
|
||||
Instrumentation clones have pointer bounds arguments added right after
|
||||
pointer arguments. Clones have assembler name of the original
|
||||
function with suffix added. New assembler name is in transparent
|
||||
alias chain with the original name. Thus we expect all calls to the
|
||||
original and instrumented functions look similar in assembler.
|
||||
|
||||
During instrumentation versioning pass we create instrumented versions
|
||||
of all function with body and also for all their aliases and thunks.
|
||||
Clones for functions with no body are created on demand (usually
|
||||
during call instrumentation).
|
||||
|
||||
Original and instrumented function nodes are connected with IPA
|
||||
reference IPA_REF_CHKP. It is mostly done to have reachability
|
||||
analysis working correctly. We may have no references to the
|
||||
instrumented function in the code but it still should be counted
|
||||
as reachable if the original function is reachable.
|
||||
|
||||
When original function bodies are not needed anymore we release
|
||||
them and transform functions into a special kind of thunks. Each
|
||||
thunk has a call edge to the instrumented version. These thunks
|
||||
help to keep externally visible instrumented functions visible
|
||||
when linker resolution files are used. Linker has no info about
|
||||
connection between original and instrumented function and
|
||||
therefore we may wrongly decide (due to difference in assembler
|
||||
names) that instrumented function version is local and can be
|
||||
removed. */
|
||||
|
||||
#define CHKP_BOUNDS_OF_SYMBOL_PREFIX "__chkp_bounds_of_"
|
||||
#define CHKP_WRAPPER_SYMBOL_PREFIX "__mpx_wrapper_"
|
||||
|
||||
/* Return 1 calls to FNDECL should be replaced with
|
||||
a call to wrapper function. */
|
||||
bool
|
||||
chkp_wrap_function (tree fndecl)
|
||||
{
|
||||
if (!flag_chkp_use_wrappers)
|
||||
return false;
|
||||
|
||||
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
|
||||
{
|
||||
switch (DECL_FUNCTION_CODE (fndecl))
|
||||
{
|
||||
case BUILT_IN_STRLEN:
|
||||
case BUILT_IN_STRCPY:
|
||||
case BUILT_IN_STRNCPY:
|
||||
case BUILT_IN_STPCPY:
|
||||
case BUILT_IN_STPNCPY:
|
||||
case BUILT_IN_STRCAT:
|
||||
case BUILT_IN_STRNCAT:
|
||||
case BUILT_IN_MEMCPY:
|
||||
case BUILT_IN_MEMPCPY:
|
||||
case BUILT_IN_MEMSET:
|
||||
case BUILT_IN_MEMMOVE:
|
||||
case BUILT_IN_BZERO:
|
||||
case BUILT_IN_MALLOC:
|
||||
case BUILT_IN_CALLOC:
|
||||
case BUILT_IN_REALLOC:
|
||||
return 1;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char *
|
||||
chkp_wrap_function_name (tree fndecl)
|
||||
{
|
||||
gcc_assert (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL);
|
||||
|
||||
switch (DECL_FUNCTION_CODE (fndecl))
|
||||
{
|
||||
case BUILT_IN_STRLEN:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "strlen";
|
||||
case BUILT_IN_STRCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "strcpy";
|
||||
case BUILT_IN_STRNCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "strncpy";
|
||||
case BUILT_IN_STPCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "stpcpy";
|
||||
case BUILT_IN_STPNCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "stpncpy";
|
||||
case BUILT_IN_STRCAT:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "strcat";
|
||||
case BUILT_IN_STRNCAT:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "strncat";
|
||||
case BUILT_IN_MEMCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "memcpy";
|
||||
case BUILT_IN_MEMPCPY:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "mempcpy";
|
||||
case BUILT_IN_MEMSET:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "memset";
|
||||
case BUILT_IN_MEMMOVE:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "memmove";
|
||||
case BUILT_IN_BZERO:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "bzero";
|
||||
case BUILT_IN_MALLOC:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "malloc";
|
||||
case BUILT_IN_CALLOC:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "calloc";
|
||||
case BUILT_IN_REALLOC:
|
||||
return CHKP_WRAPPER_SYMBOL_PREFIX "realloc";
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/* Build a clone of FNDECL with a modified name. */
|
||||
|
||||
static tree
|
||||
chkp_build_instrumented_fndecl (tree fndecl)
|
||||
{
|
||||
tree new_decl = copy_node (fndecl);
|
||||
tree new_name;
|
||||
std::string s;
|
||||
|
||||
/* called_as_built_in checks DECL_NAME to identify calls to
|
||||
builtins. We want instrumented calls to builtins to be
|
||||
recognized by called_as_built_in. Therefore use original
|
||||
DECL_NAME for cloning with no prefixes. */
|
||||
s = IDENTIFIER_POINTER (DECL_NAME (fndecl));
|
||||
s += ".chkp";
|
||||
DECL_NAME (new_decl) = get_identifier (s.c_str ());
|
||||
|
||||
/* References to the original and to the instrumented version
|
||||
should look the same in the output assembly. And we cannot
|
||||
use the same assembler name for the instrumented version
|
||||
because it conflicts with decl merging algorithms in LTO.
|
||||
Achieve the result by using transparent alias name for the
|
||||
instrumented version. */
|
||||
if (chkp_wrap_function(fndecl))
|
||||
{
|
||||
new_name = get_identifier (chkp_wrap_function_name (fndecl));
|
||||
DECL_VISIBILITY (new_decl) = VISIBILITY_DEFAULT;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl));
|
||||
s += ".chkp";
|
||||
new_name = get_identifier (s.c_str ());
|
||||
IDENTIFIER_TRANSPARENT_ALIAS (new_name) = 1;
|
||||
TREE_CHAIN (new_name) = DECL_ASSEMBLER_NAME (fndecl);
|
||||
}
|
||||
SET_DECL_ASSEMBLER_NAME (new_decl, new_name);
|
||||
|
||||
/* For functions with body versioning will make a copy of arguments.
|
||||
For functions with no body we need to do it here. */
|
||||
if (!gimple_has_body_p (fndecl))
|
||||
{
|
||||
tree arg;
|
||||
|
||||
DECL_ARGUMENTS (new_decl) = copy_list (DECL_ARGUMENTS (fndecl));
|
||||
for (arg = DECL_ARGUMENTS (new_decl); arg; arg = DECL_CHAIN (arg))
|
||||
DECL_CONTEXT (arg) = new_decl;
|
||||
}
|
||||
|
||||
/* We are going to modify attributes list and therefore should
|
||||
make own copy. */
|
||||
DECL_ATTRIBUTES (new_decl) = copy_list (DECL_ATTRIBUTES (fndecl));
|
||||
|
||||
/* Change builtin function code. */
|
||||
if (DECL_BUILT_IN (new_decl))
|
||||
{
|
||||
gcc_assert (DECL_BUILT_IN_CLASS (new_decl) == BUILT_IN_NORMAL);
|
||||
gcc_assert (DECL_FUNCTION_CODE (new_decl) < BEGIN_CHKP_BUILTINS);
|
||||
DECL_FUNCTION_CODE (new_decl)
|
||||
= (enum built_in_function)(DECL_FUNCTION_CODE (new_decl)
|
||||
+ BEGIN_CHKP_BUILTINS + 1);
|
||||
}
|
||||
|
||||
return new_decl;
|
||||
}
|
||||
|
||||
|
||||
/* Fix operands of attribute from ATTRS list named ATTR_NAME.
|
||||
Integer operands are replaced with values according to
|
||||
INDEXES map having LEN elements. For operands out of len
|
||||
we just add DELTA. */
|
||||
|
||||
static void
|
||||
chkp_map_attr_arg_indexes (tree attrs, const char *attr_name,
|
||||
unsigned *indexes, int len, int delta)
|
||||
{
|
||||
tree attr = lookup_attribute (attr_name, attrs);
|
||||
tree op;
|
||||
|
||||
if (!attr)
|
||||
return;
|
||||
|
||||
TREE_VALUE (attr) = copy_list (TREE_VALUE (attr));
|
||||
for (op = TREE_VALUE (attr); op; op = TREE_CHAIN (op))
|
||||
{
|
||||
int idx;
|
||||
|
||||
if (TREE_CODE (TREE_VALUE (op)) != INTEGER_CST)
|
||||
continue;
|
||||
|
||||
idx = TREE_INT_CST_LOW (TREE_VALUE (op));
|
||||
|
||||
/* If idx exceeds indexes length then we just
|
||||
keep it at the same distance from the last
|
||||
known arg. */
|
||||
if (idx > len)
|
||||
idx += delta;
|
||||
else
|
||||
idx = indexes[idx - 1] + 1;
|
||||
TREE_VALUE (op) = build_int_cst (TREE_TYPE (TREE_VALUE (op)), idx);
|
||||
}
|
||||
}
|
||||
|
||||
/* Make a copy of function type ORIG_TYPE adding pointer
|
||||
bounds as additional arguments. */
|
||||
|
||||
tree
|
||||
chkp_copy_function_type_adding_bounds (tree orig_type)
|
||||
{
|
||||
tree type;
|
||||
tree arg_type, attrs;
|
||||
unsigned len = list_length (TYPE_ARG_TYPES (orig_type));
|
||||
unsigned *indexes = XALLOCAVEC (unsigned, len);
|
||||
unsigned idx = 0, new_idx = 0;
|
||||
|
||||
for (arg_type = TYPE_ARG_TYPES (orig_type);
|
||||
arg_type;
|
||||
arg_type = TREE_CHAIN (arg_type))
|
||||
if (TREE_VALUE (arg_type) == void_type_node)
|
||||
continue;
|
||||
else if (BOUNDED_TYPE_P (TREE_VALUE (arg_type))
|
||||
|| pass_by_reference (NULL, TYPE_MODE (TREE_VALUE (arg_type)),
|
||||
TREE_VALUE (arg_type), true)
|
||||
|| chkp_type_has_pointer (TREE_VALUE (arg_type)))
|
||||
break;
|
||||
|
||||
/* We may use original type if there are no bounds passed. */
|
||||
if (!arg_type)
|
||||
return orig_type;
|
||||
|
||||
type = build_distinct_type_copy (orig_type);
|
||||
TYPE_ARG_TYPES (type) = copy_list (TYPE_ARG_TYPES (type));
|
||||
|
||||
for (arg_type = TYPE_ARG_TYPES (type);
|
||||
arg_type;
|
||||
arg_type = TREE_CHAIN (arg_type))
|
||||
{
|
||||
indexes[idx++] = new_idx++;
|
||||
|
||||
/* pass_by_reference returns 1 for void type,
|
||||
so check for it first. */
|
||||
if (TREE_VALUE (arg_type) == void_type_node)
|
||||
continue;
|
||||
else if (BOUNDED_TYPE_P (TREE_VALUE (arg_type))
|
||||
|| pass_by_reference (NULL, TYPE_MODE (TREE_VALUE (arg_type)),
|
||||
TREE_VALUE (arg_type), true))
|
||||
{
|
||||
tree new_type = build_tree_list (NULL_TREE,
|
||||
pointer_bounds_type_node);
|
||||
TREE_CHAIN (new_type) = TREE_CHAIN (arg_type);
|
||||
TREE_CHAIN (arg_type) = new_type;
|
||||
|
||||
arg_type = TREE_CHAIN (arg_type);
|
||||
new_idx++;
|
||||
}
|
||||
else if (chkp_type_has_pointer (TREE_VALUE (arg_type)))
|
||||
{
|
||||
bitmap slots = BITMAP_ALLOC (NULL);
|
||||
bitmap_iterator bi;
|
||||
unsigned bnd_no;
|
||||
|
||||
chkp_find_bound_slots (TREE_VALUE (arg_type), slots);
|
||||
|
||||
EXECUTE_IF_SET_IN_BITMAP (slots, 0, bnd_no, bi)
|
||||
{
|
||||
tree new_type = build_tree_list (NULL_TREE,
|
||||
pointer_bounds_type_node);
|
||||
TREE_CHAIN (new_type) = TREE_CHAIN (arg_type);
|
||||
TREE_CHAIN (arg_type) = new_type;
|
||||
|
||||
arg_type = TREE_CHAIN (arg_type);
|
||||
new_idx++;
|
||||
}
|
||||
BITMAP_FREE (slots);
|
||||
}
|
||||
}
|
||||
|
||||
/* If function type has attribute with arg indexes then
|
||||
we have to copy it fixing attribute ops. Map for
|
||||
fixing is in indexes array. */
|
||||
attrs = TYPE_ATTRIBUTES (type);
|
||||
if (lookup_attribute ("nonnull", attrs)
|
||||
|| lookup_attribute ("format", attrs)
|
||||
|| lookup_attribute ("format_arg", attrs))
|
||||
{
|
||||
int delta = new_idx - len;
|
||||
attrs = copy_list (TYPE_ATTRIBUTES (type));
|
||||
chkp_map_attr_arg_indexes (attrs, "nonnull", indexes, len, delta);
|
||||
chkp_map_attr_arg_indexes (attrs, "format", indexes, len, delta);
|
||||
chkp_map_attr_arg_indexes (attrs, "format_arg", indexes, len, delta);
|
||||
TYPE_ATTRIBUTES (type) = attrs;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/* For given function FNDECL add bounds arguments to arguments
|
||||
list. */
|
||||
|
||||
static void
|
||||
chkp_add_bounds_params_to_function (tree fndecl)
|
||||
{
|
||||
tree arg;
|
||||
|
||||
for (arg = DECL_ARGUMENTS (fndecl); arg; arg = DECL_CHAIN (arg))
|
||||
if (BOUNDED_P (arg))
|
||||
{
|
||||
std::string new_name = CHKP_BOUNDS_OF_SYMBOL_PREFIX;
|
||||
tree new_arg;
|
||||
|
||||
if (DECL_NAME (arg))
|
||||
new_name += IDENTIFIER_POINTER (DECL_NAME (arg));
|
||||
else
|
||||
{
|
||||
char uid[25];
|
||||
snprintf (uid, 25, "D.%u", DECL_UID (arg));
|
||||
new_name += uid;
|
||||
}
|
||||
|
||||
new_arg = build_decl (DECL_SOURCE_LOCATION (arg), PARM_DECL,
|
||||
get_identifier (new_name.c_str ()),
|
||||
pointer_bounds_type_node);
|
||||
DECL_ARG_TYPE (new_arg) = pointer_bounds_type_node;
|
||||
DECL_CONTEXT (new_arg) = DECL_CONTEXT (arg);
|
||||
DECL_ARTIFICIAL (new_arg) = 1;
|
||||
DECL_CHAIN (new_arg) = DECL_CHAIN (arg);
|
||||
DECL_CHAIN (arg) = new_arg;
|
||||
|
||||
arg = DECL_CHAIN (arg);
|
||||
|
||||
}
|
||||
else if (chkp_type_has_pointer (TREE_TYPE (arg)))
|
||||
{
|
||||
tree orig_arg = arg;
|
||||
bitmap slots = BITMAP_ALLOC (NULL);
|
||||
bitmap_iterator bi;
|
||||
unsigned bnd_no;
|
||||
|
||||
chkp_find_bound_slots (TREE_TYPE (arg), slots);
|
||||
|
||||
EXECUTE_IF_SET_IN_BITMAP (slots, 0, bnd_no, bi)
|
||||
{
|
||||
std::string new_name = CHKP_BOUNDS_OF_SYMBOL_PREFIX;
|
||||
tree new_arg;
|
||||
char offs[25];
|
||||
|
||||
if (DECL_NAME (orig_arg))
|
||||
new_name += IDENTIFIER_POINTER (DECL_NAME (orig_arg));
|
||||
else
|
||||
{
|
||||
snprintf (offs, 25, "D.%u", DECL_UID (arg));
|
||||
new_name += offs;
|
||||
}
|
||||
snprintf (offs, 25, "__%u", bnd_no * POINTER_SIZE / BITS_PER_UNIT);
|
||||
|
||||
new_arg = build_decl (DECL_SOURCE_LOCATION (orig_arg),
|
||||
PARM_DECL,
|
||||
get_identifier (new_name.c_str ()),
|
||||
pointer_bounds_type_node);
|
||||
DECL_ARG_TYPE (new_arg) = pointer_bounds_type_node;
|
||||
DECL_CONTEXT (new_arg) = DECL_CONTEXT (orig_arg);
|
||||
DECL_ARTIFICIAL (new_arg) = 1;
|
||||
DECL_CHAIN (new_arg) = DECL_CHAIN (arg);
|
||||
DECL_CHAIN (arg) = new_arg;
|
||||
|
||||
arg = DECL_CHAIN (arg);
|
||||
}
|
||||
BITMAP_FREE (slots);
|
||||
}
|
||||
|
||||
TREE_TYPE (fndecl) =
|
||||
chkp_copy_function_type_adding_bounds (TREE_TYPE (fndecl));
|
||||
}
|
||||
|
||||
/* Return an instrumentation clone for builtin function
|
||||
FNDECL. Create one if needed. */
|
||||
|
||||
tree
|
||||
chkp_maybe_clone_builtin_fndecl (tree fndecl)
|
||||
{
|
||||
tree clone;
|
||||
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
|
||||
|
||||
gcc_assert (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|
||||
&& fcode < BEGIN_CHKP_BUILTINS);
|
||||
|
||||
fcode = (enum built_in_function) (fcode + BEGIN_CHKP_BUILTINS + 1);
|
||||
clone = builtin_decl_explicit (fcode);
|
||||
if (clone)
|
||||
return clone;
|
||||
|
||||
clone = chkp_build_instrumented_fndecl (fndecl);
|
||||
chkp_add_bounds_params_to_function (clone);
|
||||
|
||||
gcc_assert (DECL_FUNCTION_CODE (clone) == fcode);
|
||||
|
||||
set_builtin_decl (fcode, clone, false);
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
/* Return 1 if function FNDECL should be instrumented. */
|
||||
|
||||
bool
|
||||
chkp_instrumentable_p (tree fndecl)
|
||||
{
|
||||
struct function *fn = DECL_STRUCT_FUNCTION (fndecl);
|
||||
return (!lookup_attribute ("bnd_legacy", DECL_ATTRIBUTES (fndecl))
|
||||
&& (!flag_chkp_instrument_marked_only
|
||||
|| lookup_attribute ("bnd_instrument", DECL_ATTRIBUTES (fndecl)))
|
||||
&& (!fn || !copy_forbidden (fn)));
|
||||
}
|
||||
|
||||
/* Return clone created for instrumentation of NODE or NULL. */
|
||||
|
||||
cgraph_node *
|
||||
chkp_maybe_create_clone (tree fndecl)
|
||||
{
|
||||
cgraph_node *node = cgraph_node::get_create (fndecl);
|
||||
cgraph_node *clone = node->instrumented_version;
|
||||
|
||||
gcc_assert (!node->instrumentation_clone);
|
||||
|
||||
if (DECL_BUILT_IN (fndecl)
|
||||
&& (DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL
|
||||
|| DECL_FUNCTION_CODE (fndecl) >= BEGIN_CHKP_BUILTINS))
|
||||
return NULL;
|
||||
|
||||
clone = node->instrumented_version;
|
||||
|
||||
/* Some instrumented builtin function calls may be optimized and
|
||||
cgraph nodes may be removed as unreachable. Later optimizations
|
||||
may generate new calls to removed functions and in this case
|
||||
we have to recreate cgraph node. FUNCTION_DECL for instrumented
|
||||
builtin still exists and should be reused in such case. */
|
||||
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|
||||
&& fndecl == builtin_decl_explicit (DECL_FUNCTION_CODE (fndecl))
|
||||
&& !clone)
|
||||
{
|
||||
enum built_in_function fncode = DECL_FUNCTION_CODE (fndecl);
|
||||
tree new_decl;
|
||||
|
||||
fncode = (enum built_in_function) (fncode + BEGIN_CHKP_BUILTINS + 1);
|
||||
new_decl = builtin_decl_explicit (fncode);
|
||||
|
||||
/* We've actually already created an instrumented clone once.
|
||||
Restore it. */
|
||||
if (new_decl)
|
||||
{
|
||||
clone = cgraph_node::get (new_decl);
|
||||
|
||||
if (!clone)
|
||||
{
|
||||
gcc_assert (!gimple_has_body_p (fndecl));
|
||||
clone = cgraph_node::get_create (new_decl);
|
||||
clone->externally_visible = node->externally_visible;
|
||||
clone->local = node->local;
|
||||
clone->address_taken = node->address_taken;
|
||||
clone->thunk = node->thunk;
|
||||
clone->alias = node->alias;
|
||||
clone->weakref = node->weakref;
|
||||
clone->cpp_implicit_alias = node->cpp_implicit_alias;
|
||||
clone->orig_decl = fndecl;
|
||||
clone->instrumentation_clone = true;
|
||||
}
|
||||
|
||||
clone->instrumented_version = node;
|
||||
node->instrumented_version = clone;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clone)
|
||||
{
|
||||
tree new_decl = chkp_build_instrumented_fndecl (fndecl);
|
||||
struct cgraph_edge *e;
|
||||
struct ipa_ref *ref;
|
||||
int i;
|
||||
|
||||
clone = node->create_version_clone (new_decl, vNULL, NULL);
|
||||
clone->externally_visible = node->externally_visible;
|
||||
clone->local = node->local;
|
||||
clone->address_taken = node->address_taken;
|
||||
clone->thunk = node->thunk;
|
||||
clone->alias = node->alias;
|
||||
clone->weakref = node->weakref;
|
||||
clone->cpp_implicit_alias = node->cpp_implicit_alias;
|
||||
clone->instrumented_version = node;
|
||||
clone->orig_decl = fndecl;
|
||||
clone->instrumentation_clone = true;
|
||||
node->instrumented_version = clone;
|
||||
|
||||
if (gimple_has_body_p (fndecl))
|
||||
{
|
||||
gcc_assert (chkp_instrumentable_p (fndecl));
|
||||
tree_function_versioning (fndecl, new_decl, NULL, false,
|
||||
NULL, false, NULL, NULL);
|
||||
clone->lowered = true;
|
||||
}
|
||||
|
||||
/* New params are inserted after versioning because it
|
||||
actually copies args list from the original decl. */
|
||||
chkp_add_bounds_params_to_function (new_decl);
|
||||
|
||||
/* Remember builtin fndecl. */
|
||||
if (DECL_BUILT_IN_CLASS (clone->decl) == BUILT_IN_NORMAL
|
||||
&& fndecl == builtin_decl_explicit (DECL_FUNCTION_CODE (fndecl)))
|
||||
{
|
||||
gcc_assert (!builtin_decl_explicit (DECL_FUNCTION_CODE (clone->decl)));
|
||||
set_builtin_decl (DECL_FUNCTION_CODE (clone->decl),
|
||||
clone->decl, false);
|
||||
}
|
||||
|
||||
/* Clones have the same comdat group as originals. */
|
||||
if (node->same_comdat_group
|
||||
|| (DECL_ONE_ONLY (node->decl)
|
||||
&& !DECL_EXTERNAL (node->decl)))
|
||||
clone->add_to_same_comdat_group (node);
|
||||
|
||||
if (gimple_has_body_p (fndecl))
|
||||
symtab->call_cgraph_insertion_hooks (clone);
|
||||
|
||||
/* Clone all aliases. */
|
||||
for (i = 0; node->iterate_direct_aliases (i, ref); i++)
|
||||
chkp_maybe_create_clone (ref->referring->decl);
|
||||
|
||||
/* Clone all thunks. */
|
||||
for (e = node->callers; e; e = e->next_caller)
|
||||
if (e->caller->thunk.thunk_p
|
||||
&& !e->caller->thunk.add_pointer_bounds_args
|
||||
&& !e->caller->instrumentation_clone)
|
||||
{
|
||||
struct cgraph_node *thunk
|
||||
= chkp_maybe_create_clone (e->caller->decl);
|
||||
/* Redirect thunk clone edge to the node clone. */
|
||||
thunk->callees->redirect_callee (clone);
|
||||
}
|
||||
|
||||
/* For aliases and thunks we should make sure target is cloned
|
||||
to have proper references and edges. */
|
||||
if (node->thunk.thunk_p)
|
||||
chkp_maybe_create_clone (node->callees->callee->decl);
|
||||
else if (node->alias)
|
||||
{
|
||||
struct cgraph_node *target;
|
||||
|
||||
ref = node->ref_list.first_reference ();
|
||||
if (ref)
|
||||
{
|
||||
target = chkp_maybe_create_clone (ref->referred->decl);
|
||||
clone->create_reference (target, IPA_REF_ALIAS);
|
||||
}
|
||||
|
||||
if (node->alias_target)
|
||||
{
|
||||
if (TREE_CODE (node->alias_target) == FUNCTION_DECL)
|
||||
{
|
||||
target = chkp_maybe_create_clone (node->alias_target);
|
||||
clone->alias_target = target->decl;
|
||||
}
|
||||
else
|
||||
clone->alias_target = node->alias_target;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add IPA reference. It's main role is to keep instrumented
|
||||
version reachable while original node is reachable. */
|
||||
ref = node->create_reference (clone, IPA_REF_CHKP, NULL);
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
/* Create clone for all functions to be instrumented. */
|
||||
|
||||
static unsigned int
|
||||
chkp_versioning (void)
|
||||
{
|
||||
struct cgraph_node *node;
|
||||
const char *reason;
|
||||
|
||||
bitmap_obstack_initialize (NULL);
|
||||
|
||||
FOR_EACH_DEFINED_FUNCTION (node)
|
||||
{
|
||||
tree decl = node->decl;
|
||||
if (!node->instrumentation_clone
|
||||
&& !node->instrumented_version
|
||||
&& !node->alias
|
||||
&& !node->thunk.thunk_p
|
||||
&& (!DECL_BUILT_IN (decl)
|
||||
|| (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
|
||||
&& DECL_FUNCTION_CODE (decl) < BEGIN_CHKP_BUILTINS)))
|
||||
{
|
||||
if (chkp_instrumentable_p (decl))
|
||||
chkp_maybe_create_clone (decl);
|
||||
else if ((reason = copy_forbidden (DECL_STRUCT_FUNCTION (decl))))
|
||||
{
|
||||
if (warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wchkp,
|
||||
"function cannot be instrumented"))
|
||||
inform (DECL_SOURCE_LOCATION (decl), reason, decl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Mark all aliases and thunks of functions with no instrumented
|
||||
version as legacy function. */
|
||||
FOR_EACH_DEFINED_FUNCTION (node)
|
||||
{
|
||||
if (!node->instrumentation_clone
|
||||
&& !node->instrumented_version
|
||||
&& (node->alias || node->thunk.thunk_p)
|
||||
&& !lookup_attribute ("bnd_legacy", DECL_ATTRIBUTES (node->decl)))
|
||||
DECL_ATTRIBUTES (node->decl)
|
||||
= tree_cons (get_identifier ("bnd_legacy"), NULL,
|
||||
DECL_ATTRIBUTES (node->decl));
|
||||
}
|
||||
|
||||
bitmap_obstack_release (NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* In this pass we remove bodies of functions having
|
||||
instrumented version. Functions with removed bodies
|
||||
become a special kind of thunks to provide a connection
|
||||
between calls to the original version and instrumented
|
||||
function. */
|
||||
|
||||
static unsigned int
|
||||
chkp_produce_thunks (bool early)
|
||||
{
|
||||
struct cgraph_node *node;
|
||||
|
||||
FOR_EACH_DEFINED_FUNCTION (node)
|
||||
{
|
||||
if (!node->instrumentation_clone
|
||||
&& node->instrumented_version
|
||||
&& gimple_has_body_p (node->decl)
|
||||
&& gimple_has_body_p (node->instrumented_version->decl)
|
||||
&& (!lookup_attribute ("always_inline", DECL_ATTRIBUTES (node->decl))
|
||||
|| !early))
|
||||
{
|
||||
node->release_body ();
|
||||
node->remove_callees ();
|
||||
node->remove_all_references ();
|
||||
|
||||
node->thunk.thunk_p = true;
|
||||
node->thunk.add_pointer_bounds_args = true;
|
||||
node->create_edge (node->instrumented_version, NULL,
|
||||
node->count);
|
||||
node->create_reference (node->instrumented_version,
|
||||
IPA_REF_CHKP, NULL);
|
||||
/* Thunk shouldn't be a cdtor. */
|
||||
DECL_STATIC_CONSTRUCTOR (node->decl) = 0;
|
||||
DECL_STATIC_DESTRUCTOR (node->decl) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mark instrumentation clones created for aliases and thunks
|
||||
as insttrumented so they could be removed as unreachable
|
||||
now. */
|
||||
if (!early)
|
||||
{
|
||||
FOR_EACH_DEFINED_FUNCTION (node)
|
||||
{
|
||||
if (node->instrumentation_clone
|
||||
&& (node->alias || node->thunk.thunk_p)
|
||||
&& !chkp_function_instrumented_p (node->decl))
|
||||
chkp_function_mark_instrumented (node->decl);
|
||||
}
|
||||
}
|
||||
|
||||
return TODO_remove_functions;
|
||||
}
|
||||
|
||||
const pass_data pass_data_ipa_chkp_versioning =
|
||||
{
|
||||
SIMPLE_IPA_PASS, /* type */
|
||||
"chkp_versioning", /* name */
|
||||
OPTGROUP_NONE, /* optinfo_flags */
|
||||
TV_NONE, /* tv_id */
|
||||
0, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
0 /* todo_flags_finish */
|
||||
};
|
||||
|
||||
const pass_data pass_data_ipa_chkp_early_produce_thunks =
|
||||
{
|
||||
SIMPLE_IPA_PASS, /* type */
|
||||
"chkp_ecleanup", /* name */
|
||||
OPTGROUP_NONE, /* optinfo_flags */
|
||||
TV_NONE, /* tv_id */
|
||||
0, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
0 /* todo_flags_finish */
|
||||
};
|
||||
|
||||
const pass_data pass_data_ipa_chkp_produce_thunks =
|
||||
{
|
||||
SIMPLE_IPA_PASS, /* type */
|
||||
"chkp_cleanup", /* name */
|
||||
OPTGROUP_NONE, /* optinfo_flags */
|
||||
TV_NONE, /* tv_id */
|
||||
0, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
0 /* todo_flags_finish */
|
||||
};
|
||||
|
||||
class pass_ipa_chkp_versioning : public simple_ipa_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_ipa_chkp_versioning (gcc::context *ctxt)
|
||||
: simple_ipa_opt_pass (pass_data_ipa_chkp_versioning, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual opt_pass * clone ()
|
||||
{
|
||||
return new pass_ipa_chkp_versioning (m_ctxt);
|
||||
}
|
||||
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
return flag_check_pointer_bounds;
|
||||
}
|
||||
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
return chkp_versioning ();
|
||||
}
|
||||
|
||||
}; // class pass_ipa_chkp_versioning
|
||||
|
||||
class pass_ipa_chkp_early_produce_thunks : public simple_ipa_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_ipa_chkp_early_produce_thunks (gcc::context *ctxt)
|
||||
: simple_ipa_opt_pass (pass_data_ipa_chkp_early_produce_thunks, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual opt_pass * clone ()
|
||||
{
|
||||
return new pass_ipa_chkp_early_produce_thunks (m_ctxt);
|
||||
}
|
||||
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
return flag_check_pointer_bounds;
|
||||
}
|
||||
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
return chkp_produce_thunks (true);
|
||||
}
|
||||
|
||||
}; // class pass_chkp_produce_thunks
|
||||
|
||||
class pass_ipa_chkp_produce_thunks : public simple_ipa_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_ipa_chkp_produce_thunks (gcc::context *ctxt)
|
||||
: simple_ipa_opt_pass (pass_data_ipa_chkp_produce_thunks, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual opt_pass * clone ()
|
||||
{
|
||||
return new pass_ipa_chkp_produce_thunks (m_ctxt);
|
||||
}
|
||||
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
return flag_check_pointer_bounds;
|
||||
}
|
||||
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
return chkp_produce_thunks (false);
|
||||
}
|
||||
|
||||
}; // class pass_chkp_produce_thunks
|
||||
|
||||
simple_ipa_opt_pass *
|
||||
make_pass_ipa_chkp_versioning (gcc::context *ctxt)
|
||||
{
|
||||
return new pass_ipa_chkp_versioning (ctxt);
|
||||
}
|
||||
|
||||
simple_ipa_opt_pass *
|
||||
make_pass_ipa_chkp_early_produce_thunks (gcc::context *ctxt)
|
||||
{
|
||||
return new pass_ipa_chkp_early_produce_thunks (ctxt);
|
||||
}
|
||||
|
||||
simple_ipa_opt_pass *
|
||||
make_pass_ipa_chkp_produce_thunks (gcc::context *ctxt)
|
||||
{
|
||||
return new pass_ipa_chkp_produce_thunks (ctxt);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/* Declaration of interface functions of Pointer Bounds Checker.
|
||||
Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_IPA_CHKP_H
|
||||
#define GCC_IPA_CHKP_H
|
||||
|
||||
extern tree chkp_copy_function_type_adding_bounds (tree orig_type);
|
||||
extern tree chkp_maybe_clone_builtin_fndecl (tree fndecl);
|
||||
extern cgraph_node *chkp_maybe_create_clone (tree fndecl);
|
||||
extern bool chkp_instrumentable_p (tree fndecl);
|
||||
extern bool chkp_wrap_function (tree fndecl);
|
||||
|
||||
#endif /* GCC_IPA_CHKP_H */
|
24
gcc/ipa-cp.c
24
gcc/ipa-cp.c
|
@ -1177,7 +1177,7 @@ initialize_node_lattices (struct cgraph_node *node)
|
|||
int i;
|
||||
|
||||
gcc_checking_assert (node->has_gimple_body_p ());
|
||||
if (cgraph_local_p (node))
|
||||
if (node->local.local)
|
||||
{
|
||||
int caller_count = 0;
|
||||
node->call_for_symbol_thunks_and_aliases (count_callers, &caller_count,
|
||||
|
@ -2271,24 +2271,6 @@ propagate_constants_across_call (struct cgraph_edge *cs)
|
|||
if (parms_count == 0)
|
||||
return false;
|
||||
|
||||
/* No propagation through instrumentation thunks is available yet.
|
||||
It should be possible with proper mapping of call args and
|
||||
instrumented callee params in the propagation loop below. But
|
||||
this case mostly occurs when legacy code calls instrumented code
|
||||
and it is not a primary target for optimizations.
|
||||
We detect instrumentation thunks in aliases and thunks chain by
|
||||
checking instrumentation_clone flag for chain source and target.
|
||||
Going through instrumentation thunks we always have it changed
|
||||
from 0 to 1 and all other nodes do not change it. */
|
||||
if (!cs->callee->instrumentation_clone
|
||||
&& callee->instrumentation_clone)
|
||||
{
|
||||
for (i = 0; i < parms_count; i++)
|
||||
ret |= set_all_contains_variable (ipa_get_parm_lattices (callee_info,
|
||||
i));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* If this call goes through a thunk we must not propagate to the first (0th)
|
||||
parameter. However, we might need to uncover a thunk from below a series
|
||||
of aliases first. */
|
||||
|
@ -3967,9 +3949,7 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node,
|
|||
|
||||
if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
|
||||
|| (i == 0
|
||||
&& call_passes_through_thunk_p (cs))
|
||||
|| (!cs->callee->instrumentation_clone
|
||||
&& cs->callee->function_symbol ()->instrumentation_clone))
|
||||
&& call_passes_through_thunk_p (cs)))
|
||||
{
|
||||
newval = NULL_TREE;
|
||||
break;
|
||||
|
|
|
@ -113,7 +113,7 @@ process_hsa_functions (void)
|
|||
TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl);
|
||||
clone->externally_visible = node->externally_visible;
|
||||
|
||||
if (!cgraph_local_p (node))
|
||||
if (!node->local.local)
|
||||
clone->force_output = true;
|
||||
hsa_summaries->link_functions (clone, node, HSA_FUNCTION, false);
|
||||
|
||||
|
|
|
@ -754,8 +754,7 @@ func_checker::compare_gimple_call (gcall *s1, gcall *s2)
|
|||
|| gimple_call_return_slot_opt_p (s1) != gimple_call_return_slot_opt_p (s2)
|
||||
|| gimple_call_from_thunk_p (s1) != gimple_call_from_thunk_p (s2)
|
||||
|| gimple_call_va_arg_pack_p (s1) != gimple_call_va_arg_pack_p (s2)
|
||||
|| gimple_call_alloca_for_var_p (s1) != gimple_call_alloca_for_var_p (s2)
|
||||
|| gimple_call_with_bounds_p (s1) != gimple_call_with_bounds_p (s2))
|
||||
|| gimple_call_alloca_for_var_p (s1) != gimple_call_alloca_for_var_p (s2))
|
||||
return false;
|
||||
|
||||
if (gimple_call_internal_p (s1)
|
||||
|
|
|
@ -1220,8 +1220,7 @@ sem_function::merge (sem_item *alias_item)
|
|||
are not interposable. */
|
||||
redirect_callers
|
||||
= alias->get_availability () > AVAIL_INTERPOSABLE
|
||||
&& original->get_availability () > AVAIL_INTERPOSABLE
|
||||
&& !alias->instrumented_version;
|
||||
&& original->get_availability () > AVAIL_INTERPOSABLE;
|
||||
/* TODO: We can redirect, but we need to produce alias of ORIGINAL
|
||||
with proper properties. */
|
||||
if (!sem_item::compare_referenced_symbol_properties (NULL, original, alias,
|
||||
|
|
|
@ -2712,13 +2712,6 @@ early_inliner (function *fun)
|
|||
node->verify ();
|
||||
node->remove_all_references ();
|
||||
|
||||
/* Rebuild this reference because it dosn't depend on
|
||||
function's body and it's required to pass cgraph_node
|
||||
verification. */
|
||||
if (node->instrumented_version
|
||||
&& !node->instrumentation_clone)
|
||||
node->create_reference (node->instrumented_version, IPA_REF_CHKP, NULL);
|
||||
|
||||
/* Even when not optimizing or not inlining inline always-inline
|
||||
functions. */
|
||||
inlined = inline_always_inline_functions (node);
|
||||
|
|
|
@ -259,10 +259,6 @@ warn_function_noreturn (tree decl)
|
|||
{
|
||||
tree original_decl = decl;
|
||||
|
||||
cgraph_node *node = cgraph_node::get (decl);
|
||||
if (node->instrumentation_clone)
|
||||
decl = node->instrumented_version->decl;
|
||||
|
||||
static hash_set<tree> *warned_about;
|
||||
if (!lang_hooks.missing_noreturn_ok_p (decl)
|
||||
&& targetm.warn_func_return (decl))
|
||||
|
@ -276,10 +272,6 @@ warn_function_cold (tree decl)
|
|||
{
|
||||
tree original_decl = decl;
|
||||
|
||||
cgraph_node *node = cgraph_node::get (decl);
|
||||
if (node->instrumentation_clone)
|
||||
decl = node->instrumented_version->decl;
|
||||
|
||||
static hash_set<tree> *warned_about;
|
||||
warned_about
|
||||
= suggest_attribute (OPT_Wsuggest_attribute_cold, original_decl,
|
||||
|
@ -1619,7 +1611,6 @@ propagate_pure_const (void)
|
|||
fprintf (dump_file, " global var write\n");
|
||||
break;
|
||||
case IPA_REF_ADDR:
|
||||
case IPA_REF_CHKP:
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
|
|
|
@ -32,8 +32,7 @@ enum GTY(()) ipa_ref_use
|
|||
IPA_REF_LOAD,
|
||||
IPA_REF_STORE,
|
||||
IPA_REF_ADDR,
|
||||
IPA_REF_ALIAS,
|
||||
IPA_REF_CHKP
|
||||
IPA_REF_ALIAS
|
||||
};
|
||||
|
||||
/* Record of reference in callgraph or varpool. */
|
||||
|
|
|
@ -104,7 +104,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "gimple-pretty-print.h"
|
||||
#include "ipa-fnsummary.h"
|
||||
#include "cfgloop.h"
|
||||
#include "tree-chkp.h"
|
||||
|
||||
/* Per basic block info. */
|
||||
|
||||
|
@ -151,7 +150,6 @@ struct split_point best_split_point;
|
|||
static bitmap forbidden_dominators;
|
||||
|
||||
static tree find_retval (basic_block return_bb);
|
||||
static tree find_retbnd (basic_block return_bb);
|
||||
|
||||
/* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic
|
||||
variable, check it if it is present in bitmap passed via DATA. */
|
||||
|
@ -433,7 +431,6 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
|
|||
gphi_iterator bsi;
|
||||
unsigned int i;
|
||||
tree retval;
|
||||
tree retbnd;
|
||||
bool back_edge = false;
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
|
@ -678,29 +675,6 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
|
|||
else
|
||||
current->split_part_set_retval = true;
|
||||
|
||||
/* See if retbnd used by return bb is computed by header or split part. */
|
||||
retbnd = find_retbnd (return_bb);
|
||||
if (retbnd)
|
||||
{
|
||||
bool split_part_set_retbnd
|
||||
= split_part_set_ssa_name_p (retbnd, current, return_bb);
|
||||
|
||||
/* If we have both return value and bounds then keep their definitions
|
||||
in a single function. We use SSA names to link returned bounds and
|
||||
value and therefore do not handle cases when result is passed by
|
||||
reference (which should not be our case anyway since bounds are
|
||||
returned for pointers only). */
|
||||
if ((DECL_BY_REFERENCE (DECL_RESULT (current_function_decl))
|
||||
&& current->split_part_set_retval)
|
||||
|| split_part_set_retbnd != current->split_part_set_retval)
|
||||
{
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file,
|
||||
" Refused: split point splits return value and bounds\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* split_function fixes up at most one PHI non-virtual PHI node in return_bb,
|
||||
for the return value. If there are other PHIs, give up. */
|
||||
if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun))
|
||||
|
@ -830,18 +804,6 @@ find_retval (basic_block return_bb)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Given return basic block RETURN_BB, see where return bounds are really
|
||||
stored. */
|
||||
static tree
|
||||
find_retbnd (basic_block return_bb)
|
||||
{
|
||||
gimple_stmt_iterator bsi;
|
||||
for (bsi = gsi_last_bb (return_bb); !gsi_end_p (bsi); gsi_prev (&bsi))
|
||||
if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
|
||||
return gimple_return_retbnd (gsi_stmt (bsi));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic
|
||||
variable, mark it as used in bitmap passed via DATA.
|
||||
Return true when access to T prevents splitting the function. */
|
||||
|
@ -1228,8 +1190,7 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
gcall *call, *tsan_func_exit_call = NULL;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
tree retval = NULL, real_retval = NULL, retbnd = NULL;
|
||||
bool with_bounds = chkp_function_instrumented_p (current_function_decl);
|
||||
tree retval = NULL, real_retval = NULL;
|
||||
gimple *last_stmt = NULL;
|
||||
unsigned int i;
|
||||
tree arg, ddef;
|
||||
|
@ -1311,14 +1272,10 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
e = make_single_succ_edge (new_return_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0);
|
||||
add_bb_to_loop (new_return_bb, current_loops->tree_root);
|
||||
bitmap_set_bit (split_point->split_bbs, new_return_bb->index);
|
||||
retbnd = find_retbnd (return_bb);
|
||||
}
|
||||
/* When we pass around the value, use existing return block. */
|
||||
else
|
||||
{
|
||||
bitmap_set_bit (split_point->split_bbs, return_bb->index);
|
||||
retbnd = find_retbnd (return_bb);
|
||||
}
|
||||
bitmap_set_bit (split_point->split_bbs, return_bb->index);
|
||||
|
||||
/* If RETURN_BB has virtual operand PHIs, they must be removed and the
|
||||
virtual operand marked for renaming as we change the CFG in a way that
|
||||
|
@ -1434,11 +1391,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
}
|
||||
}
|
||||
|
||||
/* If the original function is instrumented then it's
|
||||
part is also instrumented. */
|
||||
if (with_bounds)
|
||||
chkp_function_mark_instrumented (node->decl);
|
||||
|
||||
/* If the original function is declared inline, there is no point in issuing
|
||||
a warning for the non-inlinable part. */
|
||||
DECL_NO_INLINE_WARNING_P (node->decl) = 1;
|
||||
|
@ -1474,7 +1426,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
args_to_pass[i] = arg;
|
||||
}
|
||||
call = gimple_build_call_vec (node->decl, args_to_pass);
|
||||
gimple_call_set_with_bounds (call, with_bounds);
|
||||
gimple_set_block (call, DECL_INITIAL (current_function_decl));
|
||||
args_to_pass.release ();
|
||||
|
||||
|
@ -1618,21 +1569,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Replace retbnd with new one. */
|
||||
if (retbnd)
|
||||
{
|
||||
gimple_stmt_iterator bsi;
|
||||
for (bsi = gsi_last_bb (return_bb); !gsi_end_p (bsi);
|
||||
gsi_prev (&bsi))
|
||||
if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
|
||||
{
|
||||
retbnd = copy_ssa_name (retbnd, call);
|
||||
gimple_return_set_retbnd (gsi_stmt (bsi), retbnd);
|
||||
update_stmt (gsi_stmt (bsi));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
|
||||
{
|
||||
|
@ -1653,9 +1589,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
gsi_insert_after (&gsi, cpy, GSI_NEW_STMT);
|
||||
retval = tem;
|
||||
}
|
||||
/* Build bndret call to obtain returned bounds. */
|
||||
if (retbnd)
|
||||
chkp_insert_retbnd_call (retbnd, retval, &gsi);
|
||||
gimple_call_set_lhs (call, retval);
|
||||
update_stmt (call);
|
||||
}
|
||||
|
@ -1676,10 +1609,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
{
|
||||
retval = DECL_RESULT (current_function_decl);
|
||||
|
||||
if (chkp_function_instrumented_p (current_function_decl)
|
||||
&& BOUNDED_P (retval))
|
||||
retbnd = create_tmp_reg (pointer_bounds_type_node);
|
||||
|
||||
/* We use temporary register to hold value when aggregate_value_p
|
||||
is false. Similarly for DECL_BY_REFERENCE we must avoid extra
|
||||
copy. */
|
||||
|
@ -1717,9 +1646,6 @@ split_function (basic_block return_bb, struct split_point *split_point,
|
|||
gsi_insert_after (&gsi, g, GSI_NEW_STMT);
|
||||
}
|
||||
}
|
||||
/* Build bndret call to obtain returned bounds. */
|
||||
if (retbnd)
|
||||
chkp_insert_retbnd_call (retbnd, retval, &gsi);
|
||||
if (tsan_func_exit_call)
|
||||
gsi_insert_after (&gsi, tsan_func_exit_call, GSI_NEW_STMT);
|
||||
ret = gimple_build_return (retval);
|
||||
|
|
|
@ -245,10 +245,6 @@ cgraph_externally_visible_p (struct cgraph_node *node,
|
|||
if (MAIN_NAME_P (DECL_NAME (node->decl)))
|
||||
return true;
|
||||
|
||||
if (node->instrumentation_clone
|
||||
&& MAIN_NAME_P (DECL_NAME (node->orig_decl)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
56
gcc/ipa.c
56
gcc/ipa.c
|
@ -240,13 +240,7 @@ walk_polymorphic_call_targets (hash_set<void *> *reachable_call_targets,
|
|||
if (ipa_fn_summaries)
|
||||
ipa_update_overall_fn_summary (node);
|
||||
else if (edge->call_stmt)
|
||||
{
|
||||
edge->redirect_call_stmt_to_callee ();
|
||||
|
||||
/* Call to __builtin_unreachable shouldn't be instrumented. */
|
||||
if (!targets.length ())
|
||||
gimple_call_set_with_bounds (edge->call_stmt, false);
|
||||
}
|
||||
edge->redirect_call_stmt_to_callee ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -462,20 +456,6 @@ symbol_table::remove_unreachable_nodes (FILE *file)
|
|||
if (cnode->global.inlined_to)
|
||||
body_needed_for_clonning.add (cnode->decl);
|
||||
|
||||
/* For instrumentation clones we always need original
|
||||
function node for proper LTO privatization. */
|
||||
if (cnode->instrumentation_clone
|
||||
&& cnode->definition)
|
||||
{
|
||||
gcc_assert (cnode->instrumented_version || in_lto_p);
|
||||
if (cnode->instrumented_version)
|
||||
{
|
||||
enqueue_node (cnode->instrumented_version, &first,
|
||||
&reachable);
|
||||
reachable.add (cnode->instrumented_version);
|
||||
}
|
||||
}
|
||||
|
||||
/* For non-inline clones, force their origins to the boundary and ensure
|
||||
that body is not removed. */
|
||||
while (cnode->clone_of)
|
||||
|
@ -643,8 +623,7 @@ symbol_table::remove_unreachable_nodes (FILE *file)
|
|||
}
|
||||
/* Keep body if it may be useful for constant folding. */
|
||||
if ((flag_wpa || flag_incremental_link == INCREMENTAL_LINK_LTO)
|
||||
|| ((init = ctor_for_folding (vnode->decl)) == error_mark_node
|
||||
&& !POINTER_BOUNDS_P (vnode->decl)))
|
||||
|| ((init = ctor_for_folding (vnode->decl)) == error_mark_node))
|
||||
vnode->remove_initializer ();
|
||||
else
|
||||
DECL_INITIAL (vnode->decl) = init;
|
||||
|
@ -669,10 +648,7 @@ symbol_table::remove_unreachable_nodes (FILE *file)
|
|||
&& !node->used_from_other_partition)
|
||||
{
|
||||
if (!node->call_for_symbol_and_aliases
|
||||
(has_addr_references_p, NULL, true)
|
||||
&& (!node->instrumentation_clone
|
||||
|| !node->instrumented_version
|
||||
|| !node->instrumented_version->address_taken))
|
||||
(has_addr_references_p, NULL, true))
|
||||
{
|
||||
if (file)
|
||||
fprintf (file, " %s", node->name ());
|
||||
|
@ -740,8 +716,6 @@ process_references (varpool_node *vnode,
|
|||
process_references (dyn_cast<varpool_node *> (ref->referring), written,
|
||||
address_taken, read, explicit_refs);
|
||||
break;
|
||||
case IPA_REF_CHKP:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -847,9 +821,8 @@ ipa_discover_readonly_nonaddressable_vars (void)
|
|||
}
|
||||
|
||||
/* Generate and emit a static constructor or destructor. WHICH must
|
||||
be one of 'I' (for a constructor), 'D' (for a destructor), 'P'
|
||||
(for chp static vars constructor) or 'B' (for chkp static bounds
|
||||
constructor). BODY is a STATEMENT_LIST containing GENERIC
|
||||
be one of 'I' (for a constructor), 'D' (for a destructor).
|
||||
BODY is a STATEMENT_LIST containing GENERIC
|
||||
statements. PRIORITY is the initialization priority for this
|
||||
constructor or destructor.
|
||||
|
||||
|
@ -912,20 +885,6 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final)
|
|||
DECL_STATIC_CONSTRUCTOR (decl) = 1;
|
||||
decl_init_priority_insert (decl, priority);
|
||||
break;
|
||||
case 'P':
|
||||
DECL_STATIC_CONSTRUCTOR (decl) = 1;
|
||||
DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("chkp ctor"),
|
||||
NULL,
|
||||
NULL_TREE);
|
||||
decl_init_priority_insert (decl, priority);
|
||||
break;
|
||||
case 'B':
|
||||
DECL_STATIC_CONSTRUCTOR (decl) = 1;
|
||||
DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("bnd_legacy"),
|
||||
NULL,
|
||||
NULL_TREE);
|
||||
decl_init_priority_insert (decl, priority);
|
||||
break;
|
||||
case 'D':
|
||||
DECL_STATIC_DESTRUCTOR (decl) = 1;
|
||||
decl_fini_priority_insert (decl, priority);
|
||||
|
@ -943,9 +902,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final)
|
|||
}
|
||||
|
||||
/* Generate and emit a static constructor or destructor. WHICH must
|
||||
be one of 'I' (for a constructor), 'D' (for a destructor), 'P'
|
||||
(for chkp static vars constructor) or 'B' (for chkp static bounds
|
||||
constructor). BODY is a STATEMENT_LIST containing GENERIC
|
||||
be one of 'I' (for a constructor) or 'D' (for a destructor).
|
||||
BODY is a STATEMENT_LIST containing GENERIC
|
||||
statements. PRIORITY is the initialization priority for this
|
||||
constructor or destructor. */
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "pass_manager.h"
|
||||
#include "ipa-utils.h"
|
||||
#include "omp-offload.h"
|
||||
#include "ipa-chkp.h"
|
||||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
|
||||
|
@ -544,7 +543,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
|
|||
/* When doing incremental link, we will get new resolution
|
||||
info next time we process the file. */
|
||||
flag_incremental_link ? LDPR_UNKNOWN : node->resolution);
|
||||
bp_pack_value (&bp, node->instrumentation_clone, 1);
|
||||
bp_pack_value (&bp, node->split_part, 1);
|
||||
streamer_write_bitpack (&bp);
|
||||
streamer_write_data_stream (ob->main_stream, section, strlen (section) + 1);
|
||||
|
@ -564,9 +562,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
|
|||
streamer_write_hwi_stream (ob->main_stream, node->get_init_priority ());
|
||||
if (DECL_STATIC_DESTRUCTOR (node->decl))
|
||||
streamer_write_hwi_stream (ob->main_stream, node->get_fini_priority ());
|
||||
|
||||
if (node->instrumentation_clone)
|
||||
lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->orig_decl);
|
||||
}
|
||||
|
||||
/* Output the varpool NODE to OB.
|
||||
|
@ -775,33 +770,11 @@ output_refs (lto_symtab_encoder_t encoder)
|
|||
{
|
||||
symtab_node *node = lto_symtab_encoder_deref (encoder, i);
|
||||
|
||||
/* IPA_REF_ALIAS and IPA_REF_CHKP references are always preserved
|
||||
/* IPA_REF_ALIAS references are always preserved
|
||||
in the boundary. Alias node can't have other references and
|
||||
can be always handled as if it's not in the boundary. */
|
||||
if (!node->alias && !lto_symtab_encoder_in_partition_p (encoder, node))
|
||||
{
|
||||
cgraph_node *cnode = dyn_cast <cgraph_node *> (node);
|
||||
/* Output IPA_REF_CHKP reference. */
|
||||
if (cnode
|
||||
&& cnode->instrumented_version
|
||||
&& !cnode->instrumentation_clone)
|
||||
{
|
||||
for (int i = 0; node->iterate_reference (i, ref); i++)
|
||||
if (ref->use == IPA_REF_CHKP)
|
||||
{
|
||||
if (lto_symtab_encoder_lookup (encoder, ref->referred)
|
||||
!= LCC_NOT_FOUND)
|
||||
{
|
||||
int nref = lto_symtab_encoder_lookup (encoder, node);
|
||||
streamer_write_gcov_count_stream (ob->main_stream, 1);
|
||||
streamer_write_uhwi_stream (ob->main_stream, nref);
|
||||
lto_output_ref (ob, ref, encoder);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
|
||||
count = node->ref_list.nreferences ();
|
||||
if (count)
|
||||
|
@ -913,8 +886,7 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
|
|||
&& (((vnode->ctor_useable_for_folding_p ()
|
||||
&& (!DECL_VIRTUAL_P (vnode->decl)
|
||||
|| !flag_wpa
|
||||
|| flag_ltrans_devirtualize))
|
||||
|| POINTER_BOUNDS_P (vnode->decl))))
|
||||
|| flag_ltrans_devirtualize)))))
|
||||
{
|
||||
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
|
||||
create_references (encoder, vnode);
|
||||
|
@ -1204,7 +1176,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
|
|||
node->parallelized_function = bp_unpack_value (bp, 1);
|
||||
node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
|
||||
LDPR_NUM_KNOWN);
|
||||
node->instrumentation_clone = bp_unpack_value (bp, 1);
|
||||
node->split_part = bp_unpack_value (bp, 1);
|
||||
gcc_assert (flag_ltrans
|
||||
|| (!node->in_other_partition
|
||||
|
@ -1340,13 +1311,6 @@ input_node (struct lto_file_decl_data *file_data,
|
|||
if (DECL_STATIC_DESTRUCTOR (node->decl))
|
||||
node->set_fini_priority (streamer_read_hwi (ib));
|
||||
|
||||
if (node->instrumentation_clone)
|
||||
{
|
||||
decl_index = streamer_read_uhwi (ib);
|
||||
fn_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
|
||||
node->orig_decl = fn_decl;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -1588,35 +1552,6 @@ input_cgraph_1 (struct lto_file_decl_data *file_data,
|
|||
= dyn_cast<cgraph_node *> (nodes[ref]);
|
||||
else
|
||||
cnode->global.inlined_to = NULL;
|
||||
|
||||
/* Compute instrumented_version. */
|
||||
if (cnode->instrumentation_clone)
|
||||
{
|
||||
gcc_assert (cnode->orig_decl);
|
||||
|
||||
cnode->instrumented_version = cgraph_node::get (cnode->orig_decl);
|
||||
if (cnode->instrumented_version)
|
||||
{
|
||||
/* We may have multiple nodes for a single function which
|
||||
will be merged later. To have a proper merge we need
|
||||
to keep instrumentation_version reference between nodes
|
||||
consistent: each instrumented_version reference should
|
||||
have proper reverse reference. Thus don't break existing
|
||||
instrumented_version reference if it already exists. */
|
||||
if (cnode->instrumented_version->instrumented_version)
|
||||
cnode->instrumented_version = NULL;
|
||||
else
|
||||
cnode->instrumented_version->instrumented_version = cnode;
|
||||
}
|
||||
|
||||
/* Restore decl names reference except for wrapper functions. */
|
||||
if (!chkp_wrap_function (cnode->orig_decl))
|
||||
{
|
||||
tree name = DECL_ASSEMBLER_NAME (cnode->decl);
|
||||
IDENTIFIER_TRANSPARENT_ALIAS (name) = 1;
|
||||
TREE_CHAIN (name) = DECL_ASSEMBLER_NAME (cnode->orig_decl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ref = (int) (intptr_t) node->same_comdat_group;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* lto-partition.c (add_references_to_partition): Remove support
|
||||
for MPX (macros, related functions, fields in cgraph_node, ...).
|
||||
(add_symbol_to_partition_1): Likewise.
|
||||
(privatize_symbol_name): Likewise.
|
||||
* lto-symtab.c (lto_cgraph_replace_node): Likewise.
|
||||
|
||||
2018-06-05 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* lto.c (cmp_type_location): Expand locations only once.
|
||||
|
|
|
@ -115,8 +115,7 @@ add_references_to_partition (ltrans_partition part, symtab_node *node)
|
|||
references, too. */
|
||||
else if (is_a <varpool_node *> (ref->referred)
|
||||
&& (dyn_cast <varpool_node *> (ref->referred)
|
||||
->ctor_useable_for_folding_p ()
|
||||
|| POINTER_BOUNDS_P (ref->referred->decl))
|
||||
->ctor_useable_for_folding_p ())
|
||||
&& !lto_symtab_encoder_in_partition_p (part->encoder, ref->referred))
|
||||
{
|
||||
if (!part->initializers_visited)
|
||||
|
@ -185,11 +184,6 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
|
|||
for (e = cnode->callers; e; e = e->next_caller)
|
||||
if (e->caller->thunk.thunk_p && !e->caller->global.inlined_to)
|
||||
add_symbol_to_partition_1 (part, e->caller);
|
||||
|
||||
/* Instrumented version is actually the same function.
|
||||
Therefore put it into the same partition. */
|
||||
if (cnode->instrumented_version)
|
||||
add_symbol_to_partition_1 (part, cnode->instrumented_version);
|
||||
}
|
||||
|
||||
add_references_to_partition (part, node);
|
||||
|
@ -1003,30 +997,6 @@ privatize_symbol_name (symtab_node *node)
|
|||
if (!privatize_symbol_name_1 (node, node->decl))
|
||||
return false;
|
||||
|
||||
/* We could change name which is a target of transparent alias
|
||||
chain of instrumented function name. Fix alias chain if so .*/
|
||||
if (cgraph_node *cnode = dyn_cast <cgraph_node *> (node))
|
||||
{
|
||||
tree iname = NULL_TREE;
|
||||
if (cnode->instrumentation_clone)
|
||||
{
|
||||
/* If we want to privatize instrumentation clone
|
||||
then we also need to privatize original function. */
|
||||
if (cnode->instrumented_version)
|
||||
privatize_symbol_name (cnode->instrumented_version);
|
||||
else
|
||||
privatize_symbol_name_1 (cnode, cnode->orig_decl);
|
||||
iname = DECL_ASSEMBLER_NAME (cnode->decl);
|
||||
TREE_CHAIN (iname) = DECL_ASSEMBLER_NAME (cnode->orig_decl);
|
||||
}
|
||||
else if (cnode->instrumented_version
|
||||
&& cnode->instrumented_version->orig_decl == cnode->decl)
|
||||
{
|
||||
iname = DECL_ASSEMBLER_NAME (cnode->instrumented_version->decl);
|
||||
TREE_CHAIN (iname) = DECL_ASSEMBLER_NAME (cnode->decl);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,21 +89,6 @@ lto_cgraph_replace_node (struct cgraph_node *node,
|
|||
}
|
||||
/* Redirect incomming references. */
|
||||
prevailing_node->clone_referring (node);
|
||||
|
||||
/* Fix instrumentation references. */
|
||||
if (node->instrumented_version)
|
||||
{
|
||||
gcc_assert (node->instrumentation_clone
|
||||
== prevailing_node->instrumentation_clone);
|
||||
node->instrumented_version->instrumented_version = prevailing_node;
|
||||
if (!prevailing_node->instrumented_version)
|
||||
prevailing_node->instrumented_version = node->instrumented_version;
|
||||
/* Need to reset node->instrumented_version to NULL,
|
||||
otherwise node removal code would reset
|
||||
node->instrumented_version->instrumented_version. */
|
||||
node->instrumented_version = NULL;
|
||||
}
|
||||
|
||||
lto_free_function_in_decl_state_for_node (node);
|
||||
|
||||
if (node->decl != prevailing_node->decl)
|
||||
|
|
|
@ -1238,12 +1238,6 @@ DEFPARAM (PARAM_UNINIT_CONTROL_DEP_ATTEMPTS,
|
|||
"during uninitialized variable analysis.",
|
||||
1000, 1, 0)
|
||||
|
||||
DEFPARAM (PARAM_CHKP_MAX_CTOR_SIZE,
|
||||
"chkp-max-ctor-size",
|
||||
"Maximum number of statements to be included into a single static "
|
||||
"constructor generated by Pointer Bounds Checker.",
|
||||
5000, 100, 0)
|
||||
|
||||
DEFPARAM (PARAM_FSM_SCALE_PATH_STMTS,
|
||||
"fsm-scale-path-stmts",
|
||||
"Scale factor to apply to the number of statements in a threading path when comparing to the number of (scaled) blocks.",
|
||||
|
|
38
gcc/passes.c
38
gcc/passes.c
|
@ -117,8 +117,6 @@ void
|
|||
pass_manager::execute_early_local_passes ()
|
||||
{
|
||||
execute_pass_list (cfun, pass_build_ssa_passes_1->sub);
|
||||
if (flag_check_pointer_bounds)
|
||||
execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub);
|
||||
execute_pass_list (cfun, pass_local_optimization_passes_1->sub);
|
||||
}
|
||||
|
||||
|
@ -432,36 +430,6 @@ public:
|
|||
|
||||
}; // class pass_build_ssa_passes
|
||||
|
||||
const pass_data pass_data_chkp_instrumentation_passes =
|
||||
{
|
||||
SIMPLE_IPA_PASS, /* type */
|
||||
"chkp_passes", /* name */
|
||||
OPTGROUP_NONE, /* optinfo_flags */
|
||||
TV_NONE, /* tv_id */
|
||||
0, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
0, /* todo_flags_finish */
|
||||
};
|
||||
|
||||
class pass_chkp_instrumentation_passes : public simple_ipa_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_chkp_instrumentation_passes (gcc::context *ctxt)
|
||||
: simple_ipa_opt_pass (pass_data_chkp_instrumentation_passes, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
/* Don't bother doing anything if the program has errors. */
|
||||
return (flag_check_pointer_bounds
|
||||
&& !seen_error () && !in_lto_p);
|
||||
}
|
||||
|
||||
}; // class pass_chkp_instrumentation_passes
|
||||
|
||||
const pass_data pass_data_local_optimization_passes =
|
||||
{
|
||||
SIMPLE_IPA_PASS, /* type */
|
||||
|
@ -499,12 +467,6 @@ make_pass_build_ssa_passes (gcc::context *ctxt)
|
|||
return new pass_build_ssa_passes (ctxt);
|
||||
}
|
||||
|
||||
simple_ipa_opt_pass *
|
||||
make_pass_chkp_instrumentation_passes (gcc::context *ctxt)
|
||||
{
|
||||
return new pass_chkp_instrumentation_passes (ctxt);
|
||||
}
|
||||
|
||||
simple_ipa_opt_pass *
|
||||
make_pass_local_optimization_passes (gcc::context *ctxt)
|
||||
{
|
||||
|
|
|
@ -51,8 +51,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
INSERT_PASSES_AFTER (all_small_ipa_passes)
|
||||
NEXT_PASS (pass_ipa_free_lang_data);
|
||||
NEXT_PASS (pass_ipa_function_and_variable_visibility);
|
||||
NEXT_PASS (pass_ipa_chkp_versioning);
|
||||
NEXT_PASS (pass_ipa_chkp_early_produce_thunks);
|
||||
NEXT_PASS (pass_build_ssa_passes);
|
||||
PUSH_INSERT_PASSES_WITHIN (pass_build_ssa_passes)
|
||||
NEXT_PASS (pass_fixup_cfg);
|
||||
|
@ -64,13 +62,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
NEXT_PASS (pass_rebuild_cgraph_edges);
|
||||
POP_INSERT_PASSES ()
|
||||
|
||||
NEXT_PASS (pass_chkp_instrumentation_passes);
|
||||
PUSH_INSERT_PASSES_WITHIN (pass_chkp_instrumentation_passes)
|
||||
NEXT_PASS (pass_fixup_cfg);
|
||||
NEXT_PASS (pass_chkp);
|
||||
NEXT_PASS (pass_rebuild_cgraph_edges);
|
||||
POP_INSERT_PASSES ()
|
||||
|
||||
NEXT_PASS (pass_local_optimization_passes);
|
||||
PUSH_INSERT_PASSES_WITHIN (pass_local_optimization_passes)
|
||||
NEXT_PASS (pass_fixup_cfg);
|
||||
|
@ -138,7 +129,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
POP_INSERT_PASSES ()
|
||||
|
||||
NEXT_PASS (pass_target_clone);
|
||||
NEXT_PASS (pass_ipa_chkp_produce_thunks);
|
||||
NEXT_PASS (pass_ipa_auto_profile);
|
||||
NEXT_PASS (pass_ipa_tree_profile);
|
||||
PUSH_INSERT_PASSES_WITHIN (pass_ipa_tree_profile)
|
||||
|
@ -211,7 +201,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
NEXT_PASS (pass_merge_phi);
|
||||
NEXT_PASS (pass_thread_jumps);
|
||||
NEXT_PASS (pass_vrp, true /* warn_array_bounds_p */);
|
||||
NEXT_PASS (pass_chkp_opt);
|
||||
NEXT_PASS (pass_dce);
|
||||
NEXT_PASS (pass_stdarg);
|
||||
NEXT_PASS (pass_call_cdce);
|
||||
|
|
302
gcc/rtl-chkp.c
302
gcc/rtl-chkp.c
|
@ -1,302 +0,0 @@
|
|||
/* RTL manipulation functions exported by Pointer Bounds Checker.
|
||||
Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
||||
Contributed by Ilya Enkovich (ilya.enkovich@intel.com)
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "backend.h"
|
||||
#include "target.h"
|
||||
#include "rtl.h"
|
||||
#include "tree.h"
|
||||
#include "memmodel.h"
|
||||
#include "emit-rtl.h"
|
||||
#include "expr.h"
|
||||
#include "rtl-chkp.h"
|
||||
#include "tree-chkp.h"
|
||||
|
||||
static hash_map<tree, rtx> *chkp_rtx_bounds_map;
|
||||
|
||||
/* Get bounds rtx associated with NODE via
|
||||
chkp_set_rtl_bounds call. */
|
||||
rtx
|
||||
chkp_get_rtl_bounds (tree node)
|
||||
{
|
||||
rtx *slot;
|
||||
|
||||
if (!chkp_rtx_bounds_map)
|
||||
return NULL_RTX;
|
||||
|
||||
slot = chkp_rtx_bounds_map->get (node);
|
||||
return slot ? *slot : NULL_RTX;
|
||||
}
|
||||
|
||||
/* Associate bounds rtx VAL with NODE. */
|
||||
void
|
||||
chkp_set_rtl_bounds (tree node, rtx val)
|
||||
{
|
||||
if (!chkp_rtx_bounds_map)
|
||||
chkp_rtx_bounds_map = new hash_map<tree, rtx>;
|
||||
|
||||
chkp_rtx_bounds_map->put (node, val);
|
||||
}
|
||||
|
||||
/* Reset all bounds stored via chkp_set_rtl_bounds. */
|
||||
void
|
||||
chkp_reset_rtl_bounds ()
|
||||
{
|
||||
if (!chkp_rtx_bounds_map)
|
||||
return;
|
||||
|
||||
delete chkp_rtx_bounds_map;
|
||||
chkp_rtx_bounds_map = NULL;
|
||||
}
|
||||
|
||||
/* Split SLOT identifying slot for function value or
|
||||
argument into two parts SLOT_VAL and SLOT_BND.
|
||||
First is the slot for regular value and the other one is
|
||||
for bounds. */
|
||||
void
|
||||
chkp_split_slot (rtx slot, rtx *slot_val, rtx *slot_bnd)
|
||||
{
|
||||
int i;
|
||||
int val_num = 0;
|
||||
int bnd_num = 0;
|
||||
rtx *val_tmps;
|
||||
rtx *bnd_tmps;
|
||||
|
||||
*slot_bnd = 0;
|
||||
|
||||
if (!slot
|
||||
|| GET_CODE (slot) != PARALLEL)
|
||||
{
|
||||
*slot_val = slot;
|
||||
return;
|
||||
}
|
||||
|
||||
val_tmps = XALLOCAVEC (rtx, XVECLEN (slot, 0));
|
||||
bnd_tmps = XALLOCAVEC (rtx, XVECLEN (slot, 0));
|
||||
|
||||
for (i = 0; i < XVECLEN (slot, 0); i++)
|
||||
{
|
||||
rtx elem = XVECEXP (slot, 0, i);
|
||||
rtx reg = GET_CODE (elem) == EXPR_LIST ? XEXP (elem, 0) : elem;
|
||||
|
||||
if (!reg)
|
||||
continue;
|
||||
|
||||
if (POINTER_BOUNDS_MODE_P (GET_MODE (reg)) || CONST_INT_P (reg))
|
||||
bnd_tmps[bnd_num++] = elem;
|
||||
else
|
||||
val_tmps[val_num++] = elem;
|
||||
}
|
||||
|
||||
gcc_assert (val_num);
|
||||
|
||||
if (!bnd_num)
|
||||
{
|
||||
*slot_val = slot;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((GET_CODE (val_tmps[0]) == EXPR_LIST) || (val_num > 1))
|
||||
*slot_val = gen_rtx_PARALLEL (GET_MODE (slot),
|
||||
gen_rtvec_v (val_num, val_tmps));
|
||||
else
|
||||
*slot_val = val_tmps[0];
|
||||
|
||||
if ((GET_CODE (bnd_tmps[0]) == EXPR_LIST) || (bnd_num > 1))
|
||||
*slot_bnd = gen_rtx_PARALLEL (VOIDmode,
|
||||
gen_rtvec_v (bnd_num, bnd_tmps));
|
||||
else
|
||||
*slot_bnd = bnd_tmps[0];
|
||||
}
|
||||
|
||||
/* Join previously splitted to VAL and BND rtx for function
|
||||
value or argument and return it. */
|
||||
rtx
|
||||
chkp_join_splitted_slot (rtx val, rtx bnd)
|
||||
{
|
||||
rtx res;
|
||||
int i, n = 0;
|
||||
|
||||
if (!bnd)
|
||||
return val;
|
||||
|
||||
if (GET_CODE (val) == PARALLEL)
|
||||
n += XVECLEN (val, 0);
|
||||
else
|
||||
n++;
|
||||
|
||||
if (GET_CODE (bnd) == PARALLEL)
|
||||
n += XVECLEN (bnd, 0);
|
||||
else
|
||||
n++;
|
||||
|
||||
res = gen_rtx_PARALLEL (GET_MODE (val), rtvec_alloc (n));
|
||||
|
||||
n = 0;
|
||||
|
||||
if (GET_CODE (val) == PARALLEL)
|
||||
for (i = 0; i < XVECLEN (val, 0); i++)
|
||||
XVECEXP (res, 0, n++) = XVECEXP (val, 0, i);
|
||||
else
|
||||
XVECEXP (res, 0, n++) = val;
|
||||
|
||||
if (GET_CODE (bnd) == PARALLEL)
|
||||
for (i = 0; i < XVECLEN (bnd, 0); i++)
|
||||
XVECEXP (res, 0, n++) = XVECEXP (bnd, 0, i);
|
||||
else
|
||||
XVECEXP (res, 0, n++) = bnd;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* If PAR is PARALLEL holding registers then transform
|
||||
it into PARALLEL holding EXPR_LISTs of those regs
|
||||
and zero constant (similar to how function value
|
||||
on multiple registers looks like). */
|
||||
void
|
||||
chkp_put_regs_to_expr_list (rtx par)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (GET_CODE (par) != PARALLEL
|
||||
|| GET_CODE (XVECEXP (par, 0, 0)) == EXPR_LIST)
|
||||
return;
|
||||
|
||||
for (n = 0; n < XVECLEN (par, 0); n++)
|
||||
XVECEXP (par, 0, n) = gen_rtx_EXPR_LIST (VOIDmode,
|
||||
XVECEXP (par, 0, n),
|
||||
const0_rtx);
|
||||
}
|
||||
|
||||
/* Search rtx PAR describing function return value for an
|
||||
item related to value at offset OFFS and return it.
|
||||
Return NULL if item was not found. */
|
||||
rtx
|
||||
chkp_get_value_with_offs (rtx par, rtx offs)
|
||||
{
|
||||
int n;
|
||||
|
||||
gcc_assert (GET_CODE (par) == PARALLEL);
|
||||
|
||||
for (n = 0; n < XVECLEN (par, 0); n++)
|
||||
{
|
||||
rtx par_offs = XEXP (XVECEXP (par, 0, n), 1);
|
||||
if (INTVAL (offs) == INTVAL (par_offs))
|
||||
return XEXP (XVECEXP (par, 0, n), 0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Emit instructions to store BOUNDS for pointer VALUE
|
||||
stored in MEM.
|
||||
Function is used by expand to pass bounds for args
|
||||
passed on stack. */
|
||||
void
|
||||
chkp_emit_bounds_store (rtx bounds, rtx value, rtx mem)
|
||||
{
|
||||
gcc_assert (MEM_P (mem));
|
||||
|
||||
if (REG_P (bounds) || CONST_INT_P (bounds))
|
||||
{
|
||||
rtx ptr;
|
||||
|
||||
if (REG_P (value))
|
||||
ptr = value;
|
||||
else
|
||||
{
|
||||
rtx slot = adjust_address (value, Pmode, 0);
|
||||
ptr = gen_reg_rtx (Pmode);
|
||||
emit_move_insn (ptr, slot);
|
||||
}
|
||||
|
||||
if (CONST_INT_P (bounds))
|
||||
bounds = targetm.calls.load_bounds_for_arg (value, ptr, bounds);
|
||||
|
||||
targetm.calls.store_bounds_for_arg (ptr, mem,
|
||||
bounds, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
gcc_assert (GET_CODE (bounds) == PARALLEL);
|
||||
gcc_assert (GET_CODE (value) == PARALLEL || MEM_P (value) || REG_P (value));
|
||||
|
||||
for (i = 0; i < XVECLEN (bounds, 0); i++)
|
||||
{
|
||||
rtx reg = XEXP (XVECEXP (bounds, 0, i), 0);
|
||||
rtx offs = XEXP (XVECEXP (bounds, 0, i), 1);
|
||||
rtx slot = adjust_address (mem, Pmode, INTVAL (offs));
|
||||
rtx ptr;
|
||||
|
||||
if (GET_CODE (value) == PARALLEL)
|
||||
ptr = chkp_get_value_with_offs (value, offs);
|
||||
else if (MEM_P (value))
|
||||
{
|
||||
rtx tmp = adjust_address (value, Pmode, INTVAL (offs));
|
||||
ptr = gen_reg_rtx (Pmode);
|
||||
emit_move_insn (ptr, tmp);
|
||||
}
|
||||
else
|
||||
ptr = gen_rtx_SUBREG (Pmode, value, INTVAL (offs));
|
||||
|
||||
targetm.calls.store_bounds_for_arg (ptr, slot, reg, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Emit code to copy bounds for structure VALUE of type TYPE
|
||||
copied to SLOT. */
|
||||
void
|
||||
chkp_copy_bounds_for_stack_parm (rtx slot, rtx value, tree type)
|
||||
{
|
||||
bitmap have_bound;
|
||||
bitmap_iterator bi;
|
||||
unsigned i;
|
||||
rtx tmp = NULL, bnd;
|
||||
|
||||
gcc_assert (TYPE_SIZE (type));
|
||||
gcc_assert (MEM_P (value));
|
||||
gcc_assert (MEM_P (slot));
|
||||
gcc_assert (RECORD_OR_UNION_TYPE_P (type));
|
||||
|
||||
bitmap_obstack_initialize (NULL);
|
||||
have_bound = BITMAP_ALLOC (NULL);
|
||||
chkp_find_bound_slots (type, have_bound);
|
||||
|
||||
EXECUTE_IF_SET_IN_BITMAP (have_bound, 0, i, bi)
|
||||
{
|
||||
rtx ptr = adjust_address (value, Pmode, i * POINTER_SIZE / 8);
|
||||
rtx to = adjust_address (slot, Pmode, i * POINTER_SIZE / 8);
|
||||
|
||||
if (!tmp)
|
||||
tmp = gen_reg_rtx (Pmode);
|
||||
|
||||
emit_move_insn (tmp, ptr);
|
||||
bnd = targetm.calls.load_bounds_for_arg (ptr, tmp, NULL);
|
||||
targetm.calls.store_bounds_for_arg (tmp, to, bnd, NULL);
|
||||
}
|
||||
|
||||
BITMAP_FREE (have_bound);
|
||||
bitmap_obstack_release (NULL);
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/* Declaration of interface functions of Pointer Bounds Checker.
|
||||
Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_RTL_CHKP_H
|
||||
#define GCC_RTL_CHKP_H
|
||||
|
||||
#define DECL_BOUNDS_RTL(NODE) (chkp_get_rtl_bounds (DECL_WRTL_CHECK (NODE)))
|
||||
|
||||
#define SET_DECL_BOUNDS_RTL(NODE, VAL) \
|
||||
(chkp_set_rtl_bounds (DECL_WRTL_CHECK (NODE), VAL))
|
||||
|
||||
extern rtx chkp_get_rtl_bounds (tree node);
|
||||
extern void chkp_set_rtl_bounds (tree node, rtx val);
|
||||
extern void chkp_reset_rtl_bounds ();
|
||||
extern void chkp_split_slot (rtx slot, rtx *slot_val, rtx *slot_bnd);
|
||||
extern rtx chkp_join_splitted_slot (rtx val, rtx bnd);
|
||||
extern rtx chkp_get_value_with_offs (rtx par, rtx offs);
|
||||
extern void chkp_copy_bounds_for_stack_parm (rtx slot, rtx value, tree type);
|
||||
extern void chkp_emit_bounds_store (rtx bounds, rtx value, rtx mem);
|
||||
extern void chkp_put_regs_to_expr_list (rtx par);
|
||||
|
||||
#endif /* GCC_RTL_CHKP_H */
|
|
@ -321,7 +321,6 @@ struct GTY((desc("0"), tag("0"),
|
|||
1 in a VALUE is SP_BASED_VALUE_P in cselib.c.
|
||||
1 in a SUBREG generated by LRA for reload insns.
|
||||
1 in a REG if this is a static chain register.
|
||||
1 in a CALL for calls instrumented by Pointer Bounds Checker.
|
||||
Dumped as "/j" in RTL dumps. */
|
||||
unsigned int jump : 1;
|
||||
/* In a CODE_LABEL, part of the two-bit alternate entry field.
|
||||
|
@ -2515,10 +2514,6 @@ do { \
|
|||
#define LRA_SUBREG_P(RTX) \
|
||||
(RTL_FLAG_CHECK1 ("LRA_SUBREG_P", (RTX), SUBREG)->jump)
|
||||
|
||||
/* True if call is instrumented by Pointer Bounds Checker. */
|
||||
#define CALL_EXPR_WITH_BOUNDS_P(RTX) \
|
||||
(RTL_FLAG_CHECK1 ("CALL_EXPR_WITH_BOUNDS_P", (RTX), CALL)->jump)
|
||||
|
||||
/* Access various components of an ASM_OPERANDS rtx. */
|
||||
|
||||
#define ASM_OPERANDS_TEMPLATE(RTX) XCSTR (RTX, 0, ASM_OPERANDS)
|
||||
|
|
|
@ -2389,11 +2389,6 @@ layout_type (tree type)
|
|||
SET_TYPE_MODE (type, VOIDmode);
|
||||
break;
|
||||
|
||||
case POINTER_BOUNDS_TYPE:
|
||||
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
|
||||
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
|
||||
break;
|
||||
|
||||
case OFFSET_TYPE:
|
||||
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE);
|
||||
TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE_UNITS);
|
||||
|
|
|
@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "attribs.h"
|
||||
#include "builtins.h"
|
||||
|
||||
static const char *ipa_ref_use_name[] = {"read","write","addr","alias","chkp"};
|
||||
static const char *ipa_ref_use_name[] = {"read","write","addr","alias"};
|
||||
|
||||
const char * const ld_plugin_symbol_resolution_names[]=
|
||||
{
|
||||
|
|
110
gcc/target.def
110
gcc/target.def
|
@ -2369,107 +2369,6 @@ built-in function.",
|
|||
(tree exp, rtx target, rtx subtarget, machine_mode mode, int ignore),
|
||||
default_expand_builtin)
|
||||
|
||||
DEFHOOK
|
||||
(builtin_chkp_function,
|
||||
"This hook allows target to redefine built-in functions used by\n\
|
||||
Pointer Bounds Checker for code instrumentation. Hook should return\n\
|
||||
fndecl of function implementing generic builtin whose code is\n\
|
||||
passed in @var{fcode}. Currently following built-in functions are\n\
|
||||
obtained using this hook:\n\
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndmk (const void *@var{lb}, size_t @var{size})\n\
|
||||
Function code - BUILT_IN_CHKP_BNDMK. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to create bound values. @var{lb} holds low\n\
|
||||
bound of the resulting bounds. @var{size} holds size of created bounds.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} void __chkp_bndstx (const void *@var{ptr}, __bounds_type @var{b}, const void **@var{loc})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_BNDSTX}. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to store bounds @var{b} for pointer @var{ptr}\n\
|
||||
when @var{ptr} is stored by address @var{loc}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndldx (const void **@var{loc}, const void *@var{ptr})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_BNDLDX}. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to get bounds of pointer @var{ptr} loaded by\n\
|
||||
address @var{loc}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} void __chkp_bndcl (const void *@var{ptr}, __bounds_type @var{b})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_BNDCL}. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to perform check for pointer @var{ptr} against\n\
|
||||
lower bound of bounds @var{b}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} void __chkp_bndcu (const void *@var{ptr}, __bounds_type @var{b})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_BNDCU}. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to perform check for pointer @var{ptr} against\n\
|
||||
upper bound of bounds @var{b}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_bndret (void *@var{ptr})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_BNDRET}. This built-in function is used\n\
|
||||
by Pointer Bounds Checker to obtain bounds returned by a call statement.\n\
|
||||
@var{ptr} passed to built-in is @code{SSA_NAME} returned by the call.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_intersect (__bounds_type @var{b1}, __bounds_type @var{b2})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_INTERSECT}. This built-in function\n\
|
||||
returns intersection of bounds @var{b1} and @var{b2}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} __bounds_type __chkp_narrow (const void *@var{ptr}, __bounds_type @var{b}, size_t @var{s})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_NARROW}. This built-in function\n\
|
||||
returns intersection of bounds @var{b} and\n\
|
||||
[@var{ptr}, @var{ptr} + @var{s} - @code{1}].\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} size_t __chkp_sizeof (const void *@var{ptr})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_SIZEOF}. This built-in function\n\
|
||||
returns size of object referenced by @var{ptr}. @var{ptr} is always\n\
|
||||
@code{ADDR_EXPR} of @code{VAR_DECL}. This built-in is used by\n\
|
||||
Pointer Bounds Checker when bounds of object cannot be computed statically\n\
|
||||
(e.g. object has incomplete type).\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} const void *__chkp_extract_lower (__bounds_type @var{b})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_EXTRACT_LOWER}. This built-in function\n\
|
||||
returns lower bound of bounds @var{b}.\n\
|
||||
@end deftypefn\n\
|
||||
\n\
|
||||
@deftypefn {Built-in Function} const void *__chkp_extract_upper (__bounds_type @var{b})\n\
|
||||
Function code - @code{BUILT_IN_CHKP_EXTRACT_UPPER}. This built-in function\n\
|
||||
returns upper bound of bounds @var{b}.\n\
|
||||
@end deftypefn",
|
||||
tree, (unsigned fcode),
|
||||
default_builtin_chkp_function)
|
||||
|
||||
DEFHOOK
|
||||
(chkp_bound_type,
|
||||
"Return type to be used for bounds",
|
||||
tree, (void),
|
||||
default_chkp_bound_type)
|
||||
|
||||
DEFHOOK
|
||||
(chkp_bound_mode,
|
||||
"Return mode to be used for bounds.",
|
||||
machine_mode, (void),
|
||||
default_chkp_bound_mode)
|
||||
|
||||
DEFHOOK
|
||||
(chkp_make_bounds_constant,
|
||||
"Return constant used to statically initialize constant bounds\n\
|
||||
with specified lower bound @var{lb} and upper bounds @var{ub}.",
|
||||
tree, (HOST_WIDE_INT lb, HOST_WIDE_INT ub),
|
||||
default_chkp_make_bounds_constant)
|
||||
|
||||
DEFHOOK
|
||||
(chkp_initialize_bounds,
|
||||
"Generate a list of statements @var{stmts} to initialize pointer\n\
|
||||
bounds variable @var{var} with bounds @var{lb} and @var{ub}. Return\n\
|
||||
the number of generated statements.",
|
||||
int, (tree var, tree lb, tree ub, tree *stmts),
|
||||
default_chkp_initialize_bounds)
|
||||
|
||||
/* Select a replacement for a target-specific builtin. This is done
|
||||
*before* regular type checking, and so allows the target to
|
||||
implement a crude form of function overloading. The result is a
|
||||
|
@ -4920,15 +4819,6 @@ aggregate data types, because these are returned in another way. See\n\
|
|||
rtx, (const_tree ret_type, const_tree fn_decl_or_type, bool outgoing),
|
||||
default_function_value)
|
||||
|
||||
/* Return the rtx for bounds of returned pointer. */
|
||||
DEFHOOK
|
||||
(chkp_function_value_bounds,
|
||||
"Define this to return an RTX representing the place where a function\n\
|
||||
returns bounds for returned pointers. Arguments meaning is similar to\n\
|
||||
@code{TARGET_FUNCTION_VALUE}.",
|
||||
rtx, (const_tree ret_type, const_tree fn_decl_or_type, bool outgoing),
|
||||
default_chkp_function_value_bounds)
|
||||
|
||||
/* Return the rtx for the result of a libcall of mode MODE,
|
||||
calling the function FN_NAME. */
|
||||
DEFHOOK
|
||||
|
|
|
@ -2222,53 +2222,6 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
|||
return build_va_arg_indirect_ref (addr);
|
||||
}
|
||||
|
||||
tree
|
||||
default_chkp_bound_type (void)
|
||||
{
|
||||
tree res = make_node (POINTER_BOUNDS_TYPE);
|
||||
TYPE_PRECISION (res) = TYPE_PRECISION (size_type_node) * 2;
|
||||
TYPE_NAME (res) = get_identifier ("__bounds_type");
|
||||
SET_TYPE_MODE (res, targetm.chkp_bound_mode ());
|
||||
layout_type (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
machine_mode
|
||||
default_chkp_bound_mode (void)
|
||||
{
|
||||
return VOIDmode;
|
||||
}
|
||||
|
||||
tree
|
||||
default_builtin_chkp_function (unsigned int fcode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
rtx
|
||||
default_chkp_function_value_bounds (const_tree ret_type ATTRIBUTE_UNUSED,
|
||||
const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
|
||||
bool outgoing ATTRIBUTE_UNUSED)
|
||||
{
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
tree
|
||||
default_chkp_make_bounds_constant (HOST_WIDE_INT lb ATTRIBUTE_UNUSED,
|
||||
HOST_WIDE_INT ub ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
int
|
||||
default_chkp_initialize_bounds (tree var ATTRIBUTE_UNUSED,
|
||||
tree lb ATTRIBUTE_UNUSED,
|
||||
tree ub ATTRIBUTE_UNUSED,
|
||||
tree *stmts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
|
||||
machine_mode mode ATTRIBUTE_UNUSED,
|
||||
|
|
|
@ -266,13 +266,6 @@ extern rtx default_load_bounds_for_arg (rtx, rtx, rtx);
|
|||
extern void default_store_bounds_for_arg (rtx, rtx, rtx, rtx);
|
||||
extern rtx default_load_returned_bounds (rtx);
|
||||
extern void default_store_returned_bounds (rtx,rtx);
|
||||
extern tree default_chkp_bound_type (void);
|
||||
extern machine_mode default_chkp_bound_mode (void);
|
||||
extern tree default_builtin_chkp_function (unsigned int);
|
||||
extern rtx default_chkp_function_value_bounds (const_tree, const_tree, bool);
|
||||
extern tree default_chkp_make_bounds_constant (HOST_WIDE_INT lb, HOST_WIDE_INT ub);
|
||||
extern int default_chkp_initialize_bounds (tree var, tree lb, tree ub,
|
||||
tree *stmts);
|
||||
extern void default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
|
||||
machine_mode mode ATTRIBUTE_UNUSED,
|
||||
tree type ATTRIBUTE_UNUSED,
|
||||
|
|
|
@ -1,3 +1,394 @@
|
|||
2018-06-08 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* g++.dg/dg.exp: Do not use mpx.exp.
|
||||
* g++.dg/lto/lto.exp: Likewise.
|
||||
* g++.dg/lto/pr69729_0.C: Remove.
|
||||
* g++.dg/opt/pr71529.C: Remove.
|
||||
* g++.dg/pr63995-1.C: Remove.
|
||||
* g++.dg/pr68270.C: Remove.
|
||||
* g++.dg/pr71624.C: Remove.
|
||||
* g++.dg/pr71633.C: Remove.
|
||||
* g++.dg/pr79761.C: Remove.
|
||||
* g++.dg/pr79764.C: Remove.
|
||||
* g++.dg/pr79769.C: Remove.
|
||||
* gcc.dg/lto/chkp-privatize-1_0.c: Remove.
|
||||
* gcc.dg/lto/chkp-privatize-2_0.c: Remove.
|
||||
* gcc.dg/lto/chkp-privatize_0.c: Remove.
|
||||
* gcc.dg/lto/chkp-removed-alias_0.c: Remove.
|
||||
* gcc.dg/lto/chkp-static-bounds_0.c: Remove.
|
||||
* gcc.dg/lto/chkp-wrap-asm-name_0.c: Remove.
|
||||
* gcc.dg/lto/lto.exp: Do not use mpx.exp.
|
||||
* gcc.dg/lto/pr66221_0.c: Remove.
|
||||
* gcc.target/i386/chkp-always_inline.c: Remove.
|
||||
* gcc.target/i386/chkp-bndret.c: Remove.
|
||||
* gcc.target/i386/chkp-builtins-1.c: Remove.
|
||||
* gcc.target/i386/chkp-builtins-2.c: Remove.
|
||||
* gcc.target/i386/chkp-builtins-3.c: Remove.
|
||||
* gcc.target/i386/chkp-builtins-4.c: Remove.
|
||||
* gcc.target/i386/chkp-const-check-1.c: Remove.
|
||||
* gcc.target/i386/chkp-const-check-2.c: Remove.
|
||||
* gcc.target/i386/chkp-hidden-def.c: Remove.
|
||||
* gcc.target/i386/chkp-label-address.c: Remove.
|
||||
* gcc.target/i386/chkp-lifetime-1.c: Remove.
|
||||
* gcc.target/i386/chkp-narrow-bounds.c: Remove.
|
||||
* gcc.target/i386/chkp-pr69044.c: Remove.
|
||||
* gcc.target/i386/chkp-remove-bndint-1.c: Remove.
|
||||
* gcc.target/i386/chkp-remove-bndint-2.c: Remove.
|
||||
* gcc.target/i386/chkp-strchr.c: Remove.
|
||||
* gcc.target/i386/chkp-strlen-1.c: Remove.
|
||||
* gcc.target/i386/chkp-strlen-2.c: Remove.
|
||||
* gcc.target/i386/chkp-strlen-3.c: Remove.
|
||||
* gcc.target/i386/chkp-strlen-4.c: Remove.
|
||||
* gcc.target/i386/chkp-strlen-5.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-1.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-10.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-11.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-12.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-13.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-14.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-15.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-16.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-17.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-2.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-3.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-4.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-5.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-6.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-7.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-8.c: Remove.
|
||||
* gcc.target/i386/chkp-stropt-9.c: Remove.
|
||||
* gcc.target/i386/i386.exp: Do not use mpx.exp.
|
||||
* gcc.target/i386/indirect-thunk-11.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-12.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-attr-12.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-attr-13.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-bnd-1.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-bnd-2.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-bnd-3.c: Remove.
|
||||
* gcc.target/i386/indirect-thunk-bnd-4.c: Remove.
|
||||
* gcc.target/i386/interrupt-bnd-err-1.c: Remove.
|
||||
* gcc.target/i386/interrupt-bnd-err-2.c: Remove.
|
||||
* gcc.target/i386/mpx/alloca-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/alloca-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/alloca-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/arg-addr-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/arg-addr-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/arg-addr-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/bitfields-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/bitfields-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/bitfields-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-bounds-2.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-lbounds-2.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-chk-ptr-ubounds-2.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-copy-ptr-bounds-3.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-get-ptr-lbound-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-get-ptr-lbound-2.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-get-ptr-ubound-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-get-ptr-ubound-2.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-3.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-narrow-ptr-bounds-4.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-null-ptr-bounds-1-bbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-1.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-3.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/builtin-bnd-store-ptr-bounds-2.c: Remove.
|
||||
* gcc.target/i386/mpx/calloc-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/calloc-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/calloc-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/chkp-fix-calls-1.c: Remove.
|
||||
* gcc.target/i386/mpx/chkp-fix-calls-2.c: Remove.
|
||||
* gcc.target/i386/mpx/chkp-fix-calls-3.c: Remove.
|
||||
* gcc.target/i386/mpx/chkp-fix-calls-4.c: Remove.
|
||||
* gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: Remove.
|
||||
* gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: Remove.
|
||||
* gcc.target/i386/mpx/chkp-thunk-comdat-3.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/fastcall-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-10-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-10-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-10-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-6-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-6-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-6-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-7-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-7-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-7-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-8-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-8-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-8-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-9-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-9-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/field-addr-9-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/frame-address-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/hard-reg-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/hard-reg-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/hard-reg-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/hard-reg-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/if-stmt-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/label-address-1.c: Remove.
|
||||
* gcc.target/i386/mpx/legacy-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/macro.c: Remove.
|
||||
* gcc.target/i386/mpx/malloc-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/malloc-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/malloc-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/memcpy-1.c: Remove.
|
||||
* gcc.target/i386/mpx/memmove-1.c: Remove.
|
||||
* gcc.target/i386/mpx/memmove-2.c: Remove.
|
||||
* gcc.target/i386/mpx/memmove-zero-length.c: Remove.
|
||||
* gcc.target/i386/mpx/mpx-check.h: Remove.
|
||||
* gcc.target/i386/mpx/mpx-os-support.h: Remove.
|
||||
* gcc.target/i386/mpx/mpx.exp: Remove.
|
||||
* gcc.target/i386/mpx/nested-function-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/nested-function-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/nested-function-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-arg-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-diff-1.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-store-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-store-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/pointer-store-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/pr65508.c: Remove.
|
||||
* gcc.target/i386/mpx/pr65531.cc: Remove.
|
||||
* gcc.target/i386/mpx/pr66048.cc: Remove.
|
||||
* gcc.target/i386/mpx/pr66134.c: Remove.
|
||||
* gcc.target/i386/mpx/pr66566.c: Remove.
|
||||
* gcc.target/i386/mpx/pr66567.c: Remove.
|
||||
* gcc.target/i386/mpx/pr66568.c: Remove.
|
||||
* gcc.target/i386/mpx/pr66569.c: Remove.
|
||||
* gcc.target/i386/mpx/pr66581.c: Remove.
|
||||
* gcc.target/i386/mpx/pr68337-1.c: Remove.
|
||||
* gcc.target/i386/mpx/pr68337-2.c: Remove.
|
||||
* gcc.target/i386/mpx/pr68416.c: Remove.
|
||||
* gcc.target/i386/mpx/pr78339.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79631.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79633.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79753.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79770.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79987.c: Remove.
|
||||
* gcc.target/i386/mpx/pr79988.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/realloc-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/reference-1-lbv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-1-nov.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-1-ubv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-2-lbv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-2-nov.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-2-ubv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-3-lbv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-3-nov.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-3-ubv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-4-lbv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-4-nov.cpp: Remove.
|
||||
* gcc.target/i386/mpx/reference-4-ubv.cpp: Remove.
|
||||
* gcc.target/i386/mpx/return-pointer-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-pointer-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-pointer-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-6-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-6-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/return-struct-6-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/sincos-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-array-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-array-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-array-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-6-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-6-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-init-6-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-string-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/static-string-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/static-string-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-10-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-10-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-10-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-6-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-6-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-6-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-7-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-7-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-7-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-8-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-8-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-8-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-9-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-9-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-arg-9-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/struct-copy-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/thread-local-var-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/thread-local-var-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/thread-local-var-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/union-arg-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/union-arg-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/union-arg-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/va-arg-pack-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-3-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-3-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-3-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-4-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-4-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-4-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-5-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-5-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-5-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-6-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-6-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-6-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-7-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-7-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-7-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-8-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-8-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vararg-8-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-1-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-2-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-2-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-2-ubv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-trailing-1-lbv.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-trailing-1-nov.c: Remove.
|
||||
* gcc.target/i386/mpx/vla-trailing-1-ubv.c: Remove.
|
||||
* gcc.target/i386/pr63995-2.c: Remove.
|
||||
* gcc.target/i386/pr64805.c: Remove.
|
||||
* gcc.target/i386/pr65044.c: Remove.
|
||||
* gcc.target/i386/pr65167.c: Remove.
|
||||
* gcc.target/i386/pr65183.c: Remove.
|
||||
* gcc.target/i386/pr65184.c: Remove.
|
||||
* gcc.target/i386/pr65523.c: Remove.
|
||||
* gcc.target/i386/pr70876.c: Remove.
|
||||
* gcc.target/i386/pr70877.c: Remove.
|
||||
* gcc.target/i386/pr71458.c: Remove.
|
||||
* gcc.target/i386/pr80880.c: Remove.
|
||||
* gcc.target/i386/ret-thunk-25.c: Remove.
|
||||
* gcc.target/i386/thunk-retbnd.c: Remove.
|
||||
* lib/mpx-dg.exp: Remove.
|
||||
* gcc.target/i386/funcspec-56.inc: Adjust test case.
|
||||
|
||||
2018-06-07 Carl Love <cel@us.ibm.com>
|
||||
|
||||
* gcc.target/powerpc/builtins-3-p9-runnable.c: Add debug print
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
# Load support procs.
|
||||
load_lib g++-dg.exp
|
||||
load_lib mpx-dg.exp
|
||||
|
||||
# If a testcase doesn't have special options, use these.
|
||||
global DEFAULT_CXXFLAGS
|
||||
|
|
|
@ -31,7 +31,6 @@ if $tracelevel then {
|
|||
load_lib standard.exp
|
||||
load_lib g++.exp
|
||||
load_lib target-libpath.exp
|
||||
load_lib mpx-dg.exp
|
||||
|
||||
# Load the language-independent compabibility support procedures.
|
||||
load_lib lto.exp
|
||||
|
@ -43,7 +42,6 @@ if { ![check_effective_target_lto] } {
|
|||
|
||||
g++_init
|
||||
lto_init no-mathlib
|
||||
mpx_init
|
||||
|
||||
# Define an identifier for use with this suite to avoid name conflicts
|
||||
# with other lto tests running at the same time.
|
||||
|
@ -59,5 +57,4 @@ foreach src [lsort [find $srcdir/$subdir *_0.\[cC\]]] {
|
|||
lto-execute $src $sid
|
||||
}
|
||||
|
||||
mpx_finish
|
||||
lto_finish
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options {{-fcheck-pointer-bounds -mmpx -flto -flto-partition=max}} } */
|
||||
|
||||
class cl1
|
||||
{
|
||||
public:
|
||||
virtual ~cl1 () { };
|
||||
};
|
||||
|
||||
class cl2
|
||||
{
|
||||
public:
|
||||
virtual ~cl2 () { };
|
||||
};
|
||||
|
||||
class cl3 : cl1, cl2
|
||||
{
|
||||
};
|
||||
|
||||
class cl4 : cl3
|
||||
{
|
||||
public:
|
||||
~cl4 ();
|
||||
};
|
||||
|
||||
cl4::~cl4 ()
|
||||
{
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
cl4 c;
|
||||
return 0;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// PR middle-end/71529
|
||||
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } }
|
||||
// { dg-options "-fcheck-pointer-bounds -mmpx -O2" }
|
||||
|
||||
class c1
|
||||
{
|
||||
public:
|
||||
virtual ~c1 ();
|
||||
};
|
||||
|
||||
class c2
|
||||
{
|
||||
public:
|
||||
virtual ~c2 ();
|
||||
};
|
||||
|
||||
class c3 : c1, c2 { };
|
||||
|
||||
int main (int, char **)
|
||||
{
|
||||
c3 obj;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-O2 -g -fcheck-pointer-bounds -mmpx" } */
|
||||
|
||||
int test1 (int i)
|
||||
{
|
||||
extern const int arr[10];
|
||||
return arr[i];
|
||||
}
|
||||
|
||||
extern const int arr[10];
|
||||
|
||||
int test2 (int i)
|
||||
{
|
||||
return arr[i];
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
/* PR71633 */
|
||||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-Werror=chkp -mmpx -fcheck-pointer-bounds -O1 -fchkp-flexible-struct-trailing-arrays" } */
|
||||
|
||||
struct a
|
||||
{
|
||||
struct
|
||||
{
|
||||
int e[1];
|
||||
} f;
|
||||
};
|
||||
|
||||
int g(a *ptr)
|
||||
{
|
||||
return ptr->f.e[1];
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/* PR71624 */
|
||||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
|
||||
|
||||
class c1
|
||||
{
|
||||
public:
|
||||
virtual int fn1 () const;
|
||||
int fn2 (const int *) const;
|
||||
};
|
||||
|
||||
class c2
|
||||
{
|
||||
int fn1 ();
|
||||
c1 obj;
|
||||
};
|
||||
|
||||
int
|
||||
c1::fn1 () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
c1::fn2 (const int *) const
|
||||
{
|
||||
return this->fn1 ();
|
||||
}
|
||||
|
||||
int
|
||||
c2::fn1 ()
|
||||
{
|
||||
return obj.fn2 (0);
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/* PR71633 */
|
||||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
|
||||
|
||||
class c1
|
||||
{
|
||||
virtual void fn1 ();
|
||||
};
|
||||
|
||||
class c2
|
||||
{
|
||||
virtual int *fn2 () const;
|
||||
};
|
||||
|
||||
class c3 : c1, c2
|
||||
{
|
||||
int *fn2 () const;
|
||||
int *fn3 (int) const;
|
||||
};
|
||||
|
||||
int *c3::fn2 () const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int *c3::fn3 (int p) const
|
||||
{
|
||||
return fn3 (p);
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
|
||||
|
||||
struct Foo
|
||||
{
|
||||
Foo() : a(1), b(1), c('a') {}
|
||||
int a;
|
||||
int b;
|
||||
char c;
|
||||
};
|
||||
|
||||
static Foo copy_foo(Foo) __attribute__((noinline, noclone));
|
||||
|
||||
static Foo copy_foo(Foo A)
|
||||
{
|
||||
return A;
|
||||
}
|
||||
|
||||
struct Bar : Foo
|
||||
{
|
||||
Bar(Foo t) : Foo(copy_foo(t)) {}
|
||||
};
|
||||
|
||||
Foo F;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
Bar B (F);
|
||||
|
||||
if (B.a != 1 || B.b != 1 || B.c != 'a')
|
||||
__builtin_abort ();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
|
||||
|
||||
typedef float __m256 __attribute__ (( __vector_size__(32), __may_alias__ ));
|
||||
struct A {
|
||||
__m256 ymm;
|
||||
const float &f() const;
|
||||
};
|
||||
|
||||
const float &A::f() const {
|
||||
return ymm[1];
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
|
||||
|
||||
void a (_Complex) { a (3); }
|
|
@ -1,17 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -Ofast -flto -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
extern int __attribute__((noinline)) f1 (int i);
|
||||
|
||||
static int __attribute__((noinline))
|
||||
f2 (int i)
|
||||
{
|
||||
return i + 6;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return f1 (argc) + f2 (argc);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -Ofast -flto -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
static int
|
||||
__attribute__ ((noinline))
|
||||
func1 (int i)
|
||||
{
|
||||
return i + 2;
|
||||
}
|
||||
|
||||
extern int func2 (int i);
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return func1 (argc) + func2 (argc) + 1;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -fPIC -flto -flto-partition=max -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
static int
|
||||
__attribute__ ((noinline))
|
||||
func1 (int i)
|
||||
{
|
||||
return i + 2;
|
||||
}
|
||||
|
||||
extern int func2 (int i);
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return func1 (argc) + func2 (argc) + 1;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -O2 -flto -flto-partition=max -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
int test1 (const char *c)
|
||||
{
|
||||
return c[0] * 2;
|
||||
}
|
||||
|
||||
int test2 (const char *c)
|
||||
{
|
||||
return c[1] * 3;
|
||||
}
|
||||
|
||||
int test1_alias (const char *c) __attribute__ ((alias ("test1")));
|
||||
int test2_alias (const char *c) __attribute__ ((alias ("test2")));
|
||||
|
||||
struct S
|
||||
{
|
||||
int (*fnptr[2]) (const char *);
|
||||
} S;
|
||||
|
||||
struct S s = {test1_alias, test2_alias};
|
||||
|
||||
int main (int argc, const char **argv)
|
||||
{
|
||||
return s.fnptr[argc] (argv[0]);
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -flto -flto-partition=max -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
const char *cc;
|
||||
|
||||
int test1 (const char *c)
|
||||
{
|
||||
c = __builtin___bnd_init_ptr_bounds (c);
|
||||
cc = c;
|
||||
return c[0] * 2;
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
int (*fnptr) (const char *);
|
||||
} S;
|
||||
|
||||
struct S s1 = {test1};
|
||||
struct S s2 = {test1};
|
||||
struct S s3 = {test1};
|
||||
|
||||
int main (int argc, const char **argv)
|
||||
{
|
||||
return s1.fnptr (argv[0]) + s2.fnptr (argv[1]);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -O2 -flto -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
typedef long unsigned int size_t;
|
||||
|
||||
extern size_t strlen (const char *);
|
||||
extern __typeof (strlen) strlen __asm__ ("" "__hidden_strlen") __attribute__ ((visibility ("hidden")));
|
||||
|
||||
size_t
|
||||
test1 (const char *p) { return strlen (p); }
|
||||
|
||||
size_t
|
||||
test2 (const char *p) { return __builtin_strlen (p); }
|
||||
|
||||
int
|
||||
main (int argc, const char **argv)
|
||||
{
|
||||
return test1 (argv[0]) - test2 (argv[0]);
|
||||
}
|
|
@ -30,7 +30,6 @@ if $tracelevel then {
|
|||
# Load procedures from common libraries.
|
||||
load_lib standard.exp
|
||||
load_lib gcc.exp
|
||||
load_lib mpx-dg.exp
|
||||
|
||||
# Load the language-independent compabibility support procedures.
|
||||
load_lib lto.exp
|
||||
|
@ -42,7 +41,6 @@ if { ![check_effective_target_lto] } {
|
|||
|
||||
gcc_init
|
||||
lto_init no-mathlib
|
||||
mpx_init
|
||||
|
||||
# Define an identifier for use with this suite to avoid name conflicts
|
||||
# with other lto tests running at the same time.
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-require-effective-target mpx } */
|
||||
/* { dg-lto-options { { -O2 -flto -fcheck-pointer-bounds -mmpx } } } */
|
||||
|
||||
int test1 (const char *);
|
||||
|
||||
int main (int argc, const char **argv)
|
||||
{
|
||||
return test1 (argv[0]);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/* { dg-do compile { target { ! x32 } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -Wno-attributes" } */
|
||||
|
||||
static __attribute__((always_inline)) int f1 (int *p)
|
||||
{
|
||||
return *p;
|
||||
}
|
||||
|
||||
__attribute__((bnd_legacy)) int f2 (int *p)
|
||||
{
|
||||
return f1 (p);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/* { dg-do compile { target { ! x32 } } } */
|
||||
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkp" } */
|
||||
/* { dg-final { scan-tree-dump-not "bndret" "chkp" } } */
|
||||
|
||||
#include "string.h"
|
||||
|
||||
extern int *test1 (int *p) __attribute__((bnd_legacy));
|
||||
|
||||
int *
|
||||
test2 (int *p)
|
||||
{
|
||||
return test1 (p);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue