summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
AgeCommit message (Collapse)Author
2020-08-12ipa: fix bit CPP when combined with IPA bit CPMartin Liska
As mentioned in the PR, let's consider the following example: int __attribute__((noinline)) foo(int arg) { if (arg == 3) return 1; if (arg == 4) return 123; __builtin_unreachable (); } during WPA we find all calls of the function (yes the call with value 5 is UBSAN): Node: foo/0: param [0]: 5 [loc_time: 4, loc_size: 2, prop_time: 0, prop_size: 0] 3 [loc_time: 3, loc_size: 3, prop_time: 0, prop_size: 0] ctxs: VARIABLE Bits: value = 0x5, mask = 0x6 in LTRANS we have the following VRP info: # RANGE [3, 3] NONZERO 3 when we AND masks in get_default_value we end up with 6 & 3 = 2 (0x010). That means the only second (least significant bit) is unknown and value (5 = 0x101) & ~mask gives us either 7 (0x111) or 5 (0x101). That's why if (arg_2(D) == 3) gets optimized to false. gcc/ChangeLog: PR ipa/96482 * ipa-cp.c (ipcp_bits_lattice::meet_with_1): Drop value bits for bits that are unknown. (ipcp_bits_lattice::set_to_constant): Likewise. * tree-ssa-ccp.c (get_default_value): Add sanity check that IPA CP bit info has all bits set to zero in bits that are unknown. gcc/testsuite/ChangeLog: PR ipa/96482 * gcc.dg/ipa/pr96482.c: New test.
2020-06-29Use gsi_bb instead of iterator->bb.Martin Liska
gcc/ChangeLog: * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Use gsi_bb instead of gimple_stmt_iterator::bb. * tree-ssa-math-opts.c (insert_reciprocals): Likewise. * tree-vectorizer.h: Likewise.
2020-06-28Underline argument in -Wnonnull and in C++ extend warning to the this ↵Martin Sebor
pointer [PR c++/86568]. Resolves: PR c++/86568 - -Wnonnull warnings should highlight the relevant argument not the closing parenthesis gcc/c-family/ChangeLog: PR c++/86568 * c-common.c (struct nonnull_arg_ctx): Add members. (check_function_nonnull): Use nonnull_arg_ctx as argument. Handle C++ member functions specially. Consider the this pointer implicitly nonnull. (check_nonnull_arg): Use location of argument when available. (check_function_arguments): Use nonnull_arg_ctx as argument. gcc/ChangeLog: PR c++/86568 * calls.c (maybe_warn_rdwr_sizes): Use location of argument if available. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Same. Adjust indentation. * tree.c (get_nonnull_args): Consider the this pointer implicitly nonnull. * var-tracking.c (deps_vec): New type. (var_loc_dep_vec): New function. (VAR_LOC_DEP_VEC): Use it. gcc/testsuite/ChangeLog: PR c++/86568 * g++.dg/warn/Wnonnull5.C: New test. * c-c++-common/pr28656.c: Adjust text of expected warning. * c-c++-common/pr66208.c: Same. * g++.dg/cpp0x/nullptr22.C: Same. * g++.dg/ext/attr-nonnull.C: Same. * g++.dg/ext/attrib49.C: Same. * g++.dg/pr71973-2.C: Same. * g++.dg/warn/Wnonnull3.C: Same. * g++.dg/warn/Wnonnull4.C: Same. * obj-c++.dg/attributes/method-nonnull-1.mm: Same. * objc.dg/attributes/method-nonnull-1.m: Same.
2020-06-10Merge evrp uses of substitute_and_fold_engine into the engine itself.Aldy Hernandez
This patch merges the evrp uses of the substitute and fold engine into the engine itself, at least the parts that can be re-used by other engine uses. It also adds a context parameter to get_value() for further use. gcc/ * gimple-loop-versioning.cc (loop_versioning::name_prop::get_value): Add stmt parameter. * gimple-ssa-evrp.c (class evrp_folder): New. (class evrp_dom_walker): Remove. (execute_early_vrp): Use evrp_folder instead of evrp_dom_walker. * tree-ssa-ccp.c (ccp_folder::get_value): Add stmt parameter. * tree-ssa-copy.c (copy_folder::get_value): Same. * tree-ssa-propagate.c (substitute_and_fold_engine::replace_uses_in): Pass stmt to get_value. (substitute_and_fold_engine::replace_phi_args_in): Same. (substitute_and_fold_dom_walker::after_dom_children): Call post_fold_bb. (substitute_and_fold_dom_walker::foreach_new_stmt_in_bb): New. (substitute_and_fold_dom_walker::propagate_into_phi_args): New. (substitute_and_fold_dom_walker::before_dom_children): Adjust to call virtual functions for folding, pre_folding, and post folding. Call get_value with PHI. Tweak dump. * tree-ssa-propagate.h (class substitute_and_fold_engine): New argument to get_value. New virtual function pre_fold_bb. New virtual function post_fold_bb. New virtual function pre_fold_stmt. New virtual function post_new_stmt. New function propagate_into_phi_args. * tree-vrp.c (vrp_folder::get_value): Add stmt argument. * vr-values.c (vr_values::extract_range_from_stmt): Adjust dump output. (vr_values::fold_cond): New. (vr_values::simplify_cond_using_ranges_1): Call fold_cond. * vr-values.h (class vr_values): Add simplify_cond_using_ranges_when_edge_is_known. gcc/testsuite/ * gcc.dg/tree-ssa/ssa-dse-30.c: Adjust test for folding of memmove happening later.
2020-05-28Add support for __builtin_bswap128Eric Botcazou
This patch introduces a new builtin named __builtin_bswap128 on targets where TImode is supported, i.e. 64-bit targets only in practice. The implementation simply reuses the existing double word path in optab, so no routine is added to libgcc (which means that you get two calls to _bswapdi2 in the worst case). gcc/ChangeLog: * builtin-types.def (BT_UINT128): New primitive type. (BT_FN_UINT128_UINT128): New function type. * builtins.def (BUILT_IN_BSWAP128): New GCC builtin. * doc/extend.texi (__builtin_bswap128): Document it. * builtins.c (expand_builtin): Deal with BUILT_IN_BSWAP128. (is_inexpensive_builtin): Likewise. * fold-const-call.c (fold_const_call_ss): Likewise. * fold-const.c (tree_call_nonnegative_warnv_p): Likewise. * tree-ssa-ccp.c (evaluate_stmt): Likewise. * tree-vect-stmts.c (vect_get_data_ptr_increment): Likewise. (vectorizable_call): Likewise. * optabs.c (expand_unop): Always use the double word path for it. * tree-core.h (enum tree_index): Add TI_UINT128_TYPE. * tree.h (uint128_type_node): New global type. * tree.c (build_common_tree_nodes): Build it if TImode is supported. gcc/testsuite/ChangeLog: * gcc.dg/builtin-bswap-10.c: New test. * gcc.dg/builtin-bswap-11.c: Likewise. * gcc.dg/builtin-bswap-12.c: Likewise. * gcc.target/i386/builtin-bswap-5.c: Likewise.
2020-01-07re PR tree-optimization/93156 (abused nonnull attribute evokes new segfault ↵Jakub Jelinek
in gcc 10 since Nov 4 commit, 0fb958ab8aa) PR tree-optimization/93156 * tree-ssa-ccp.c (bit_value_binop): For x * x note that the second least significant bit is always clear. * gcc.dg/tree-ssa/pr93156.c: New test. From-SVN: r279951
2020-01-01Update copyright years.Jakub Jelinek
From-SVN: r279813
2019-12-18ipa-param-manipulation.h (get_original_index): Declare.Jan Hubicka
* ipa-param-manipulation.h (get_original_index): Declare. * ipa-param-manipulation.c (ipa_param_adjustments::get_original_index): New member function. * ipa-prop.c (ipcp_get_parm_bits): New function. * ipa-prop.h (ipcp_get_parm_bits): Declare. * tree-ssa-ccp.c: Include cgraph.h, alloc-pool.h, symbol-summary.h, ipa-utils.h and ipa-prop.h (get_default_value): Use ipcp_get_parm_bits. * gcc.dg/ipa/ipa-bit-cp.c: New testcase. * gcc.dg/ipa/ipa-bit-cp-1.c: New testcase. * gcc.dg/ipa/ipa-bit-cp-2.c: New testcase. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r279523
2019-11-20re PR c/90898 (ICE in insert_clobber_before_stack_restore, at ↵Jakub Jelinek
tree-ssa-ccp.c:2112) PR c/90898 * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove assertion. (insert_clobbers_for_var): Fix a typo in function comment. * gcc.dg/pr90898.c: New test. From-SVN: r278481
2019-11-12Remove gcc/params.* files.Martin Liska
2019-11-12 Martin Liska <mliska@suse.cz> * Makefile.in: Remove PARAMS_H and params.list and params.options. * params-enum.h: Remove. * params-list.h: Remove. * params-options.h: Remove. * params.c: Remove. * params.def: Remove. * params.h: Remove. * asan.c: Do not include params.h. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfgloopanal.c: Likewise. * cgraph.c: Likewise. * combine.c: Likewise. * common/config/aarch64/aarch64-common.c: Likewise. * common/config/gcn/gcn-common.c: Likewise. * common/config/ia64/ia64-common.c: Likewise. * common/config/powerpcspe/powerpcspe-common.c: Likewise. * common/config/rs6000/rs6000-common.c: Likewise. * common/config/sh/sh-common.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/csky/csky.c: Likewise. * config/i386/i386-builtins.c: Likewise. * config/i386/i386-expand.c: Likewise. * config/i386/i386-features.c: Likewise. * config/i386/i386-options.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000-logue.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sparc/sparc.c: Likewise. * config/visium/visium.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dse.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * gimple-loop-interchange.cc: Likewise. * gimple-loop-jam.c: Likewise. * gimple-loop-versioning.cc: Likewise. * gimple-ssa-split-paths.c: Likewise. * gimple-ssa-sprintf.c: Likewise. * gimple-ssa-store-merging.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-ssa-warn-alloca.c: Likewise. * gimple-ssa-warn-restrict.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hsa-gen.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-sra.c: Likewise. * ira-build.c: Likewise. * ira-conflicts.c: Likewise. * loop-doloop.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lra-assigns.c: Likewise. * lra-constraints.c: Likewise. * modulo-sched.c: Likewise. * opt-suggestions.c: Likewise. * opts.c: Likewise. * postreload-gcse.c: Likewise. * predict.c: Likewise. * reload.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * shrink-wrap.c: Likewise. * stmt.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadbackward.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * gimple-parser.c: Do not include params.h. 2019-11-12 Martin Liska <mliska@suse.cz> * name-lookup.c: Do not include params.h. * typeck.c: Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * lto-common.c: Do not include params.h. * lto-partition.c: Likewise. * lto.c: Likewise. From-SVN: r278086
2019-11-12Apply mechanical replacement (generated patch).Martin Liska
2019-11-12 Martin Liska <mliska@suse.cz> * asan.c (asan_sanitize_stack_p): Replace old parameter syntax with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET macro. (asan_sanitize_allocas_p): Likewise. (asan_emit_stack_protection): Likewise. (asan_protect_global): Likewise. (instrument_derefs): Likewise. (instrument_builtin_call): Likewise. (asan_expand_mark_ifn): Likewise. * auto-profile.c (auto_profile): Likewise. * bb-reorder.c (copy_bb_p): Likewise. (duplicate_computed_gotos): Likewise. * builtins.c (inline_expand_builtin_string_cmp): Likewise. * cfgcleanup.c (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. * cfgexpand.c (defer_stack_allocation): Likewise. (stack_protect_classify_type): Likewise. (pass_expand::execute): Likewise. * cfgloopanal.c (expected_loop_iterations_unbounded): Likewise. (estimate_reg_pressure_cost): Likewise. * cgraph.c (cgraph_edge::maybe_hot_p): Likewise. * combine.c (combine_instructions): Likewise. (record_value_for_reg): Likewise. * common/config/aarch64/aarch64-common.c (aarch64_option_validate_param): Likewise. (aarch64_option_default_params): Likewise. * common/config/ia64/ia64-common.c (ia64_option_default_params): Likewise. * common/config/powerpcspe/powerpcspe-common.c (rs6000_option_default_params): Likewise. * common/config/rs6000/rs6000-common.c (rs6000_option_default_params): Likewise. * common/config/sh/sh-common.c (sh_option_default_params): Likewise. * config/aarch64/aarch64.c (aarch64_output_probe_stack_range): Likewise. (aarch64_allocate_and_probe_stack_space): Likewise. (aarch64_expand_epilogue): Likewise. (aarch64_override_options_internal): Likewise. * config/alpha/alpha.c (alpha_option_override): Likewise. * config/arm/arm.c (arm_option_override): Likewise. (arm_valid_target_attribute_p): Likewise. * config/i386/i386-options.c (ix86_option_override_internal): Likewise. * config/i386/i386.c (get_probe_interval): Likewise. (ix86_adjust_stack_and_probe_stack_clash): Likewise. (ix86_max_noce_ifcvt_seq_cost): Likewise. * config/ia64/ia64.c (ia64_adjust_cost): Likewise. * config/rs6000/rs6000-logue.c (get_stack_clash_protection_probe_interval): Likewise. (get_stack_clash_protection_guard_size): Likewise. * config/rs6000/rs6000.c (rs6000_option_override_internal): Likewise. * config/s390/s390.c (allocate_stack_space): Likewise. (s390_emit_prologue): Likewise. (s390_option_override_internal): Likewise. * config/sparc/sparc.c (sparc_option_override): Likewise. * config/visium/visium.c (visium_option_override): Likewise. * coverage.c (get_coverage_counts): Likewise. (coverage_compute_profile_id): Likewise. (coverage_begin_function): Likewise. (coverage_end_function): Likewise. * cse.c (cse_find_path): Likewise. (cse_extended_basic_block): Likewise. (cse_main): Likewise. * cselib.c (cselib_invalidate_mem): Likewise. * dse.c (dse_step1): Likewise. * emit-rtl.c (set_new_first_and_last_insn): Likewise. (get_max_insn_count): Likewise. (make_debug_insn_raw): Likewise. (init_emit): Likewise. * explow.c (compute_stack_clash_protection_loop_data): Likewise. * final.c (compute_alignments): Likewise. * fold-const.c (fold_range_test): Likewise. (fold_truth_andor): Likewise. (tree_single_nonnegative_warnv_p): Likewise. (integer_valued_real_single_p): Likewise. * gcse.c (want_to_gcse_p): Likewise. (prune_insertions_deletions): Likewise. (hoist_code): Likewise. (gcse_or_cprop_is_too_expensive): Likewise. * ggc-common.c: Likewise. * ggc-page.c (ggc_collect): Likewise. * gimple-loop-interchange.cc (MAX_NUM_STMT): Likewise. (MAX_DATAREFS): Likewise. (OUTER_STRIDE_RATIO): Likewise. * gimple-loop-jam.c (tree_loop_unroll_and_jam): Likewise. * gimple-loop-versioning.cc (loop_versioning::max_insns_for_loop): Likewise. * gimple-ssa-split-paths.c (is_feasible_trace): Likewise. * gimple-ssa-store-merging.c (imm_store_chain_info::try_coalesce_bswap): Likewise. (imm_store_chain_info::coalesce_immediate_stores): Likewise. (imm_store_chain_info::output_merged_store): Likewise. (pass_store_merging::process_store): Likewise. * gimple-ssa-strength-reduction.c (find_basis_for_base_expr): Likewise. * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): Likewise. (scop_to_isl_ast): Likewise. * graphite-optimize-isl.c (get_schedule_for_node_st): Likewise. (optimize_isl): Likewise. * graphite-scop-detection.c (build_scops): Likewise. * haifa-sched.c (set_modulo_params): Likewise. (rank_for_schedule): Likewise. (model_add_to_worklist): Likewise. (model_promote_insn): Likewise. (model_choose_insn): Likewise. (queue_to_ready): Likewise. (autopref_multipass_dfa_lookahead_guard): Likewise. (schedule_block): Likewise. (sched_init): Likewise. * hsa-gen.c (init_prologue): Likewise. * ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Likewise. (cond_move_process_if_block): Likewise. * ipa-cp.c (ipcp_lattice::add_value): Likewise. (merge_agg_lats_step): Likewise. (devirtualization_time_bonus): Likewise. (hint_time_bonus): Likewise. (incorporate_penalties): Likewise. (good_cloning_opportunity_p): Likewise. (ipcp_propagate_stage): Likewise. * ipa-fnsummary.c (decompose_param_expr): Likewise. (set_switch_stmt_execution_predicate): Likewise. (analyze_function_body): Likewise. (compute_fn_summary): Likewise. * ipa-inline-analysis.c (estimate_growth): Likewise. * ipa-inline.c (caller_growth_limits): Likewise. (inline_insns_single): Likewise. (inline_insns_auto): Likewise. (can_inline_edge_by_limits_p): Likewise. (want_early_inline_function_p): Likewise. (big_speedup_p): Likewise. (want_inline_small_function_p): Likewise. (want_inline_self_recursive_call_p): Likewise. (edge_badness): Likewise. (recursive_inlining): Likewise. (compute_max_insns): Likewise. (early_inliner): Likewise. * ipa-polymorphic-call.c (csftc_abort_walking_p): Likewise. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (determine_known_aggregate_parts): Likewise. (ipa_analyze_node): Likewise. (ipcp_transform_function): Likewise. * ipa-split.c (consider_split): Likewise. * ipa-sra.c (allocate_access): Likewise. (process_scan_results): Likewise. (ipa_sra_summarize_function): Likewise. (pull_accesses_from_callee): Likewise. * ira-build.c (loop_compare_func): Likewise. (mark_loops_for_removal): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (gain_for_invariant): Likewise. (move_loop_invariants): Likewise. * loop-unroll.c (decide_unroll_constant_iterations): Likewise. (decide_unroll_runtime_iterations): Likewise. (decide_unroll_stupid): Likewise. (expand_var_during_unrolling): Likewise. * lra-assigns.c (spill_for): Likewise. * lra-constraints.c (EBB_PROBABILITY_CUTOFF): Likewise. * modulo-sched.c (sms_schedule): Likewise. (DFA_HISTORY): Likewise. * opts.c (default_options_optimization): Likewise. (finish_options): Likewise. (common_handle_option): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. (if): Likewise. * predict.c (get_hot_bb_threshold): Likewise. (maybe_hot_count_p): Likewise. (probably_never_executed): Likewise. (predictable_edge_p): Likewise. (predict_loops): Likewise. (expr_expected_value_1): Likewise. (tree_predict_by_opcode): Likewise. (handle_missing_profiles): Likewise. * reload.c (find_equiv_reg): Likewise. * reorg.c (redundant_insn): Likewise. * resource.c (mark_target_live_regs): Likewise. (incr_ticks_for_insn): Likewise. * sanopt.c (pass_sanopt::execute): Likewise. * sched-deps.c (sched_analyze_1): Likewise. (sched_analyze_2): Likewise. (sched_analyze_insn): Likewise. (deps_analyze_insn): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (find_single_block_region): Likewise. (too_large): Likewise. (haifa_find_rgns): Likewise. (extend_rgns): Likewise. (new_ready): Likewise. (schedule_region): Likewise. (sched_rgn_init): Likewise. * sel-sched-ir.c (make_region_from_loop): Likewise. * sel-sched-ir.h (MAX_WS): Likewise. * sel-sched.c (process_pipelined_exprs): Likewise. (sel_setup_region_sched_flags): Likewise. * shrink-wrap.c (try_shrink_wrapping): Likewise. * targhooks.c (default_max_noce_ifcvt_seq_cost): Likewise. * toplev.c (print_version): Likewise. (process_options): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (tm_log_add): Likewise. * tree-chrec.c (chrec_fold_plus_1): Likewise. * tree-data-ref.c (split_constant_offset): Likewise. (compute_all_dependences): Likewise. * tree-if-conv.c (MAX_PHI_ARG_NUM): Likewise. * tree-inline.c (remap_gimple_stmt): Likewise. * tree-loop-distribution.c (MAX_DATAREFS_NUM): Likewise. * tree-parloops.c (MIN_PER_THREAD): Likewise. (create_parallel_loop): Likewise. * tree-predcom.c (determine_unroll_factor): Likewise. * tree-scalar-evolution.c (instantiate_scev_r): Likewise. * tree-sra.c (analyze_all_variable_accesses): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * tree-ssa-dse.c (setup_live_bytes_from_ref): Likewise. (dse_optimize_redundant_stores): Likewise. (dse_classify_store): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ch.c (ch_base::copy_headers): Likewise. * tree-ssa-loop-im.c (LIM_EXPENSIVE): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. (try_peel_loop): Likewise. (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-ivopts.c (avg_loop_niter): Likewise. (CONSIDER_ALL_CANDIDATES_BOUND): Likewise. (MAX_CONSIDERED_GROUPS): Likewise. (ALWAYS_PRUNE_CAND_SET_BOUND): Likewise. * tree-ssa-loop-manip.c (can_unroll_loop_p): Likewise. * tree-ssa-loop-niter.c (MAX_ITERATIONS_TO_TRACK): Likewise. * tree-ssa-loop-prefetch.c (PREFETCH_BLOCK): Likewise. (L1_CACHE_SIZE_BYTES): Likewise. (L2_CACHE_SIZE_BYTES): Likewise. (should_issue_prefetch_p): Likewise. (schedule_prefetches): Likewise. (determine_unroll_factor): Likewise. (volume_of_references): Likewise. (add_subscript_strides): Likewise. (self_reuse_distance): Likewise. (mem_ref_count_reasonable_p): Likewise. (insn_to_prefetch_ratio_too_small_p): Likewise. (loop_prefetch_arrays): Likewise. (tree_ssa_prefetch_arrays): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. * tree-ssa-math-opts.c (gimple_expand_builtin_pow): Likewise. (convert_mult_to_fma): Likewise. (math_opts_dom_walker::after_dom_children): Likewise. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise. (hoist_adjacent_loads): Likewise. (gate_hoist_loads): Likewise. * tree-ssa-pre.c (translate_vuse_through_block): Likewise. (compute_partial_antic_aux): Likewise. * tree-ssa-reassoc.c (get_reassociation_width): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Likewise. (vn_reference_lookup): Likewise. (do_rpo_vn): Likewise. * tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr): Likewise. * tree-ssa-sink.c (select_best_block): Likewise. * tree-ssa-strlen.c (new_stridx): Likewise. (new_addr_stridx): Likewise. (get_range_strlen_dynamic): Likewise. (class ssa_name_limit_t): Likewise. * tree-ssa-structalias.c (push_fields_onto_fieldstack): Likewise. (create_variable_info_for_1): Likewise. (init_alias_vars): Likewise. * tree-ssa-tail-merge.c (find_clusters_1): Likewise. (tail_merge_optimize): Likewise. * tree-ssa-threadbackward.c (thread_jumps::profitable_jump_thread_path): Likewise. (thread_jumps::fsm_find_control_statement_thread_paths): Likewise. (thread_jumps::find_jump_threads_backwards): Likewise. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts_at_dest): Likewise. * tree-ssa-uninit.c (compute_control_dep_chain): Likewise. * tree-switch-conversion.c (switch_conversion::check_range): Likewise. (jump_table_cluster::can_be_handled): Likewise. * tree-switch-conversion.h (jump_table_cluster::case_values_threshold): Likewise. (SWITCH_CONVERSION_BRANCH_RATIO): Likewise. (param_switch_conversion_branch_ratio): Likewise. * tree-vect-data-refs.c (vect_mark_for_runtime_alias_test): Likewise. (vect_enhance_data_refs_alignment): Likewise. (vect_prune_runtime_alias_test_list): Likewise. * tree-vect-loop.c (vect_analyze_loop_costing): Likewise. (vect_get_datarefs_in_loop): Likewise. (vect_analyze_loop): Likewise. * tree-vect-slp.c (vect_slp_bb): Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c (find_switch_asserts): Likewise. (vrp_prop::check_mem_ref): Likewise. * tree.c (wide_int_to_tree_1): Likewise. (cache_integer_cst): Likewise. * var-tracking.c (EXPR_USE_DEPTH): Likewise. (reverse_op): Likewise. (vt_find_locations): Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * gimple-parser.c (c_parser_parse_gimple_body): Replace old parameter syntax with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET macro. 2019-11-12 Martin Liska <mliska@suse.cz> * name-lookup.c (namespace_hints::namespace_hints): Replace old parameter syntax with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET macro. * typeck.c (comptypes): Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * lto-partition.c (lto_balanced_map): Replace old parameter syntax with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET macro. * lto.c (do_whole_program_analysis): Likewise. From-SVN: r278085
2019-11-05PR middle-end/92333 - missing variable name referencing VLA in warningsMartin Sebor
PR middle-end/92333 - missing variable name referencing VLA in warnings PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index gcc/testsuite/ChangeLog: PR middle-end/92333 PR middle-end/82608 * gcc.dg/Warray-bounds-51.c: New test. gcc/ChangeLog: PR middle-end/92333 PR middle-end/82608 * tree-vrp.c (vrp_prop::check_array_ref): Handle VLAs with constant size. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Use a meaninful name and location for a temporary variable. From-SVN: r277854
2019-09-26function.c (gimplify_parameters): Use build_clobber function.Jakub Jelinek
* function.c (gimplify_parameters): Use build_clobber function. * tree-ssa.c (execute_update_addresses_taken): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-sra.c (clobber_subtree): Likewise. * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise. * omp-low.c (lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_omp_single, lower_depend_clauses, lower_omp_taskreg, lower_omp_target): Likewise. * omp-expand.c (expand_omp_for_generic): Likewise. * omp-offload.c (ompdevlow_adjust_simt_enter): Likewise. From-SVN: r276165
2019-09-18Make get_value_for_expr check for INTEGER_CSTsRichard Sandiford
CONSTANT lattice values are symbolic constants rather than compile-time constants, so among other things can be POLY_INT_CSTs. This patch fixes a case in which we assumed all CONSTANTs were either ADDR_EXPRs or INTEGER_CSTs. This is tested by later SVE patches. 2019-09-18 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-ssa-ccp.c (get_value_for_expr): Check whether CONSTANTs are INTEGER_CSTs. From-SVN: r275871
2019-08-21re PR tree-optimization/91482 (__builtin_assume_aligned should not break ↵Richard Biener
write combining) 2019-08-21 Richard Biener <rguenther@suse.de> PR tree-optimization/91482 * tree-ssa-ccp.c (ccp_folder::fold_stmt): Remove useless BUILT_IN_ASSUME_ALIGNED calls. * gcc.dg/tree-ssa/pr91482.c: New testcase. From-SVN: r274796
2019-08-13Protect some checks of DECL_FUNCTION_CODERichard Sandiford
This patch protects various uses of DECL_FUNCTION_CODE that didn't obviously check for BUILT_IN_NORMAL first (either directly or in callers). They could therefore trigger for functions that either aren't built-ins or are a different kind of built-in. Also, the patch removes a redundant GIMPLE_CALL check from optimize_stdarg_builtin, since it gave the impression that the stmt was less well checked than it actually is. 2019-08-13 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR middle-end/91421 * attribs.c (decl_attributes): Check the DECL_BUILT_IN_CLASS before the DECL_FUNCTION_CODE. * calls.c (maybe_warn_alloc_args_overflow): Use fndecl_built_in_p to check for a BUILT_IN_ALLOCA call. * ipa-cp.c (ipa_get_indirect_edge_target_1): Likewise for BUILT_IN_UNREACHABLE. Don't check for a FUNCTION_TYPE. * ipa-devirt.c (possible_polymorphic_call_target_p): Likewise. * ipa-prop.c (try_make_edge_direct_virtual_call): Likewise. * gimple-ssa-isolate-paths.c (is_addr_local): Check specifically for BUILT_IN_NORMAL functions. * trans-mem.c (expand_block_edges): Use gimple_call_builtin_p to test for BUILT_IN_TM_ABORT. * tree-ssa-ccp.c (optimize_stack_restore): Use fndecl_built_in_p to check for a BUILT_IN_STACK_RESTORE call. (optimize_stdarg_builtin): Remove redundant check for GIMPLE_CALL. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts_at_dest): Check for a BUILT_IN_NORMAL decl before checking its DECL_FUNCTION_CODE. * tree-vect-patterns.c (vect_recog_pow_pattern): Use a positive test for a BUILT_IN_NORMAL call instead of a negative test for an internal function call. gcc/c/ PR middle-end/91421 * c-decl.c (header_for_builtin_fn): Take a FUNCTION_DECL instead of a built_in_function. (diagnose_mismatched_decls, implicitly_declare): Update accordingly. From-SVN: r274403
2019-08-05Add a gimple_move_vops helper functionRichard Sandiford
I needed to add another instance of this idiom, so thought it'd be worth having a helper function. 2019-08-05 Richard Sandiford <richard.sandiford@arm.com> gcc/ * gimple.h (gimple_move_vops): Declare. * gimple.c (gimple_move_vops): New function * gimple-fold.c (replace_call_with_call_and_fold) (gimple_fold_builtin_memory_op, gimple_fold_builtin_memset) (gimple_fold_builtin_stpcpy, fold_builtin_atomic_compare_exchange) (gimple_fold_call): Use it. * ipa-param-manipulation.c (ipa_modify_call_arguments): Likewise. * tree-call-cdce.c (use_internal_fn): Likewise. * tree-if-conv.c (predicate_load_or_store): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-propagate.c (finish_update_gimple_call): Likewise. (update_call_from_tree): Likewise. * tree-vect-stmts.c (vectorizable_load): Likewise. * tree-vectorizer.c (adjust_simduid_builtins): Likewise. From-SVN: r274117
2019-07-09PR c++/61339 - add mismatch between struct and class [-Wmismatched-tags] to ↵Martin Sebor
non-bugs gcc/c/ChangeLog: PR c++/61339 * c-decl.c: Change class-key from class to struct and vice versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. * gimple-parser.c: Same. gcc/c-family/ChangeLog: PR c++/61339 * c-format.c (check_argument_type): Change class-key from class to struct and vice versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. * c-pretty-print.h: Same. gcc/cp/ChangeLog: PR c++/61339 * constexpr.c (cxx_eval_call_expression): Change class-key from class to struct and vice versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. * constraint.cc (get_concept_definition): Same. * cp-tree.h: Same. * cxx-pretty-print.h: Same. * error.c: Same. * logic.cc (term_list::replace): Same. * name-lookup.c (find_local_binding): Same. * pt.c (tsubst_binary_right_fold): Same. * search.c (field_accessor_p): Same. * semantics.c (expand_or_defer_fn): Same. gcc/lto/ChangeLog: PR c++/61339 * lto-dump.c: Change class-key from classi to struct and vice versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. gcc/ChangeLog: PR c++/61339 * align.h: Change class-key from class to struct and vice versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod. * alloc-pool.h: Same. * asan.c (shadow_mem_size): Same. * auto-profile.c: Same. * basic-block.h: Same. * bitmap.h: Same. * cfgexpand.c (set_rtl): Same. (expand_one_stack_var_at): Same. * cfghooks.h: Same. * cfgloop.h: Same. * cgraph.h: Same. * config/i386/i386.h: Same. * df-problems.c (df_print_bb_index): Same. * df-scan.c: Same. * df.h (df_single_use): Same. * diagnostic-show-locus.c (layout::print_annotation_line): Same. (layout::annotation_line_showed_range_p): Same. (get_printed_columns): Same. (correction::ensure_terminated): Same. (line_corrections::~line_corrections): Same. * dojump.h: Same. * dse.c: Same. * dump-context.h: Same. * dumpfile.h: Same. * dwarf2out.c: Same. * edit-context.c: Same. * fibonacci_heap.c (test_union_of_equal_heaps): Same. * flags.h: Same. * function.c (assign_stack_local): Same. * function.h: Same. * gcc.c: Same. * gcov.c (block_info::block_info): Same. * genattrtab.c: Same. * genextract.c: Same. * genmatch.c (comparison_code_p): Same. (id_base::id_base): Same. (decision_tree::print): Same. * genoutput.c: Same. * genpreds.c (write_one_predicate_function): Same. * genrecog.c (validate_pattern): Same. (find_operand_positions): Same. (optimize_subroutine_group): Same. (merge_pattern_transition::merge_pattern_transition): Same. (merge_pattern_info::merge_pattern_info): Same. (merge_state_result::merge_state_result): Same. (merge_into_state): Same. * gensupport.c: Same. * gensupport.h: Same. * ggc-common.c (init_ggc_heuristics): Same. * ggc-tests.c (test_union): Same. * gimple-loop-interchange.cc (dump_induction): Same. * gimple-loop-versioning.cc: Same. * gimple-match.h (gimple_match_cond::any_else): Same. * gimple-ssa-backprop.c: Same. * gimple-ssa-sprintf.c: Same. * gimple-ssa-store-merging.c (store_operand_info::store_operand_info): Same. (store_immediate_info::store_immediate_info): Same. (merged_store_group::apply_stores): Same. (get_location_for_stmts): Same. * gimple-ssa-strength-reduction.c: Same. * gimple-ssa-warn-alloca.c: Same. * gimple-ssa-warn-restrict.c (pass_wrestrict::execute): Same. * godump.c (go_type_decl): Same. * hash-map-tests.c (test_map_of_strings_to_int): Same. * hash-map.h: Same. * hash-set-tests.c (test_set_of_strings): Same. * hsa-brig.c: Same. * hsa-common.h: Same. * hsa-gen.c (transformable_switch_to_sbr_p): Same. * input.c (assert_loceq): Same. * input.h: Same. * ipa-cp.c: Same. * ipa-devirt.c (possible_polymorphic_call_targets_1): Same. * ipa-fnsummary.h: Same. * ipa-inline.h: Same. * ipa-prop.h: Same. * ipa-split.c (visit_bb): Same. * ira-int.h (minmax_set_iter_next): Same. * loop-invariant.c: Same. * loop-iv.c: Same. * lra-eliminations.c: Same. * lra-int.h: Same. * lra-lives.c (mark_regno_dead): Same. * lra-remat.c: Same. * lra-spills.c: Same. * lto-streamer.h: Same. * mem-stats.h: Same. * omp-grid.c (omp_grid_lastprivate_predicate): Same. * omp-low.c (omp_clause_aligned_alignment): Same. * optabs-query.h (get_vcond_eq_icode): Same. * optabs.h: Same. * opts.c (wrap_help): Same. * poly-int.h: Same. * predict.c (predict_paths_leading_to_edge): Same. * pretty-print.h: Same. * profile-count.h: Same. * read-md.h: Same. * read-rtl-function.c: Same. * ree.c: Same. * reginfo.c: Same. * regrename.c: Same. * regrename.h: Same. * reload.h: Same. * rtl-iter.h: Same. * rtl.h (costs_add_n_insns): Same. * sanopt.c: Same. * sched-int.h: Same. * sel-sched-ir.h: Same. * selftest.h: Same. * sese.h (vec_find): Same. * stmt.c: Same. * target-globals.h: Same. * tree-affine.c (aff_combination_find_elt): Same. * tree-affine.h: Same. * tree-data-ref.h: Same. * tree-outof-ssa.c (ssa_is_replaceable_p): Same. * tree-predcom.c: Same. * tree-scalar-evolution.c (find_var_scev_info): Same. * tree-ssa-alias.h: Same. * tree-ssa-ccp.c: Same. * tree-ssa-coalesce.c (ssa_conflicts_dump): Same. * tree-ssa-loop-im.c (for_all_locs_in_loop): Same. (rewrite_mem_refs): Same. (execute_sm_if_changed): Same. (hoist_memory_references): Same. * tree-ssa-loop-ivopts.c (operator<=): Same. * tree-ssa-loop.h: Same. * tree-ssa-pre.c (get_or_alloc_expr_for_name): Same. * tree-ssa-structalias.c: Same. * tree-switch-conversion.h (cluster::cluster): Same. (simple_cluster::simple_cluster): Same. * tree-vect-patterns.c (type_conversion_p): Same. * tree-vectorizer.c (dump_stmt_cost): Same. * tree-vectorizer.h (loop_vec_info_for_loop): Same. * tree.c (protected_set_expr_location): Same. * tree.h (desired_pro_or_demotion_p): Same. (fndecl_built_in_p): Same. * unique-ptr-tests.cc: Same. * var-tracking.c (delete_variable_part): Same. * varasm.c (assemble_real): Same. (tree_output_constant_def): Same. * vec.c: Same. * wide-int-bitmask.h: Same. * wide-int.h (decompose): Same. From-SVN: r273308
2019-04-30re PR tree-optimization/89475 (Teach ccp about __builtin_bswap{16,32,64})Jakub Jelinek
PR tree-optimization/89475 * tree-ssa-ccp.c (evaluate_stmt): Handle BUILT_IN_BSWAP{16,32,64} calls. * gcc.dg/tree-ssa/pr89475.c: New test. From-SVN: r270680
2019-04-15re PR ipa/88936 (-fipa-pta breaks bash (incorrect optimisation of recursive ↵Richard Biener
static function)) 2019-04-15 Richard Biener <rguenther@suse.de> PR ipa/88936 * tree.h (auto_var_p): Declare. * tree.c (auto_var_p): New function, split out from ... (auto_var_in_fn_p): ... here. * tree-ssa-structalias.c (struct variable_info): Add shadow_var_uid member. (new_var_info): Initialize it. (set_uids_in_ptset): Also set the shadow variable uid if required. (ipa_pta_execute): Postprocess points-to solutions assigning shadow variable uids for locals that may reach their containing function recursively. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Do not assert but instead check whether the points-to solution is a singleton. * gcc.dg/torture/pr88936-1.c: New testcase. * gcc.dg/torture/pr88936-2.c: Likewise. * gcc.dg/torture/pr88936-3.c: Likewise. From-SVN: r270366
2019-01-01Update copyright years.Jakub Jelinek
From-SVN: r267494
2018-10-22Add a fun parameter to three stmt_could_throw... functionsMartin Jambor
This long patch only does one simple thing, adds an explicit function parameter to predicates stmt_could_throw_p, stmt_can_throw_external and stmt_can_throw_internal. My motivation was ability to use stmt_can_throw_external in IPA analysis phase without the need to push cfun. As I have discovered, we were already doing that in cgraph.c, which this patch avoids as well. In the process, I had to add a struct function parameter to stmt_could_throw_p and decided to also change the interface of stmt_can_throw_internal just for the sake of some minimal consistency. In the process I have discovered that calling method cgraph_node::create_version_clone_with_body (used by ipa-split, ipa-sra, OMP simd and multiple_target) leads to calls of stmt_can_throw_external with NULL cfun. I have worked around this by making stmt_can_throw_external and stmt_could_throw_p gracefully accept NULL and just be pessimistic in that case. The problem with fixing this in a better way is that struct function for the clone is created after cloning edges where we attempt to push the yet not existing cfun, and moving it before would require a bit of surgery in tree-inline.c. A slightly hackish but simpler fix might be to explicitely pass the "old" function to symbol_table::create_edge because it should be just as good at that moment. In any event, that is a topic for another patch. I believe that currently we incorrectly use cfun in maybe_clean_eh_stmt_fn and maybe_duplicate_eh_stmt_fn, both in tree-eh.c, and so I have fixed these cases too. The bulk of other changes is just mechanical adding of cfun to all users. Bootstrapped and tested on x86_64-linux (also with extra NULLing and restoring cfun to double check it is not used in a place I missed), OK for trunk? Thanks, Martin 2018-10-22 Martin Jambor <mjambor@suse.cz> * tree-eh.h (stmt_could_throw_p): Add function parameter. (stmt_can_throw_external): Likewise. (stmt_can_throw_internal): Likewise. * tree-eh.c (lower_eh_constructs_2): Pass cfun to stmt_could_throw_p. (lower_eh_constructs_2): Likewise. (stmt_could_throw_p): Add fun parameter, use it instead of cfun. (stmt_can_throw_external): Likewise. (stmt_can_throw_internal): Likewise. (maybe_clean_eh_stmt_fn): Pass cfun to stmt_could_throw_p. (maybe_clean_or_replace_eh_stmt): Pass cfun to stmt_could_throw_p. (maybe_duplicate_eh_stmt_fn): Pass new_fun to stmt_could_throw_p. (maybe_duplicate_eh_stmt): Pass cfun to stmt_could_throw_p. (pass_lower_eh_dispatch::execute): Pass cfun to stmt_can_throw_external. (cleanup_empty_eh): Likewise. (verify_eh_edges): Pass cfun to stmt_could_throw_p. * cgraph.c (cgraph_edge::set_call_stmt): Pass a function to stmt_can_throw_external instead of pushing it to cfun. (symbol_table::create_edge): Likewise. * gimple-fold.c (fold_builtin_atomic_compare_exchange): Pass cfun to stmt_can_throw_internal. * gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Pass cfun to stmt_could_throw_p. * gimple-ssa-store-merging.c (handled_load): Pass cfun to stmt_can_throw_internal. (pass_store_merging::execute): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Pass cfun to stmt_could_throw_p. * gimplify-me.c (gimple_regimplify_operands): Pass cfun to stmt_can_throw_internal. * ipa-pure-const.c (check_call): Pass cfun to stmt_could_throw_p and to stmt_can_throw_external. (check_stmt): Pass cfun to stmt_could_throw_p. (check_stmt): Pass cfun to stmt_can_throw_external. (pass_nothrow::execute): Likewise. * trans-mem.c (expand_call_tm): Pass cfun to stmt_can_throw_internal. * tree-cfg.c (is_ctrl_altering_stmt): Pass cfun to stmt_can_throw_internal. (verify_gimple_in_cfg): Pass cfun to stmt_could_throw_p. (stmt_can_terminate_bb_p): Pass cfun to stmt_can_throw_external. (gimple_purge_dead_eh_edges): Pass cfun to stmt_can_throw_internal. * tree-complex.c (expand_complex_libcall): Pass cfun to stmt_could_throw_p and to stmt_can_throw_internal. (expand_complex_multiplication): Pass cfun to stmt_can_throw_internal. * tree-inline.c (copy_edges_for_bb): Likewise. (maybe_move_debug_stmts_to_successors): Likewise. * tree-outof-ssa.c (ssa_is_replaceable_p): Pass cfun to stmt_could_throw_p. * tree-parloops.c (oacc_entry_exit_ok_1): Likewise. * tree-sra.c (scan_function): Pass cfun to stmt_can_throw_external. * tree-ssa-alias.c (stmt_kills_ref_p): Pass cfun to stmt_can_throw_internal. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Pass cfun to stmt_could_throw_p. (mark_aliased_reaching_defs_necessary_1): Pass cfun to stmt_can_throw_internal. * tree-ssa-forwprop.c (pass_forwprop::execute): Likewise. * tree-ssa-loop-im.c (movement_possibility): Pass cfun to stmt_could_throw_p. * tree-ssa-loop-ivopts.c (find_givs_in_stmt_scev): Likewise. (add_autoinc_candidates): Pass cfun to stmt_can_throw_internal. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. (convert_mult_to_fma_1): Likewise. (convert_to_divmod): Likewise. * tree-ssa-phiprop.c (propagate_with_phi): Likewise. * tree-ssa-pre.c (compute_avail): Pass cfun to stmt_could_throw_p. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-reassoc.c (suitable_cond_bb): Likewise. (maybe_optimize_range_tests): Likewise. (linearize_expr_tree): Likewise. (reassociate_bb): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_call): Likewise. * tree-ssa-scopedtables.c (hashable_expr_equal_p): Likewise. * tree-ssa-strlen.c (adjust_last_stmt): Likewise. (handle_char_store): Likewise. * tree-vect-data-refs.c (vect_find_stmt_data_reference): Pass cfun to stmt_can_throw_internal. * tree-vect-patterns.c (check_bool_pattern): Pass cfun to stmt_could_throw_p. * tree-vect-stmts.c (vect_finish_stmt_generation_1): Likewise. (vectorizable_call): Pass cfun to stmt_can_throw_internal. (vectorizable_simd_clone_call): Likewise. * value-prof.c (gimple_ic): Pass cfun to stmt_could_throw_p. (gimple_stringop_fixed_value): Likewise. From-SVN: r265372
2018-10-05re PR middle-end/63155 (memory hog)Richard Biener
2018-10-05 Richard Biener <rguenther@suse.de> PR tree-optimization/63155 * tree-ssa-ccp.c (ccp_propagate::visit_phi): Avoid excess vertical space in dumpfiles. * tree-ssa-propagate.h (ssa_propagation_engine::process_ssa_edge_worklist): Remove. * tree-ssa-propagate.c (cfg_blocks_back): New global. (ssa_edge_worklist_back): Likewise. (curr_order): Likewise. (cfg_blocks_get): Remove abstraction. (cfg_blocks_add): Likewise. (cfg_blocks_empty_p): Likewise. (add_ssa_edge): Add to current or next worklist based on RPO index. (add_control_edge): Likewise. (ssa_propagation_engine::process_ssa_edge_worklist): Fold into ... (ssa_propagation_engine::ssa_propagate): ... here. Unify iteration from CFG and SSA edge worklist so we process everything in RPO order, prioritizing forward progress over iteration. (ssa_prop_init): Allocate new worklists, do not dump immediate uses. (ssa_prop_fini): Free new worklists. From-SVN: r264869
2018-08-27Come up with fndecl_built_in_p.Martin Liska
2018-08-27 Martin Liska <mliska@suse.cz> * builtins.h (is_builtin_fn): Remove and fndecl_built_in_p. * builtins.c (is_builtin_fn): Likewise. * attribs.c (diag_attr_exclusions): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. (builtin_mathfn_code): Likewise. (fold_builtin_expect): Likewise. (fold_call_expr): Likewise. (fold_builtin_call_array): Likewise. (fold_call_stmt): Likewise. (set_builtin_user_assembler_name): Likewise. (is_simple_builtin): Likewise. * calls.c (gimple_alloca_call_p): Likewise. (maybe_warn_nonstring_arg): Likewise. * cfgexpand.c (expand_call_stmt): Likewise. * cgraph.c (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_edge::verify_corresponds_to_fndecl): Likewise. (cgraph_node::verify_node): Likewise. * cgraphclones.c (build_function_decl_skip_args): Likewise. (cgraph_node::create_clone): Likewise. * config/arm/arm.c (arm_insert_attributes): Likewise. * config/i386/i386.c (ix86_gimple_fold_builtin): Likewise. * dse.c (scan_insn): Likewise. * expr.c (expand_expr_real_1): Likewise. * fold-const.c (operand_equal_p): Likewise. (fold_binary_loc): Likewise. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise. * gimple-low.c (lower_stmt): Likewise. * gimple-pretty-print.c (dump_gimple_call): Likewise. * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Likewise. * gimple.c (gimple_build_call_from_tree): Likewise. (gimple_call_builtin_p): Likewise. (gimple_call_combined_fn): Likewise. * gimplify.c (gimplify_call_expr): Likewise. (gimple_boolify): Likewise. (gimplify_modify_expr): Likewise. (gimplify_addr_expr): Likewise. * hsa-gen.c (gen_hsa_insns_for_call): Likewise. * ipa-cp.c (determine_versionability): Likewise. * ipa-fnsummary.c (compute_fn_summary): Likewise. * ipa-param-manipulation.c (ipa_modify_formal_parameters): Likewise. * ipa-split.c (visit_bb): Likewise. (split_function): Likewise. * ipa-visibility.c (cgraph_externally_visible_p): Likewise. * lto-cgraph.c (input_node): Likewise. * lto-streamer-out.c (write_symbol): Likewise. * omp-low.c (setjmp_or_longjmp_p): Likewise. (lower_omp_1): Likewise. * predict.c (strip_predict_hints): Likewise. * print-tree.c (print_node): Likewise. * symtab.c (symtab_node::output_to_lto_symbol_table_p): Likewise. * trans-mem.c (is_tm_irrevocable): Likewise. (is_tm_load): Likewise. (is_tm_simple_load): Likewise. (is_tm_store): Likewise. (is_tm_simple_store): Likewise. (is_tm_abort): Likewise. (tm_region_init_1): Likewise. * tree-call-cdce.c (gen_shrink_wrap_conditions): Likewise. * tree-cfg.c (verify_gimple_call): Likewise. (move_stmt_r): Likewise. (stmt_can_terminate_bb_p): Likewise. * tree-eh.c (lower_eh_constructs_2): Likewise. * tree-if-conv.c (if_convertible_stmt_p): Likewise. * tree-inline.c (remap_gimple_stmt): Likewise. (copy_bb): Likewise. (estimate_num_insns): Likewise. (fold_marked_statements): Likewise. * tree-sra.c (scan_function): Likewise. * tree-ssa-ccp.c (surely_varying_stmt_p): Likewise. (optimize_stack_restore): Likewise. (pass_fold_builtins::execute): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. (mark_all_reaching_defs_necessary_1): Likewise. * tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Likewise. * tree-ssa-forwprop.c (simplify_builtin_call): Likewise. (pass_forwprop::execute): Likewise. * tree-ssa-loop-im.c (stmt_cost): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Likewise. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-ssa-structalias.c (handle_lhs_call): Likewise. (find_func_aliases_for_call): Likewise. * tree-ssa-ter.c (find_replaceable_in_bb): Likewise. * tree-stdarg.c (optimize_va_list_gpr_fpr_size): Likewise. * tree-tailcall.c (find_tail_calls): Likewise. * tree.c (need_assembler_name_p): Likewise. (free_lang_data_in_decl): Likewise. (get_call_combined_fn): Likewise. * ubsan.c (is_ubsan_builtin_p): Likewise. * varasm.c (incorporeal_function_p): Likewise. * tree.h (DECL_BUILT_IN): Remove and replace with fndecl_built_in_p. (DECL_BUILT_IN_P): Transfort to fndecl_built_in_p. (fndecl_built_in_p): New. 2018-08-27 Martin Liska <mliska@suse.cz> * gcc-interface/decl.c (update_profile): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. * gcc-interface/gigi.h (call_is_atomic_load): Likewise. * gcc-interface/utils.c (gnat_pushdecl): Likewise. 2018-08-27 Martin Liska <mliska@suse.cz> * c-common.c (check_function_restrict): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. (check_builtin_function_arguments): Likewise. (reject_gcc_builtin): Likewise. * c-warn.c (sizeof_pointer_memaccess_warning): Likewise. 2018-08-27 Martin Liska <mliska@suse.cz> * c-decl.c (locate_old_decl): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. (diagnose_mismatched_decls): Likewise. (merge_decls): Likewise. (warn_if_shadowing): Likewise. (pushdecl): Likewise. (implicitly_declare): Likewise. * c-parser.c (c_parser_postfix_expression_after_primary): Likewise. * c-tree.h (C_DECL_ISNT_PROTOTYPE): Likewise. * c-typeck.c (build_function_call_vec): Likewise. (convert_arguments): Likewise. 2018-08-27 Martin Liska <mliska@suse.cz> * call.c (build_call_a): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. (build_cxx_call): Likewise. * constexpr.c (constexpr_fn_retval): Likewise. (cxx_eval_builtin_function_call): Likewise. (cxx_eval_call_expression): Likewise. (potential_constant_expression_1): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. (cp_fold): Likewise. * decl.c (decls_match): Likewise. (validate_constexpr_redeclaration): Likewise. (duplicate_decls): Likewise. (make_rtl_for_nonlocal_decl): Likewise. * name-lookup.c (consider_binding_level): Likewise. (cp_emit_debug_info_for_using): Likewise. * semantics.c (finish_call_expr): Likewise. * tree.c (builtin_valid_in_constant_expr_p): Likewise. 2018-08-27 Martin Liska <mliska@suse.cz> * go-gcc.cc (Gcc_backend::call_expression): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. 2018-08-27 Martin Liska <mliska@suse.cz> * lto-lang.c (handle_const_attribute): Use new function fndecl_built_in_p and remove check for FUNCTION_DECL if possible. * lto-symtab.c (lto_symtab_merge_p): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_symbols): Likewise. * lto.c (lto_maybe_register_decl): Likewise. (read_cgraph_and_symbols): Likewise. From-SVN: r263880
2018-08-20Add support for grouping of related diagnostics (PR other/84889)David Malcolm
We often emit logically-related groups of diagnostics. A relatively simple case is this: if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); where the "note" diagnostic issued by the "inform" call is guarded by the -Wmultistatement_macros warning. More complicated examples can be seen in the C++ frontend, where e.g. print_z_candidates can lead to numerous "note" diagnostics being emitted. I'm looking at various ways to improve how we handle such related diagnostics, but, prior to this patch, there was no explicit relationship between these diagnostics: the diagnostics subsystem had no way of "knowing" that these were related. This patch introduces a simple way to group the diagnostics: an auto_diagnostic_group class: all diagnostics emitted within the lifetime of an auto_diagnostic_group instance are logically grouped. Hence in the above example, the two diagnostics can be grouped by simply adding an auto_diagnostic_group instance: auto_diagnostic_group d; if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); Some more awkard cases are of the form: if (some_condition && warning_at (...) && more_conditions) inform (...); which thus need restructuring to: if (some_condition) { auto_diagnostic_group d; warning_at (...); if (more_conditions) inform (...); } so that the lifetime of the auto_diagnostic_group groups the warning_at and the inform call. Nesting is handled by simply tracking a nesting depth within the diagnostic_context.: all diagnostics are treated as grouped until the final auto_diagnostic_group is popped. diagnostic.c uses this internally, so that all diagnostics are part of a group - those that are "by themselves" are treated as being part of a group with one element. The diagnostic_context gains optional callbacks for displaying the start of a group (when the first diagnostic is emitted within it), and the end of a group (for when the group was non-empty); these callbacks are unused by default, but a test plugin demonstrates them (and verifies that the machinery is working). As noted above, I'm looking at various ways to use the grouping to improve how we output the diagnostics. FWIW, I experimented with a more involved implementation, of the form: diagnostic_group d; if (d.warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) d.inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); which had the advantage of allowing auto-detection of the places where groups were needed (by converting ::warning_at's return type to bool), but it was a much more invasive patch, especially when dealing with the places in the C++ frontend that can emit numerous notes after an error or warning (and thus having to pass the group around) Hence I went with this simpler approach. gcc/c-family/ChangeLog: PR other/84889 * c-attribs.c (common_handle_aligned_attribute): Add auto_diagnostic_group instance. * c-indentation.c (warn_for_misleading_indentation): Likewise. * c-opts.c (c_common_post_options): Likewise. * c-warn.c (warn_logical_not_parentheses): Likewise. (warn_duplicated_cond_add_or_warn): Likewise. (warn_for_multistatement_macros): Likewise. gcc/c/ChangeLog: PR other/84889 * c-decl.c (pushtag): Add auto_diagnostic_group instance. (diagnose_mismatched_decls): Likewise, in various places. (warn_if_shadowing): Likewise. (implicit_decl_warning): Likewise. (implicitly_declare): Likewise. (undeclared_variable): Likewise. (declare_label): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. * c-parser.c (c_parser_declaration_or_fndef): Likewise. (c_parser_parameter_declaration): Likewise. (c_parser_binary_expression): Likewise. * c-typeck.c (c_expr_sizeof_expr): Likewise. (parser_build_binary_op): Likewise. (build_unary_op): Likewise. (error_init): Likewise. (pedwarn_init): Likewise. (warning_init): Likewise. (convert_for_assignment): Likewise. gcc/cp/ChangeLog: PR other/84889 * call.c (build_user_type_conversion_1): Add auto_diagnostic_group instance(s). (print_error_for_call_failure): Likewise. (build_op_call_1): Likewise. (build_conditional_expr_1): Likewise. (build_new_op_1): Likewise. (build_op_delete_call): Likewise. (convert_like_real): Likewise. (build_over_call): Likewise. (build_new_method_call_1): Likewise. (joust): Likewise. * class.c (check_tag): Likewise. (finish_struct_anon_r): Likewise. (one_inherited_ctor): Likewise. (finalize_literal_type_property): Likewise. (explain_non_literal_class): Likewise. (find_flexarrays): Likewise. (resolve_address_of_overloaded_function): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. (is_valid_constexpr_fn): Likewise. (cx_check_missing_mem_inits): Likewise. * cp-gimplify.c (cp_genericize_r): Likewise. * cvt.c (maybe_warn_nodiscard): Likewise. * decl.c (warn_extern_redeclared_static): Likewise. (check_redeclaration_exception_specification): Likewise. (check_no_redeclaration_friend_default_args): Likewise. (duplicate_decls): Likewise. (redeclaration_error_message): Likewise. (warn_misplaced_attr_for_class_type): Likewise. * decl2.c (finish_static_data_member_decl): Likewise. (no_linkage_error): Likewise. (cp_warn_deprecated_use): Likewise. * error.c (qualified_name_lookup_error): Likewise. * friend.c (make_friend_class): Likewise. (do_friend): Likewise. * init.c (perform_member_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_delete): Likewise. * lex.c (unqualified_name_lookup_error): Likewise. * name-lookup.c (check_extern_c_conflict): Likewise. (inform_shadowed): New function. (check_local_shadow): Add auto_diagnostic_group instances, replacing goto "inform_shadowed" label with call to subroutine. (set_local_extern_decl_linkage): Add auto_diagnostic_group instance(s). * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. (cp_parser_namespace_name): Likewise. * pt.c (check_specialization_namespace): Likewise. (check_template_variable): Likewise. (warn_spec_missing_attributes): Likewise. (check_explicit_specialization): Likewise. (process_partial_specialization): Likewise. (lookup_template_class_1): Likewise. (finish_template_variable): Likewise. (do_auto_deduction): Likewise. * search.c (check_final_overrider): Likewise. (look_for_overrides_r): Likewise. * tree.c (maybe_warn_parm_abi): Likewise. * typeck.c (cxx_sizeof_expr): Likewise. (cp_build_function_call_vec): Likewise. (cp_build_binary_op): Likewise. (convert_for_assignment): Likewise. (maybe_warn_about_returning_address_of_local): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. (check_narrowing): Likewise. gcc/ChangeLog: PR other/84889 * attribs.c (diag_attr_exclusions): Add auto_diagnostic_group instance. (decl_attributes): Likewise. * calls.c (maybe_warn_nonstring_arg): Add auto_diagnostic_group instance. * cgraphunit.c (maybe_diag_incompatible_alias): Likewise. * diagnostic-core.h (class auto_diagnostic_group): New class. * diagnostic.c (diagnostic_initialize): Initialize the new fields. (diagnostic_report_diagnostic): Handle the first diagnostics within a group. (emit_diagnostic): Add auto_diagnostic_group instance. (inform): Likewise. (inform_n): Likewise. (warning): Likewise. (warning_at): Likewise. (warning_n): Likewise. (pedwarn): Likewise. (permerror): Likewise. (error): Likewise. (error_n): Likewise. (error_at): Likewise. (sorry): Likewise. (fatal_error): Likewise. (internal_error): Likewise. (internal_error_no_backtrace): Likewise. (auto_diagnostic_group::auto_diagnostic_group): New ctor. (auto_diagnostic_group::~auto_diagnostic_group): New dtor. * diagnostic.h (struct diagnostic_context): Add fields "diagnostic_group_nesting_depth", "diagnostic_group_emission_count", "begin_group_cb", "end_group_cb". * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior): Add auto_diagnostic_group instance(s). (find_explicit_erroneous_behavior): Likewise. * gimple-ssa-warn-alloca.c (pass_walloca::execute): Likewise. * gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Likewise. * gimplify.c (warn_implicit_fallthrough_r): Likewise. (gimplify_va_arg_expr): Likewise. * hsa-gen.c (HSA_SORRY_ATV): Likewise. (HSA_SORRY_AT): Likewise. * ipa-devirt.c (compare_virtual_tables): Likewise. (warn_odr): Likewise. * multiple_target.c (expand_target_clones): Likewise. * opts-common.c (cmdline_handle_error): Likewise. * reginfo.c (globalize_reg): Likewise. * substring-locations.c (format_warning_n_va): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise. * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): Likewise. * tree-ssa-uninit.c (warn_uninit): Likewise. * tree.c (warn_deprecated_use): Likewise. gcc/testsuite/ChangeLog: PR other/84889 * gcc.dg/plugin/diagnostic-group-test-1.c: New test. * gcc.dg/plugin/diagnostic_group_plugin.c: New test. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests. From-SVN: r263675
2018-08-01PR tree-optimization/86650 - -Warray-bounds missing inlining contextMartin Sebor
gcc/c/ChangeLog: PR tree-optimization/86650 * c-objc-common.c (c_tree_printer): Move usage of EXPR_LOCATION (t) and TREE_BLOCK (t) from within percent_K_format to this callsite. gcc/c-family/ChangeLog: PR tree-optimization/86650 * c-family/c-format.c (gcc_tdiag_char_table): Update comment for "%G". (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Same. (init_dynamic_diag_info): Update from "gcall *" to "gimple *". * c-format.h (T89_G): Update to be "gimple *" rather than "gcall *". (local_gcall_ptr_node): Rename... (local_gimple_ptr_node): ...to this. gcc/cp/ChangeLog: PR tree-optimization/86650 * error.c (cp_printer): Move usage of EXPR_LOCATION (t) and TREE_BLOCK (t) from within percent_K_format to this callsite. gcc/ChangeLog: PR tree-optimization/86650 * gimple-pretty-print.c (percent_G_format): Accept a "gimple *" rather than a "gcall *". Directly pass the data of interest to percent_K_format, rather than building a temporary CALL_EXPR to hold it. * gimple-fold.c (gimple_fold_builtin_strncpy): Adjust. (gimple_fold_builtin_strncat): Adjust. * gimple-ssa-warn-restrict.h (check_bounds_or_overlap): Replace gcall* argument with gimple*. * gimple-ssa-warn-restrict.c (check_call): Same. (wrestrict_dom_walker::before_dom_children): Same. (builtin_access::builtin_access): Same. (check_bounds_or_overlap): Same (maybe_diag_overlap): Same. (maybe_diag_offset_bounds): Same. * tree-diagnostic.c (default_tree_printer): Move usage of EXPR_LOCATION (t) and TREE_BLOCK (t) from within percent_K_format to this callsite. * tree-pretty-print.c (percent_K_format): Add argument. * tree-pretty-print.h: Add argument. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Adjust. * tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Adjust. (maybe_diag_stxncpy_trunc): Same. (handle_builtin_stxncpy): Same. (handle_builtin_strcat): Same. gcc/testsuite/ChangeLog: PR tree-optimization/86650 * gcc.dg/format/gcc_diag-10.c: Adjust. From-SVN: r263239
2018-06-08Remove MPXMartin Liska
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
2018-02-05PR tree-optimization/83369 - Missing diagnostics during inliningMartin Sebor
gcc/ChangeLog: PR tree-optimization/83369 * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Use %G to print inlining context. gcc/testsuite/ChangeLog: PR tree-optimization/83369 gcc.dg/Wnonnull.c: New test. From-SVN: r257400
2018-01-03Update copyright years.Jakub Jelinek
From-SVN: r256169
2017-12-20poly_int: get_addr_base_and_unit_offsetRichard Sandiford
This patch changes the values returned by get_addr_base_and_unit_offset from HOST_WIDE_INT to poly_int64. maxsize in gimple_fold_builtin_memory_op goes from HOST_WIDE_INT to poly_uint64 (rather than poly_int) to match the previous use of tree_fits_uhwi_p. 2017-12-20 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-dfa.h (get_addr_base_and_unit_offset_1): Return the offset as a poly_int64_pod rather than a HOST_WIDE_INT. (get_addr_base_and_unit_offset): Likewise. * tree-dfa.c (get_addr_base_and_unit_offset_1): Likewise. (get_addr_base_and_unit_offset): Likewise. * doc/match-and-simplify.texi: Change off from HOST_WIDE_INT to poly_int64 in example. * fold-const.c (fold_binary_loc): Update call to get_addr_base_and_unit_offset. * gimple-fold.c (gimple_fold_builtin_memory_op): Likewise. (maybe_canonicalize_mem_ref_addr): Likewise. (gimple_fold_stmt_to_constant_1): Likewise. * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Likewise. * ipa-param-manipulation.c (ipa_modify_call_arguments): Likewise. * match.pd: Likewise. * omp-low.c (lower_omp_target): Likewise. * tree-sra.c (build_ref_for_offset): Likewise. (build_debug_ref_for_model): Likewise. * tree-ssa-address.c (maybe_fold_tmr): Likewise. * tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Likewise. * tree-ssa-ccp.c (optimize_memcpy): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. (constant_pointer_difference): Likewise. * tree-ssa-loop-niter.c (expand_simple_operations): Likewise. * tree-ssa-phiopt.c (jump_function_from_stmt): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa-sccvn.c (vn_reference_fold_indirect): Likewise. (vn_reference_maybe_forwprop_address, vn_reference_lookup_3): Likewise. (set_ssa_val_to): Likewise. * tree-ssa-strlen.c (get_addr_stridx, addr_stridxptr) (maybe_diag_stxncpy_trunc): Likewise. * tree-vrp.c (vrp_prop::check_array_ref): Likewise. * tree.c (build_simple_mem_ref_loc): Likewise. (array_at_struct_end_p): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255887
2017-12-07Make more use of VECTOR_CST_ENCODED_ELTRichard Sandiford
This patch makes various bits of code operate directly on the new VECTOR_CST encoding, instead of using VECTOR_CST_ELT on all elements of the vector. Previous patches handled operations that produce a new VECTOR_CST, while this patch handles things like predicates. It also makes print_node dump the encoding instead of the full vector that the encoding represents. 2017-12-07 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-vector-builder.h (tree_vector_builder::binary_encoded_nelts): Declare. * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts): New function. * fold-const.c (negate_expr_p): Likewise. (operand_equal_p, fold_checksum_tree): Likewise. * tree-loop-distribution.c (const_with_all_bytes_same): Likewise. * tree.c (integer_zerop, integer_onep, integer_all_onesp, real_zerop) (real_onep, real_minus_onep, add_expr, initializer_zerop): Likewise. (uniform_vector_p): Likewise. * varasm.c (const_hash_1, compare_constant): Likewise. * tree-ssa-ccp.c: Include tree-vector-builder.h. (valid_lattice_transition): Operate directly on the VECTOR_CST encoding. * ipa-icf.c: Include tree-vector-builder.h. (sem_variable::equals): Operate directly on the VECTOR_CST encoding. * print-tree.c (print_node): Print encoding of VECTOR_CSTs. From-SVN: r255480
2017-11-30spellcheck-tree.c (test_find_closest_identifier): Use ; instead of ;;.Jakub Jelinek
* spellcheck-tree.c (test_find_closest_identifier): Use ; instead of ;;. * gengtype-state.c (read_state_pair): Likewise. * gimple-fold.c (gimple_fold_builtin_string_compare): Likewise. * sel-sched-dump.c (dump_insn_rtx_1): Likewise. * ipa-cp.c (intersect_aggregates_with_edge): Likewise. * ifcvt.c (noce_try_store_flag_constants): Likewise. * tree-ssa-ccp.c (ccp_finalize): Likewise. * omp-grid.c (grid_process_kernel_body_copy): Likewise. * builtins.c (fold_builtin_3): Likewise. * graphite-scop-detection.c (scop_detection::stmt_has_simple_data_refs_p): Likewise. * hsa-gen.c (hsa_function_representation::hsa_function_representation): Likewise. c/ * c-parser.c (c_parser_postfix_expression): Use ; instead of ;;. jit/ * jit-recording.c (recording::memento_of_new_rvalue_from_const <long>::write_reproducer): Use ; instead of ;;. lto/ * lto.c (create_subid_section_table): Use ; instead of ;;. objc/ * objc-next-runtime-abi-01.c (generate_dispatch_table): Use ; instead of ;;. From-SVN: r255284
2017-11-01tree-ssa-ccp.c (ccp_folder): New class derived from substitute_and_fold_engine.Jeff Law
* tree-ssa-ccp.c (ccp_folder): New class derived from substitute_and_fold_engine. (ccp_folder::get_value): New member function. (ccp_folder::fold_stmt): Renamed from ccp_fold_stmt. (ccp_fold_stmt): Remove prototype. (ccp_finalize): Call substitute_and_fold from the ccp_class. * tree-ssa-copy.c (copy_folder): New class derived from substitute_and_fold_engine. (copy_folder::get_value): Renamed from get_value. (fini_copy_prop): Call substitute_and_fold from copy_folder class. * tree-vrp.c (vrp_folder): New class derived from substitute_and_fold_engine. (vrp_folder::fold_stmt): Renamed from vrp_fold_stmt. (vrp_folder::get_value): New member function. (vrp_finalize): Call substitute_and_fold from vrp_folder class. (evrp_dom_walker::before_dom_children): Similarly for replace_uses_in. * tree-ssa-propagate.h (substitute_and_fold_engine): New class to provide a class interface to folder/substitute routines. (ssa_prop_fold_stmt_fn): Remove typedef. (ssa_prop_get_value_fn): Likewise. (subsitute_and_fold): Remove prototype. (replace_uses_in): Likewise. * tree-ssa-propagate.c (substitute_and_fold_engine::replace_uses_in): Renamed from replace_uses_in. Call the virtual member function (substitute_and_fold_engine::replace_phi_args_in): Similarly. (substitute_and_fold_dom_walker): Remove initialization of data member entries for calbacks. Add substitute_and_fold_engine member and initialize it. (substitute_and_fold_dom_walker::before_dom_children0: Use the member functions for get_value, replace_phi_args_in c replace_uses_in, and fold_stmt calls. (substitute_and_fold_engine::substitute_and_fold): Renamed from substitute_and_fold. Remove assert. Update ctor call. From-SVN: r254330
2017-11-01tree-ssa-propagate.h (ssa_prop_visit_stmt_fn): Remove typedef.Jeff Law
* tree-ssa-propagate.h (ssa_prop_visit_stmt_fn): Remove typedef. (ssa_prop_visit_phi_fn): Likewise. (class ssa_propagation_engine): New class to provide an interface into ssa_propagate. * tree-ssa-propagate.c (ssa_prop_visit_stmt): Remove file scoped variable. (ssa_prop_visit_phi): Likewise. (ssa_propagation_engine::simulate_stmt): Moved into class. Call visit_phi/visit_stmt from the class rather than via file scoped static variables. (ssa_propagation_engine::simulate_block): Moved into class. (ssa_propagation_engine::process_ssa_edge_worklist): Similarly. (ssa_propagation_engine::ssa_propagate): Similarly. No longer set file scoped statics for the visit_stmt/visit_phi callbacks. * tree-complex.c (complex_propagate): New class derived from ssa_propagation_engine. (complex_propagate::visit_stmt): Renamed from complex_visit_stmt. (complex_propagate::visit_phi): Renamed from complex_visit_phi. (tree_lower_complex): Call ssa_propagate via the complex_propagate class. * tree-ssa-ccp.c: (ccp_propagate): New class derived from ssa_propagation_engine. (ccp_propagate::visit_phi): Renamed from ccp_visit_phi_node. (ccp_propagate::visit_stmt): Renamed from ccp_visit_stmt. (do_ssa_ccp): Call ssa_propagate from the ccp_propagate class. * tree-ssa-copy.c (copy_prop): New class derived from ssa_propagation_engine. (copy_prop::visit_stmt): Renamed from copy_prop_visit_stmt. (copy_prop::visit_phi): Renamed from copy_prop_visit_phi_node. (execute_copy_prop): Call ssa_propagate from the copy_prop class. * tree-vrp.c (vrp_prop): New class derived from ssa_propagation_engine. (vrp_prop::visit_stmt): Renamed from vrp_visit_stmt. (vrp_prop::visit_phi): Renamed from vrp_visit_phi_node. (execute_vrp): Call ssa_propagate from the vrp_prop class. From-SVN: r254329
2017-10-19asan.c (handle_builtin_alloca): Deal with all alloca variants.Eric Botcazou
* asan.c (handle_builtin_alloca): Deal with all alloca variants. (get_mem_refs_of_builtin_call): Likewise. * builtins.c (expand_builtin_apply): Adjust call to allocate_dynamic_stack_space. (expand_builtin_alloca): For __builtin_alloca_with_align_and_max, pass the third argument to allocate_dynamic_stack_space, otherwise -1. (expand_builtin): Deal with all alloca variants. (is_inexpensive_builtin): Likewise. * builtins.def (BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX): New. * calls.c (special_function_p): Deal with all alloca variants. (initialize_argument_information): Adjust call to allocate_dynamic_stack_space. (expand_call): Likewise. * cfgexpand.c (expand_call_stmt): Deal with all alloca variants. * doc/extend.texi (Built-ins): Add __builtin_alloca_with_align_and_max * explow.c (allocate_dynamic_stack_space): Add MAX_SIZE parameter and use it for the stack usage computation. * explow.h (allocate_dynamic_stack_space): Adjust prototype. * function.c (gimplify_parameters): Turn BUILT_IN_ALLOCA_WITH_ALIGN into BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX and pass maximum size. * gimple-ssa-warn-alloca.c (alloca_call_type): Simplify control flow. Take into account 3rd argument of __builtin_alloca_with_align_and_max. (in_loop_p): Remove first argument and useless check. (pass_walloca::execute): Remove useless test and adjust call to above. * gimple.c (gimple_build_call_from_tree): Deal with all alloc variants * gimplify.c (gimplify_vla_decl): Turn BUILT_IN_ALLOCA_WITH_ALIGN into BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX and pass maximum size. (gimplify_call_expr): Deal with all alloca variants. * hsa-gen.c (gen_hsa_alloca): Likewise. (gen_hsa_insns_for_call): Likewise. * ipa-pure-const.c (special_builtin_state): Likewise. * tree-chkp.c (chkp_build_returned_bound): Likewise. * tree-object-size.c (alloc_object_size): Likewise. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise. (call_may_clobber_ref_p_1): Likewise. * tree-ssa-ccp.c (evaluate_stmt): Likewise. (ccp_fold_stmt): Likewise. (optimize_stack_restore): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. (mark_all_reaching_defs_necessary_1): Likewise. (propagate_necessity): Likewise. (eliminate_unnecessary_stmts): Likewise. * tree.c (build_common_builtin_nodes): Build BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX. * tree.h (ALLOCA_FUNCTION_CODE_P): New macro. (CASE_BUILT_IN_ALLOCA): Likewise. * varasm.c (incorporeal_function_p): Deal with all alloca variants. c-family/ * c-common.c (check_builtin_function_arguments): Also check arguments of __builtin_alloca_with_align_and_max. From-SVN: r253901
2017-10-10Require wi::to_wide for treesRichard Sandiford
The wide_int routines allow things like: wi::add (t, 1) to add 1 to an INTEGER_CST T in its native precision. But we also have: wi::to_offset (t) // Treat T as an offset_int wi::to_widest (t) // Treat T as a widest_int Recently we also gained: wi::to_wide (t, prec) // Treat T as a wide_int in preccision PREC This patch therefore requires: wi::to_wide (t) when operating on INTEGER_CSTs in their native precision. This is just as efficient, and makes it clearer that a deliberate choice is being made to treat the tree as a wide_int in its native precision. This also removes the inconsistency that a) INTEGER_CSTs in their native precision can be used without an accessor but must use wi:: functions instead of C++ operators b) the other forms need an explicit accessor but the result can be used with C++ operators. It also helps with SVE, where there's the additional possibility that the tree could be a runtime value. 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * wide-int.h (wide_int_ref_storage): Make host_dependent_precision a template parameter. (WIDE_INT_REF_FOR): Update accordingly. * tree.h (wi::int_traits <const_tree>): Delete. (wi::tree_to_widest_ref, wi::tree_to_offset_ref): New typedefs. (wi::to_widest, wi::to_offset): Use them. Expand commentary. (wi::tree_to_wide_ref): New typedef. (wi::to_wide): New function. * calls.c (get_size_range): Use wi::to_wide when operating on trees as wide_ints. * cgraph.c (cgraph_node::create_thunk): Likewise. * config/i386/i386.c (ix86_data_alignment): Likewise. (ix86_local_alignment): Likewise. * dbxout.c (stabstr_O): Likewise. * dwarf2out.c (add_scalar_info, gen_enumeration_type_die): Likewise. * expr.c (const_vector_from_tree): Likewise. * fold-const-call.c (host_size_t_cst_p, fold_const_call_1): Likewise. * fold-const.c (may_negate_without_overflow_p, negate_expr_p) (fold_negate_expr_1, int_const_binop_1, const_binop) (fold_convert_const_int_from_real, optimize_bit_field_compare) (all_ones_mask_p, sign_bit_p, unextend, extract_muldiv_1) (fold_div_compare, fold_single_bit_test, fold_plusminus_mult_expr) (pointer_may_wrap_p, expr_not_equal_to, fold_binary_loc) (fold_ternary_loc, multiple_of_p, fold_negate_const, fold_abs_const) (fold_not_const, round_up_loc): Likewise. * gimple-fold.c (gimple_fold_indirect_ref): Likewise. * gimple-ssa-warn-alloca.c (alloca_call_type_by_arg): Likewise. (alloca_call_type): Likewise. * gimple.c (preprocess_case_label_vec_for_gimple): Likewise. * godump.c (go_output_typedef): Likewise. * graphite-sese-to-poly.c (tree_int_to_gmp): Likewise. * internal-fn.c (get_min_precision): Likewise. * ipa-cp.c (ipcp_store_vr_results): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::ipa_polymorphic_call_context): Likewise. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise. (ipa_modify_call_arguments): Likewise. * match.pd: Likewise. * omp-low.c (scan_omp_1_op, lower_omp_ordered_clauses): Likewise. * print-tree.c (print_node_brief, print_node): Likewise. * stmt.c (expand_case): Likewise. * stor-layout.c (layout_type): Likewise. * tree-affine.c (tree_to_aff_combination): Likewise. * tree-cfg.c (group_case_labels_stmt): Likewise. * tree-data-ref.c (dr_analyze_indices): Likewise. (prune_runtime_alias_test_list): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-inline.c (remap_gimple_op_r, copy_tree_body_r): Likewise. * tree-predcom.c (is_inv_store_elimination_chain): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-scalar-evolution.c (iv_can_overflow_p): Likewise. (simple_iv_with_niters): Likewise. * tree-ssa-address.c (addr_for_mem_ref): Likewise. * tree-ssa-ccp.c (ccp_finalize, evaluate_stmt): Likewise. * tree-ssa-loop-ivopts.c (constant_multiple_of): Likewise. * tree-ssa-loop-niter.c (split_to_var_and_offset) (refine_value_range_using_guard, number_of_iterations_ne_max) (number_of_iterations_lt_to_ne, number_of_iterations_lt) (get_cst_init_from_scev, record_nonwrapping_iv) (scev_var_range_cant_overflow): Likewise. * tree-ssa-phiopt.c (minmax_replacement): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. * tree-ssa-sccvn.c (vn_reference_fold_indirect): Likewise. (vn_reference_maybe_forwprop_address, valueized_wider_op): Likewise. * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Likewise. * tree-ssa-uninit.c (is_pred_expr_subset_of): Likewise. * tree-ssanames.c (set_nonzero_bits, get_nonzero_bits): Likewise. * tree-switch-conversion.c (collect_switch_conv_info, array_value_type) (dump_case_nodes, try_switch_expansion): Likewise. * tree-vect-loop-manip.c (vect_gen_vector_loop_niters): Likewise. (vect_do_peeling): Likewise. * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise. * tree-vect-stmts.c (vectorizable_load): Likewise. * tree-vrp.c (compare_values_warnv, vrp_int_const_binop): Likewise. (zero_nonzero_bits_from_vr, ranges_from_anti_range): Likewise. (extract_range_from_binary_expr_1, adjust_range_with_scev): Likewise. (overflow_comparison_p_1, register_edge_assert_for_2): Likewise. (is_masked_range_test, find_switch_asserts, maybe_set_nonzero_bits) (vrp_evaluate_conditional_warnv_with_ops, intersect_ranges): Likewise. (range_fits_type_p, two_valued_val_range_p, vrp_finalize): Likewise. (evrp_dom_walker::before_dom_children): Likewise. * tree.c (cache_integer_cst, real_value_from_int_cst, integer_zerop) (integer_all_onesp, integer_pow2p, integer_nonzerop, tree_log2) (tree_floor_log2, tree_ctz, mem_ref_offset, tree_int_cst_sign_bit) (tree_int_cst_sgn, get_unwidened, int_fits_type_p): Likewise. (get_type_static_bounds, num_ending_zeros, drop_tree_overflow) (get_range_pos_neg): Likewise. * ubsan.c (ubsan_expand_ptr_ifn): Likewise. * config/darwin.c (darwin_mergeable_constant_section): Likewise. * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Likewise. * config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise. * config/avr/avr.c (avr_fold_builtin): Likewise. * config/bfin/bfin.c (bfin_local_alignment): Likewise. * config/msp430/msp430.c (msp430_attr): Likewise. * config/nds32/nds32.c (nds32_insert_attributes): Likewise. * config/powerpcspe/powerpcspe-c.c (altivec_resolve_overloaded_builtin): Likewise. * config/powerpcspe/powerpcspe.c (rs6000_aggregate_candidate) (rs6000_expand_ternop_builtin): Likewise. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Likewise. * config/rs6000/rs6000.c (rs6000_aggregate_candidate): Likewise. (rs6000_expand_ternop_builtin): Likewise. * config/s390/s390.c (s390_handle_hotpatch_attribute): Likewise. gcc/ada/ * gcc-interface/decl.c (annotate_value): Use wi::to_wide when operating on trees as wide_ints. gcc/c/ * c-parser.c (c_parser_cilk_clause_vectorlength): Use wi::to_wide when operating on trees as wide_ints. * c-typeck.c (build_c_cast, c_finish_omp_clauses): Likewise. (c_tree_equal): Likewise. gcc/c-family/ * c-ada-spec.c (dump_generic_ada_node): Use wi::to_wide when operating on trees as wide_ints. * c-common.c (pointer_int_sum): Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-warn.c (match_case_to_enum_1): Likewise. (c_do_switch_warnings): Likewise. (maybe_warn_shift_overflow): Likewise. gcc/cp/ * cvt.c (ignore_overflows): Use wi::to_wide when operating on trees as wide_ints. * decl.c (check_array_designated_initializer): Likewise. * mangle.c (write_integer_cst): Likewise. * semantics.c (cp_finish_omp_clause_depend_sink): Likewise. gcc/fortran/ * target-memory.c (gfc_interpret_logical): Use wi::to_wide when operating on trees as wide_ints. * trans-const.c (gfc_conv_tree_to_mpz): Likewise. * trans-expr.c (gfc_conv_cst_int_power): Likewise. * trans-intrinsic.c (trans_this_image): Likewise. (gfc_conv_intrinsic_bound): Likewise. (conv_intrinsic_cobound): Likewise. gcc/lto/ * lto.c (compare_tree_sccs_1): Use wi::to_wide when operating on trees as wide_ints. gcc/objc/ * objc-act.c (objc_decl_method_attributes): Use wi::to_wide when operating on trees as wide_ints. From-SVN: r253595
2017-10-09Allow non-wi <op> wiRichard Sandiford
This patch uses global rather than member operators for wide-int.h, so that the first operand can be a non-wide-int type. The patch also removes the and_not and or_not member functions. It was already inconsistent to have member functions for these two operations (one of which was never used) and not other wi:: ones like udiv. After the operator change, we'd have the additional inconsistency that "non-wi & wi" would work but "non-wi.and_not (wi)" wouldn't. 2017-10-09 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * wide-int.h (WI_BINARY_OPERATOR_RESULT): New macro. (WI_BINARY_PREDICATE_RESULT): Likewise. (wi::binary_traits::operator_result): New type. (wi::binary_traits::predicate_result): Likewise. (generic_wide_int::operator~, unary generic_wide_int::operator-) (generic_wide_int::operator==, generic_wide_int::operator!=) (generic_wide_int::operator&, generic_wide_int::and_not) (generic_wide_int::operator|, generic_wide_int::or_not) (generic_wide_int::operator^, generic_wide_int::operator+ (binary generic_wide_int::operator-, generic_wide_int::operator*): Delete. (operator~, unary operator-, operator==, operator!=, operator&) (operator|, operator^, operator+, binary operator-, operator*): New functions. * expr.c (get_inner_reference): Use wi::bit_and_not. * fold-const.c (fold_binary_loc): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. * tree-ssa-ccp.c (get_value_from_alignment): Likewise. (bit_value_binop): Likewise. * tree-ssa-math-opts.c (find_bswap_or_nop_load): Likewise. * tree-vrp.c (zero_nonzero_bits_from_vr): Likewise. (extract_range_from_binary_expr_1): Likewise. (masked_increment): Likewise. (simplify_bit_ops_using_ranges): Likewise. From-SVN: r253539
2017-09-21Tighten tree-ssa-ccp.c:get_value_for_expr conditionRichard Sandiford
bit_value_unop and bit_value_binop require constant values to be INTEGER_CSTs: gcc_assert ((rval.lattice_val == CONSTANT && TREE_CODE (rval.value) == INTEGER_CST) || wi::sext (rval.mask, TYPE_PRECISION (TREE_TYPE (rhs))) == -1); However, when deciding whether to record a constant value, the for_bits_p handling in get_value_for_expr used a negative test for ADDR_EXPR: else if (is_gimple_min_invariant (expr) && (!for_bits_p || TREE_CODE (expr) != ADDR_EXPR)) This patch uses a positive test for INTEGER_CST instead. Existing tests showed the need for this once polynomial constants are added. 2017-09-21 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-ssa-ccp.c (get_value_for_expr): Use a positive test for INTEGER_CST rather than a negative test for ADDR_EXPR. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r253056
2017-08-08trans.c: Include header files.Martin Liska
. 2017-08-08 Martin Liska <mliska@suse.cz> * gcc-interface/trans.c: Include header files. 2017-08-08 Martin Liska <mliska@suse.cz> * objc-gnu-runtime-abi-01.c: Include header files. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * asan.c: Include header files. * attribs.c (build_decl_attribute_variant): New function moved from tree.[ch]. (build_type_attribute_qual_variant): Likewise. (cmp_attrib_identifiers): Likewise. (simple_cst_list_equal): Likewise. (omp_declare_simd_clauses_equal): Likewise. (attribute_value_equal): Likewise. (comp_type_attributes): Likewise. (build_type_attribute_variant): Likewise. (lookup_ident_attribute): Likewise. (remove_attribute): Likewise. (merge_attributes): Likewise. (merge_type_attributes): Likewise. (merge_decl_attributes): Likewise. (merge_dllimport_decl_attributes): Likewise. (handle_dll_attribute): Likewise. (attribute_list_equal): Likewise. (attribute_list_contained): Likewise. * attribs.h (lookup_attribute): New function moved from tree.[ch]. (lookup_attribute_by_prefix): Likewise. * bb-reorder.c: Include header files. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * convert.c: Likewise. * dwarf2out.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimplify.c: Likewise. * hsa-common.c: Likewise. * hsa-gen.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * lto-cgraph.c: Likewise. * omp-expand.c: Likewise. * omp-general.c: Likewise. * omp-low.c: Likewise. * omp-offload.c: Likewise. * omp-simd-clone.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * sancov.c: Likewise. * sanopt.c: Likewise. * symtab.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-chkp.c: Likewise. * tree-eh.c: Likewise. * tree-into-ssa.c: Likewise. * tree-object-size.c: Likewise. * tree-parloops.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * tree.c: Remove functions moved to attribs.[ch]. * tree.h: Likewise. * config/aarch64/aarch64.c: Add attrs.h header file. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/powerpcspe/powerpcspe.c: Likewise. * config/riscv/riscv.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * call.c: Include header files. * cp-gimplify.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * init.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * lto-lang.c: Include header files. * lto-symtab.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-convert.c: Include header files. * c-typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-ada-spec.c: Include header files. * c-ubsan.c: Likewise. * c-warn.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * trans-types.c: Include header files. From-SVN: r250946
2017-05-26re PR tree-optimization/80842 (ICE at -O3 on x86_64-linux-gnu in ↵Richard Biener
"set_lattice_value") 2017-05-26 Richard Biener <rguenther@suse.de> PR tree-optimization/80842 * tree-ssa-ccp.c (set_lattice_value): Always meet with the old value. * gcc.dg/torture/pr80842.c: New testcase. From-SVN: r248482
2017-05-16Add default value for last argument of dump functions.Martin Liska
2017-05-16 Martin Liska <mliska@suse.cz> * parser.c (cp_lexer_print_token): Add default value for flags argument of print_gimple_stmt, print_gimple_expr, print_generic_stmt and print_generic_expr. 2017-05-16 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_edge::resolve_speculation): Add default value for flags argument of print_gimple_stmt, print_gimple_expr, print_generic_stmt and print_generic_expr. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * coretypes.h: Likewise. * except.c (dump_eh_tree): Likewise. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise. * gimple-pretty-print.h: Likewise. * gimple-ssa-backprop.c (dump_usage_prefix): Likewise. (backprop::push_to_worklist): Likewise. (backprop::pop_from_worklist): Likewise. (backprop::process_use): Likewise. (backprop::intersect_uses): Likewise. (note_replacement): Likewise. * gimple-ssa-store-merging.c (pass_store_merging::terminate_all_aliasing_chains): Likewise. (imm_store_chain_info::coalesce_immediate_stores): Likewise. (pass_store_merging::execute): Likewise. * gimple-ssa-strength-reduction.c (dump_candidate): Likewise. (ssa_base_cand_dump_callback): Likewise. (dump_incr_vec): Likewise. (replace_refs): Likewise. (replace_mult_candidate): Likewise. (create_add_on_incoming_edge): Likewise. (create_phi_basis): Likewise. (insert_initializers): Likewise. (all_phi_incrs_profitable): Likewise. (introduce_cast_before_cand): Likewise. (replace_one_candidate): Likewise. * gimplify.c (gimplify_expr): Likewise. * graphite-isl-ast-to-gimple.c (is_valid_rename): Likewise. (set_rename): Likewise. (rename_uses): Likewise. (copy_loop_phi_nodes): Likewise. (add_close_phis_to_merge_points): Likewise. (copy_loop_close_phi_args): Likewise. (copy_cond_phi_args): Likewise. (graphite_copy_stmts_from_block): Likewise. (translate_pending_phi_nodes): Likewise. * graphite-poly.c (print_pdr): Likewise. (dump_gbb_cases): Likewise. (dump_gbb_conditions): Likewise. (print_scop_params): Likewise. * graphite-scop-detection.c (build_cross_bb_scalars_def): Likewise. (build_cross_bb_scalars_use): Likewise. (gather_bbs::before_dom_children): Likewise. * hsa-dump.c (dump_hsa_immed): Likewise. * ipa-cp.c (print_ipcp_constant_value): Likewise. (get_replacement_map): Likewise. * ipa-inline-analysis.c (dump_condition): Likewise. (estimate_function_body_sizes): Likewise. * ipa-polymorphic-call.c (check_stmt_for_type_change): Likewise. (ipa_polymorphic_call_context::get_dynamic_type): Likewise. * ipa-prop.c (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_modify_expr): Likewise. (ipa_dump_param_adjustments): Likewise. (ipa_dump_agg_replacement_values): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * ipa-pure-const.c (check_stmt): Likewise. (pass_nothrow::execute): Likewise. * ipa-split.c (execute_split_functions): Likewise. * omp-offload.c (dump_oacc_loop_part): Likewise. (dump_oacc_loop): Likewise. * trans-mem.c (tm_log_emit): Likewise. (tm_memopt_accumulate_memops): Likewise. (dump_tm_memopt_set): Likewise. (dump_tm_memopt_transform): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. (print_loop): Likewise. * tree-chkp-opt.c (chkp_print_addr): Likewise. (chkp_gather_checks_info): Likewise. (chkp_get_check_result): Likewise. (chkp_remove_check_if_pass): Likewise. (chkp_use_outer_bounds_if_possible): Likewise. (chkp_reduce_bounds_lifetime): Likewise. * tree-chkp.c (chkp_register_addr_bounds): Likewise. (chkp_mark_completed_bounds): Likewise. (chkp_register_incomplete_bounds): Likewise. (chkp_mark_invalid_bounds): Likewise. (chkp_maybe_copy_and_register_bounds): Likewise. (chkp_build_returned_bound): Likewise. (chkp_get_bound_for_parm): Likewise. (chkp_build_bndldx): Likewise. (chkp_get_bounds_by_definition): Likewise. (chkp_generate_extern_var_bounds): Likewise. (chkp_get_bounds_for_decl_addr): Likewise. * tree-chrec.c (chrec_apply): Likewise. * tree-data-ref.c (dump_data_reference): Likewise. (dump_subscript): Likewise. (dump_data_dependence_relation): Likewise. (analyze_overlapping_iterations): Likewise. * tree-inline.c (expand_call_inline): Likewise. (tree_function_versioning): Likewise. * tree-into-ssa.c (dump_defs_stack): Likewise. (dump_currdefs): Likewise. (dump_names_replaced_by): Likewise. (dump_update_ssa): Likewise. (update_ssa): Likewise. * tree-object-size.c (pass_object_sizes::execute): Likewise. * tree-parloops.c (build_new_reduction): Likewise. (try_create_reduction_list): Likewise. (ref_conflicts_with_region): Likewise. (oacc_entry_exit_ok_1): Likewise. (oacc_entry_exit_single_gang): Likewise. * tree-pretty-print.h: Likewise. * tree-scalar-evolution.c (set_scalar_evolution): Likewise. (get_scalar_evolution): Likewise. (add_to_evolution): Likewise. (get_loop_exit_condition): Likewise. (analyze_evolution_in_loop): Likewise. (analyze_initial_condition): Likewise. (analyze_scalar_evolution): Likewise. (instantiate_scev): Likewise. (number_of_latch_executions): Likewise. (gather_chrec_stats): Likewise. (final_value_replacement_loop): Likewise. (scev_const_prop): Likewise. * tree-sra.c (dump_access): Likewise. (disqualify_candidate): Likewise. (create_access): Likewise. (reject): Likewise. (maybe_add_sra_candidate): Likewise. (create_access_replacement): Likewise. (analyze_access_subtree): Likewise. (analyze_all_variable_accesses): Likewise. (sra_modify_assign): Likewise. (initialize_constant_pool_replacements): Likewise. (find_param_candidates): Likewise. (decide_one_param_reduction): Likewise. (replace_removed_params_ssa_names): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Likewise. * tree-ssa-copy.c (dump_copy_of): Likewise. (copy_prop_visit_cond_stmt): Likewise. * tree-ssa-dce.c (mark_operand_necessary): Likewise. * tree-ssa-dom.c (pass_dominator::execute): Likewise. (record_equivalences_from_stmt): Likewise. * tree-ssa-dse.c (compute_trims): Likewise. (delete_dead_call): Likewise. (delete_dead_assignment): Likewise. * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise. (forward_propagate_into_cond): Likewise. (pass_forwprop::execute): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_worker): Likewise. (execute_sm): Likewise. * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise. (remove_exits_and_undefined_stmts): Likewise. (remove_redundant_iv_tests): Likewise. * tree-ssa-loop-ivopts.c (dump_use): Likewise. (adjust_iv_update_pos): Likewise. * tree-ssa-math-opts.c (bswap_replace): Likewise. * tree-ssa-phiopt.c (factor_out_conditional_conversion): Likewise. (value_replacement): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-ssa-pre.c (print_pre_expr): Likewise. (get_representative_for): Likewise. (create_expression_by_pieces): Likewise. (insert_into_preds_of_block): Likewise. (eliminate_insert): Likewise. (eliminate_dom_walker::before_dom_children): Likewise. (eliminate): Likewise. (remove_dead_inserted_code): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-reassoc.c (get_rank): Likewise. (eliminate_duplicate_pair): Likewise. (eliminate_plus_minus_pair): Likewise. (eliminate_not_pairs): Likewise. (undistribute_ops_list): Likewise. (eliminate_redundant_comparison): Likewise. (update_range_test): Likewise. (optimize_range_tests_var_bound): Likewise. (optimize_vec_cond_expr): Likewise. (rewrite_expr_tree): Likewise. (rewrite_expr_tree_parallel): Likewise. (linearize_expr): Likewise. (break_up_subtract): Likewise. (linearize_expr_tree): Likewise. (attempt_builtin_powi): Likewise. (attempt_builtin_copysign): Likewise. (transform_stmt_to_copy): Likewise. (transform_stmt_to_multiply): Likewise. (dump_ops_vector): Likewise. * tree-ssa-sccvn.c (vn_nary_build_or_lookup_1): Likewise. (print_scc): Likewise. (set_ssa_val_to): Likewise. (visit_reference_op_store): Likewise. (visit_use): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. (run_scc_vn): Likewise. * tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr): Likewise. (expr_hash_elt::print): Likewise. (const_and_copies::pop_to_marker): Likewise. (const_and_copies::record_const_or_copy_raw): Likewise. * tree-ssa-structalias.c (compute_dependence_clique): Likewise. * tree-ssa-uninit.c (collect_phi_def_edges): Likewise. (dump_predicates): Likewise. (find_uninit_use): Likewise. (warn_uninitialized_phi): Likewise. (pass_late_warn_uninitialized::execute): Likewise. * tree-ssa.c (verify_vssa): Likewise. (verify_ssa): Likewise. (maybe_optimize_var): Likewise. * tree-vrp.c (dump_value_range): Likewise. (dump_all_value_ranges): Likewise. (dump_asserts_for): Likewise. (register_edge_assert_for_2): Likewise. (vrp_visit_cond_stmt): Likewise. (vrp_visit_switch_stmt): Likewise. (vrp_visit_stmt): Likewise. (vrp_visit_phi_node): Likewise. (simplify_cond_using_ranges_1): Likewise. (fold_predicate_in): Likewise. (evrp_dom_walker::before_dom_children): Likewise. (evrp_dom_walker::push_value_range): Likewise. (evrp_dom_walker::pop_value_range): Likewise. (execute_early_vrp): Likewise. From-SVN: r248113
2017-05-10tree-cfg.c (gimple_seq_unreachable_p): New function.Peter Bergner
gcc/ * tree-cfg.c (gimple_seq_unreachable_p): New function. (assert_unreachable_fallthru_edge_p): Use it. (group_case_labels_stmt): Likewise. * tree-cfg.h: Prototype it. * stmt.c: Include cfghooks.h and tree-cfg.h. (emit_case_dispatch_table) <gap_label>: New local variable. Use it to fill dispatch table gaps. Test for default_label before updating probabilities. (expand_case) <default_label>: Remove unneeded initialization. Test for unreachable default case statement and remove its edge. Set default_label accordingly. * tree-ssa-ccp.c (optimize_unreachable): Update comment. gcc/testsuite/ * gcc.target/powerpc/pr51513.c: New test. * gcc.dg/predict-13.c: Replace __builtin_unreachable() with __builtin_abort(). * gcc.dg/predict-14.c: Likewise. From-SVN: r247844
2017-03-28re PR ipa/78644 (ICE: SIGSEGV in is_gimple_reg_type with -Og -fipa-cp)Richard Biener
2017-03-28 Richard Biener <rguenther@suse.de> PR tree-optimization/78644 * tree-ssa-ccp.c (evaluate_stmt): When we may not use the value of a simplification result we may not use it at all. * gcc.dg/pr78644-1.c: New testcase. * gcc.dg/pr78644-2.c: Likewise. From-SVN: r246534
2017-03-27re PR tree-optimization/80181 (ICE in set_lattice_value, at tree-ssa-ccp.c:505)Richard Biener
2017-03-27 Richard Biener <rguenther@suse.de> PR tree-optimization/80181 * tree-ssa-ccp.c (likely_value): UNDEFINED ^ X is UNDEFINED. * gcc.dg/torture/pr80181.c: New testcase. From-SVN: r246500
2017-03-03re PR middle-end/79805 (ICE (verify_flow_info failed) with ↵Jakub Jelinek
-fnon-call-exceptions -O) PR middle-end/79805 * internal-fn.def (ATOMIC_BIT_TEST_AND_SET, ATOMIC_BIT_TEST_AND_RESET, ATOMIC_BIT_TEST_AND_COMPLEMENT, ATOMIC_COMPARE_EXCHANGE): Remove ECF_NOTHROW. * gimple-fold.c (fold_builtin_atomic_compare_exchange): Set gimple_call_nothrow_p flag based on whether original builtin can throw. If it can, emit following stmts on the fallthrough edge. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Similarly, except don't create new bb if inserting just debug stmts on the edge, try to insert them on the fallthru bb or just reset debug stmts. * g++.dg/opt/pr79805.C: New test. From-SVN: r245882
2017-01-01Update copyright years.Jakub Jelinek
From-SVN: r243994
2016-12-21re PR bootstrap/78817 (stage2 bootstrap failure in vec.h:1613:5: error: ↵Jakub Jelinek
argument 1 null where non-null expected after r243661) PR bootstrap/78817 * tree-pass.h (make_pass_post_ipa_warn): Declare. * builtins.c (validate_arglist): Adjust get_nonnull_args call. Check for NULL pointer argument to nonnull arg here. (validate_arg): Revert 2016-12-14 changes. * calls.h (get_nonnull_args): Remove declaration. * tree-ssa-ccp.c: Include diagnostic-core.h. (pass_data_post_ipa_warn): New variable. (pass_post_ipa_warn): New class. (pass_post_ipa_warn::execute): New method. (make_pass_post_ipa_warn): New function. * tree.h (get_nonnull_args): Declare. * tree.c (get_nonnull_args): New function. * calls.c (maybe_warn_null_arg): Removed. (maybe_warn_null_arg): Removed. (initialize_argument_information): Revert 2016-12-14 changes. * passes.def: Add pass_post_ipa_warn after first ccp after IPA. c-family/ * c-common.c (struct nonnull_arg_ctx): New type. (check_function_nonnull): Return bool instead of void. Use nonnull_arg_ctx as context rather than just location_t. (check_nonnull_arg): Adjust for the new context type, set warned_p to true if a warning has been diagnosed. (check_function_arguments): Return bool instead of void. * c-common.h (check_function_arguments): Adjust prototype. c/ * c-typeck.c (build_function_call_vec): If check_function_arguments returns true, set TREE_NO_WARNING on CALL_EXPR. cp/ * typeck.c (cp_build_function_call_vec): If check_function_arguments returns true, set TREE_NO_WARNING on CALL_EXPR. * call.c (build_over_call): Likewise. From-SVN: r243874
2016-12-16re PR c/78408 (C loop initial declarations generate wrong code)Jakub Jelinek
PR c/78408 * tree-ssa-ccp.c: Include tree-dfa.h. (optimize_memcpy): New function. (pass_fold_builtins::execute): Use it. Remove useless conditional break after BUILT_IN_VA_*. * gcc.dg/pr78408-1.c: New test. * gcc.dg/pr78408-2.c: New test. From-SVN: r243753
2016-11-28re PR tree-optimization/78542 (wrong code at -Og results in endless loop)Richard Biener
2016-11-28 Richard Biener <rguenther@suse.de> PR tree-optimization/78542 * tree-ssa-ccp.c (evaluate_stmt): Only valueize simplification if allowed. * gcc.dg/torture/pr78542.c: New testcase. From-SVN: r242920
2016-11-18Add SET_DECL_MODERichard Sandiford
This may no longer be necessary with the current version of the SVE patches, but it does at least make things consistent with the TYPE_MODE/SET_TYPE_MODE split. gcc/ada/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE. gcc/c/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * c-decl.c (merge_decls): Use SET_DECL_MODE. (make_label, finish_struct): Likewise. gcc/cp/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * class.c (finish_struct_bits): Use SET_DECL_MODE. (build_base_field_1, layout_class_type, finish_struct_1): Likewise. * decl.c (make_label_decl): Likewise. * pt.c (tsubst_decl): Likewise. gcc/fortran/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * trans-common.c (build_common_decl): Use SET_DECL_MODE. * trans-decl.c (gfc_build_label_decl): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. gcc/lto/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * lto.c (offload_handle_link_vars): Use SET_DECL_MODE. gcc/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * tree.h (SET_DECL_MODE): New macro. * cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE. (expand_gimple_basic_block): Likewise. * function.c (split_complex_args): Likeise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise. * stor-layout.c (layout_decl, relayout_decl): Likewise. (finish_bitfield_representative): Likewise. * tree.c (make_node_stat): Likewise. * tree-inline.c (remap_ssa_name): Likewise. (tree_function_versioning): Likewise. * tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise. * tree-ssa.c (insert_debug_temp_for_var_def): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * varasm.c (make_debug_expr_from_rtl): Likewise. libcc1/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * plugin.cc (plugin_build_add_field): Use SET_DECL_MODE. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r242585