aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-reassoc.c
AgeCommit message (Collapse)Author
2019-11-112019-11-11 Richard Biener <rguenther@suse.de>Richard Biener
Backport from mainline 2019-06-25 Richard Biener <rguenther@suse.de> PR tree-optimization/90930 * tree-ssa-reassoc.c (reassociate_bb): Only rewrite expression into parallel form in the last pass instance. * gcc.dg/tree-ssa/reassoc-24.c: Adjust. * gcc.dg/tree-ssa/reassoc-25.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@278059 138bc75d-0d04-0410-961f-82ee72b054a4
2019-06-252019-06-21 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/90930 * tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited flag on new stmts to avoid re-processing them. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@272636 138bc75d-0d04-0410-961f-82ee72b054a4
2019-04-152019-04-15 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/90071 * tree-ssa-reassoc.c (init_range_entry): Do not pick up abnormal operands from def stmts. * gcc.dg/torture/pr90071.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@270369 138bc75d-0d04-0410-961f-82ee72b054a4
2019-01-232019-01-23 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/89008 * tree-ssa-reassoc.c (eliminate_using_constants): For * 0 do not leave another stray operand. * gcc.dg/torture/pr89008.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@268186 138bc75d-0d04-0410-961f-82ee72b054a4
2019-01-01 Update copyright years.Jakub Jelinek
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@267494 138bc75d-0d04-0410-961f-82ee72b054a4
2018-11-30 PR tree-optimization/88274Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_xor, optimize_range_tests_diff): If type has smaller precision than corresponding mode or if it has non-standard min/max, compute everything in a standard type for the precision. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@266701 138bc75d-0d04-0410-961f-82ee72b054a4
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@265372 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-22fix reassoc cut&pastoAlexandre Oliva
for gcc/ChangeLog * tree-ssa-reassoc.c (is_reassociable_op): Fix cut&pasto. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@263759 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-16 PR tree-optimization/86514Eric Botcazou
* tree-ssa-reassoc.c (init_range_entry) <CASE_CONVERT>: Return for a conversion to a boolean type from a type with greater precision. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@262684 138bc75d-0d04-0410-961f-82ee72b054a4
2018-06-08Convert dump and optgroup flags to enumsDavid Malcolm
gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@261325 138bc75d-0d04-0410-961f-82ee72b054a4
2018-06-07 PR tree-optimization/69615Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): If rhs2 is lhs of a cast from a same precision integral SSA_NAME in a bb dominated by first_bb, retry with rhs2 set to the rhs1 of the cast. Don't emit cast to utype if rhs2 has already a compatible type. * gcc.dg/tree-ssa/pr69615.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@261264 138bc75d-0d04-0410-961f-82ee72b054a4
2018-04-27 PR tree-optimization/85529Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Add FIRST_BB argument. Don't call get_nonzero_bits if opcode is ERROR_MARK_NODE, rhs2 def stmt's bb is dominated by first_bb and it isn't an obvious zero extension or masking of the MSB bit. (optimize_range_tests): Add FIRST_BB argument, pass it through to optimize_range_tests_var_bound. (maybe_optimize_range_tests, reassociate_bb): Adjust optimize_range_tests callers. * gcc.c-torture/execute/pr85529-1.c: New test. * gcc.c-torture/execute/pr85529-2.c: New test. * gcc.dg/pr85529.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@259696 138bc75d-0d04-0410-961f-82ee72b054a4
2018-03-16 PR tree-optimization/84841Jakub Jelinek
* tree-ssa-reassoc.c (INTEGER_CONST_TYPE): Change to 1 << 4 from 1 << 3. (FLOAT_ONE_CONST_TYPE): Define. (constant_type): Return FLOAT_ONE_CONST_TYPE for -1.0 and 1.0. (sort_by_operand_rank): Put entries with higher constant_type last rather than first to match comments. * gcc.dg/pr84841.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@258586 138bc75d-0d04-0410-961f-82ee72b054a4
2018-01-03 Update copyright years.Jakub Jelinek
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@256169 138bc75d-0d04-0410-961f-82ee72b054a4
2017-12-12[SFN] boilerplate changes in preparation to introduce nonbind markersAlexandre Oliva
This patch introduces a number of new macros and functions that will be used to distinguish between different kinds of debug stmts, insns and notes, namely, preexisting debug bind ones and to-be-introduced nonbind markers. In a seemingly mechanical way, it adjusts several uses of the macros and functions, so that they refer to narrower categories when appropriate. These changes, by themselves, should not have any visible effect in the compiler behavior, since the upcoming debug markers are never created with this patch alone. for gcc/ChangeLog * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_BEGIN_STMT. (gimple_debug_begin_stmt_p): New. (gimple_debug_nonbind_marker_p): New. * tree.h (MAY_HAVE_DEBUG_MARKER_STMTS): New. (MAY_HAVE_DEBUG_BIND_STMTS): Renamed from.... (MAY_HAVE_DEBUG_STMTS): ... this. Check both. * insn-notes.def (BEGIN_STMT): New. * rtl.h (MAY_HAVE_DEBUG_MARKER_INSNS): New. (MAY_HAVE_DEBUG_BIND_INSNS): Renamed from.... (MAY_HAVE_DEBUG_INSNS): ... this. Check both. (NOTE_MARKER_LOCATION, NOTE_MARKER_P): New. (DEBUG_BIND_INSN_P, DEBUG_MARKER_INSN_P): New. (INSN_DEBUG_MARKER_KIND): New. (GEN_RTX_DEBUG_MARKER_BEGIN_STMT_PAT): New. (INSN_VAR_LOCATION): Check for VAR_LOCATION. (INSN_VAR_LOCATION_PTR): New. * cfgexpand.c (expand_debug_locations): Handle debug bind insns only. (expand_gimple_basic_block): Likewise. Emit debug temps for TER deps only if debug bind insns are enabled. (pass_expand::execute): Avoid deep TER and expand debug locations for debug bind insns only. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Narrow debug stmts special handling down to debug bind stmts. * combine.c (try_combine): Narrow debug insns special handling down to debug bind insns. * cse.c (delete_trivially_dead_insns): Handle debug bindings. Narrow debug insns preexisting special handling down to debug bind insns. * dce.c (rest_of_handle_ud_dce): Narrow debug insns special handling down to debug bind insns. * function.c (instantiate_virtual_regs): Skip debug markers, adjust handling of debug binds. * gimple-ssa-backprop.c (backprop::prepare_change): Try debug temp insertion iff MAY_HAVE_DEBUG_BIND_STMTS. * haifa-sched.c (schedule_insn): Narrow special handling of debug insns to debug bind insns. * ipa-param-manipulation.c (ipa_modify_call_arguments): Narrow special handling of debug stmts to debug bind stmts. * ipa-split.c (split_function): Likewise. * ira.c (combine_and_move_insns): Adjust debug bind insns only. * loop-unroll.c (apply_opt_in_copies): Adjust tests on bind debug insns. * reg-stack.c (convert_regs_1): Use DEBUG_BIND_INSN_P. * regrename.c (build_def_use): Likewise. * regcprop.c (copyprop_hardreg_forward_1): Likewise. (pass_cprop_hardreg): Narrow special casing of debug insns to debug bind insns. * regstat.c (regstat_init_n_sets_and_refs): Likewise. * reload1.c (reload): Likewise. * sese.c (sese_insert_phis_for_liveouts): Narrow special casing of debug stmts to debug bind stmts. * shrink-wrap.c (move_insn_for_shrink_wrap): Likewise. * ssa-iterators.h (num_imm_uses): Likewise. * tree-cfg.c (gimple_merge_blocks): Narrow special casing of debug stmts to debug bind stmts. * tree-inline.c (tree_function_versioning): Narrow special casing of debug stmts to debug bind stmts. * tree-loop-distribution.c (generate_loops_for_partition): Narrow special casing of debug stmts to debug bind stmts. * tree-sra.c (analyze_access_subtree): Narrow special casing of debug stmts to debug bind stmts. * tree-ssa-dce.c (remove_dead_stmt): Narrow special casing of debug stmts to debug bind stmts. * tree-ssa-loop-ivopt.c (remove_unused_ivs): Narrow special casing of debug stmts to debug bind stmts. * tree-ssa-reassoc.c (reassoc_remove_stmt): Likewise. * tree-ssa-tail-merge.c (tail_merge_optimize): Narrow special casing of debug stmts to debug bind stmts. * tree-ssa-threadedge.c (propagate_threaded_block_debug_info): Likewise. * tree-ssa.c (flush_pending_stmts): Narrow special casing of debug stmts to debug bind stmts. (gimple_replace_ssa_lhs): Likewise. (insert_debug_temp_for_var_def): Likewise. (insert_debug_temps_for_defs): Likewise. (reset_debug_uses): Likewise. * tree-ssanames.c (release_ssa_name_fn): Likewise. * tree-vect-loop-manip.c (adjust_debug_stmts_now): Likewise. (adjust_debug_stmts): Likewise. (adjust_phi_and_debug_stmts): Likewise. (vect_do_peeling): Likewise. * tree-vect-loop.c (vect_transform_loop): Likewise. * valtrack.c (propagate_for_debug): Use BIND_DEBUG_INSN_P. * var-tracking.c (adjust_mems): Narrow special casing of debug insns to debug bind insns. (dv_onepart_p, dataflow_set_clar_at_call, use_type): Likewise. (compute_bb_dataflow, vt_find_locations): Likewise. (vt_expand_loc, emit_notes_for_changes): Likewise. (vt_init_cfa_base): Likewise. (vt_emit_notes): Likewise. (vt_initialize): Likewise. (vt_finalize): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@255565 138bc75d-0d04-0410-961f-82ee72b054a4
2017-12-01 PR tree-optimization/83221Jakub Jelinek
* tree-ssa-reassoc.c (sort_by_operand_rank): Shift bb_rank down by 16. (init_reassoc): Formatting fix. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@255297 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-27[gcc]Michael Meissner
2017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com> * builtins.c (CASE_MATHFN_FLOATN): New helper macro to add cases for math functions that have _Float<N> and _Float<N>X variants. (mathfn_built_in_2): Add support for math functions that have _Float<N> and _Float<N>X variants. (DEF_INTERNAL_FLT_FLOATN_FN): New helper macro. (expand_builtin_mathfn_ternary): Add support for fma with _Float<N> and _Float<N>X variants. (expand_builtin): Likewise. (fold_builtin_3): Likewise. * builtins.def (DEF_EXT_LIB_FLOATN_NX_BUILTINS): New macro to create math function _Float<N> and _Float<N>X variants as external library builtins. (BUILT_IN_COPYSIGN _Float<N> and _Float<N>X variants) Use DEF_EXT_LIB_FLOATN_NX_BUILTINS to make built-in functions using the __builtin_ prefix and if not strict ansi, without the prefix. (BUILT_IN_FABS _Float<N> and _Float<N>X variants): Likewise. (BUILT_IN_FMA _Float<N> and _Float<N>X variants): Likewise. (BUILT_IN_FMAX _Float<N> and _Float<N>X variants): Likewise. (BUILT_IN_FMIN _Float<N> and _Float<N>X variants): Likewise. (BUILT_IN_NAN _Float<N> and _Float<N>X variants): Likewise. (BUILT_IN_SQRT _Float<N> and _Float<N>X variants): Likewise. * builtin-types.def (BT_FN_FLOAT16_FLOAT16_FLOAT16_FLOAT16): New function signatures for fma _Float<N> and _Float<N>X variants. (BT_FN_FLOAT32_FLOAT32_FLOAT32_FLOAT32): Likewise. (BT_FN_FLOAT64_FLOAT64_FLOAT64_FLOAT64): Likewise. (BT_FN_FLOAT128_FLOAT128_FLOAT128_FLOAT128): Likewise. (BT_FN_FLOAT32X_FLOAT32X_FLOAT32X_FLOAT32X): Likewise. (BT_FN_FLOAT64X_FLOAT64X_FLOAT64X_FLOAT64X): Likewise. (BT_FN_FLOAT128X_FLOAT128X_FLOAT128X_FLOAT128X): Likewise. * gencfn-macros.c (print_case_cfn): Add support for math functions that have _Float<N> and _Float<N>X variants. (print_define_operator_list): Likewise. (fltfn_suffixes): Likewise. (main): Likewise. * internal-fn.def (DEF_INTERNAL_FLT_FLOATN_FN): New helper macro for math functions that have _Float<N> and _Float<N>X variants. (SQRT): Add support for sqrt, copysign, fmin and fmax _Float<N> and _Float<N>X variants. (COPYSIGN): Likewise. (FMIN): Likewise. (FMAX): Likewise. * fold-const.c (tree_call_nonnegative_warnv_p): Add support for copysign, fma, fmax, fmin, and sqrt _Float<N> and _Float<N>X variants. (integer_valued_read_call_p): Likewise. * fold-const-call.c (fold_const_call_ss): Likewise. (fold_const_call_sss): Add support for copysign, fmin, and fmax _Float<N> and _Float<N>X variants. (fold_const_call_ssss): Add support for fma _Float<N> and _Float<N>X variants. * gimple-ssa-backprop.c (backprop::process_builtin_call_use): Add support for copysign and fma _Float<N> and _Float<N>X variants. (backprop::process_builtin_call_use): Likewise. * tree-call-cdce.c (can_test_argument_range); Add support for sqrt _Float<N> and _Float<N>X variants. (edom_only_function): Likewise. (get_no_error_domain): Likewise. * tree-ssa-math-opts.c (internal_fn_reciprocal): Likewise. * tree-ssa-reassoc.c (attempt_builtin_copysign): Add support for copysign _Float<N> and _Float<N>X variants. * config/rs6000/rs6000-builtin.def (SQRTF128): Delete, this is now handled by machine independent code. (FMAF128): Likewise. * doc/cpp.texi (Common Predefined Macros): Document defining __FP_FAST_FMAF<N> and __FP_FAST_FMAF<N>X if the backend supports fma _Float<N> and _Float<N>X variants. [gcc/c] 2017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com> * c-decl.c (header_for_builtin_fn): Add support for copysign, fma, fmax, fmin, and sqrt _Float<N> and _Float<N>X variants. [gcc/c-family] 2017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com> * c-cppbuiltin.c (mode_has_fma): Add support for PowerPC KFmode. (c_cpp_builtins): If a machine has a fast fma _Float<N> and _Float<N>X variant, define __FP_FAST_FMA<N> and/or __FP_FAST_FMA<N>X. [gcc/testsuite] 2017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com> * gcc.target/powerpc/float128-hw.c: Add support for all 4 FMA variants. Check various conversions to/from float128. Check negation. Use {\m...\M} in the tests. * gcc.target/powerpc/float128-hw2.c: New test for implicit _Float128 math functions. * gcc.target/powerpc/float128-hw3.c: New test for strict ansi mode not implicitly adding the _Float128 math functions. * gcc.target/powerpc/float128-fma2.c: Delete, test is no longer valid. * gcc.target/powerpc/float128-sqrt2.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@254168 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-19 * asan.c (create_cond_insert_point): Do not update edge count.Jan Hubicka
* auto-profile.c (afdo_propagate_edge): Update for edge count removal. (afdo_propagate_circuit): Likewise. (afdo_calculate_branch_prob): Likewise. (afdo_annotate_cfg): Likewise. * basic-block.h (struct edge_def): Remove count. (edge_def::count): New accessor. * bb-reorder.c (rotate_loop): Update. (find_traces_1_round): Update. (connect_traces): Update. (sanitize_hot_paths): Update. * cfg.c (unchecked_make_edge): Update. (make_single_succ_edge): Update. (check_bb_profile): Update. (dump_edge_info): Update. (update_bb_profile_for_threading): Update. (scale_bbs_frequencies_int): Update. (scale_bbs_frequencies_gcov_type): Update. (scale_bbs_frequencies_profile_count): Update. (scale_bbs_frequencies): Update. * cfganal.c (connect_infinite_loops_to_exit): Update. * cfgbuild.c (compute_outgoing_frequencies): Update. (find_many_sub_basic_blocks): Update. * cfgcleanup.c (try_forward_edges): Update. (try_crossjump_to_edge): Update * cfgexpand.c (expand_gimple_cond): Update (expand_gimple_tailcall): Update (construct_exit_block): Update * cfghooks.c (verify_flow_info): Update (redirect_edge_succ_nodup): Update (split_edge): Update (make_forwarder_block): Update (duplicate_block): Update (account_profile_record): Update * cfgloop.c (find_subloop_latch_edge_by_profile): Update. * cfgloopanal.c (expected_loop_iterations_unbounded): Update. * cfgloopmanip.c (scale_loop_profile): Update. (loopify): Update. (lv_adjust_loop_entry_edge): Update. * cfgrtl.c (try_redirect_by_replacing_jump): Update. (force_nonfallthru_and_redirect): Update. (purge_dead_edges): Update. (rtl_flow_call_edges_add): Update. * cgraphunit.c (init_lowered_empty_function): Update. (cgraph_node::expand_thunk): Update. * gimple-pretty-print.c (dump_probability): Update. (dump_edge_probability): Update. * gimple-ssa-isolate-paths.c (isolate_path): Update. * haifa-sched.c (sched_create_recovery_edges): Update. * hsa-gen.c (convert_switch_statements): Update. * ifcvt.c (dead_or_predicable): Update. * ipa-inline-transform.c (inline_transform): Update. * ipa-split.c (split_function): Update. * ipa-utils.c (ipa_merge_profiles): Update. * loop-doloop.c (add_test): Update. * loop-unroll.c (unroll_loop_runtime_iterations): Update. * lto-streamer-in.c (input_cfg): Update. (input_function): Update. * lto-streamer-out.c (output_cfg): Update. * modulo-sched.c (sms_schedule): Update. * postreload-gcse.c (eliminate_partially_redundant_load): Update. * predict.c (maybe_hot_edge_p): Update. (unlikely_executed_edge_p): Update. (probably_never_executed_edge_p): Update. (dump_prediction): Update. (drop_profile): Update. (propagate_unlikely_bbs_forward): Update. (determine_unlikely_bbs): Update. (force_edge_cold): Update. * profile.c (compute_branch_probabilities): Update. * reg-stack.c (better_edge): Update. * shrink-wrap.c (handle_simple_exit): Update. * tracer.c (better_p): Update. * trans-mem.c (expand_transaction): Update. (split_bb_make_tm_edge): Update. * tree-call-cdce.c: Update. * tree-cfg.c (gimple_find_sub_bbs): Update. (gimple_split_edge): Update. (gimple_duplicate_sese_region): Update. (gimple_duplicate_sese_tail): Update. (gimple_flow_call_edges_add): Update. (insert_cond_bb): Update. (execute_fixup_cfg): Update. * tree-cfgcleanup.c (cleanup_control_expr_graph): Update. * tree-complex.c (expand_complex_div_wide): Update. * tree-eh.c (lower_resx): Update. (unsplit_eh): Update. (cleanup_empty_eh_move_lp): Update. * tree-inline.c (copy_edges_for_bb): Update. (freqs_to_counts): Update. (copy_cfg_body): Update. * tree-ssa-dce.c (remove_dead_stmt): Update. * tree-ssa-ifcombine.c (update_profile_after_ifcombine): Update. * tree-ssa-loop-im.c (execute_sm_if_changed): Update. * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Update. (unloop_loops): Update. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Update. * tree-ssa-loop-split.c (connect_loops): Update. (split_loop): Update. * tree-ssa-loop-unswitch.c (hoist_guard): Update. * tree-ssa-phionlycprop.c (propagate_rhs_into_lhs): Update. * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update. * tree-ssa-reassoc.c (branch_fixup): Update. * tree-ssa-tail-merge.c (replace_block_by): Update. * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Update. (compute_path_counts): Update. (update_profile): Update. (recompute_probabilities): Update. (update_joiner_offpath_counts): Update. (estimated_freqs_path): Update. (freqs_to_counts_path): Update. (clear_counts_path): Update. (ssa_fix_duplicate_block_edges): Update. (duplicate_thread_path): Update. * tree-switch-conversion.c (hoist_edge_and_branch_if_true): Update. (case_bit_test_cmp): Update. (collect_switch_conv_info): Update. (gen_inbound_check): Update. (do_jump_if_equal): Update. (emit_cmp_and_jump_insns): Update. * tree-tailcall.c (decrease_profile): Update. (eliminate_tail_call): Update. * tree-vect-loop-manip.c (slpeel_add_loop_guard): Update. (vect_do_peeling): Update. * tree-vect-loop.c (scale_profile_for_vect_loop): Update. * ubsan.c (ubsan_expand_null_ifn): Update. (ubsan_expand_ptr_ifn): Update. * value-prof.c (gimple_divmod_fixed_value): Update. (gimple_mod_pow2): Update. (gimple_mod_subtract): Update. (gimple_ic): Update. (gimple_stringop_fixed_value): Update. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@253910 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-13 * tree-ssa-reassoc.c (reassociate_bb): Clarify code slighly.Jeff Law
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@253740 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-04 PR tree-optimization/82381Jakub Jelinek
* tree-ssa-reassoc.c (sort_by_operand_rank): Check for different oeN->rank first. Return 1 or -1 if one op is SSA_NAME and the other is not. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@253396 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-03 PR tree-optimization/82381Jakub Jelinek
* tree-ssa-reassoc.c (sort_by_operand_rank): Don't check stmt_to_insert nor wheather SSA_NAMEs are default defs. Return 1 or -1 if one of bba and bbb is NULL. If bb_rank is equal, fallthrough into reassoc_stmt_dominates_stmt_p. * gcc.c-torture/compile/pr82381.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@253379 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-26 PR middle-end/35691Jakub Jelinek
* tree-ssa-reassoc.c (update_range_test): Dump r->exp each time if it is different SSA_NAME. (optimize_range_tests_cmp_bitwise): New function. (optimize_range_tests): Call it. * gcc.dg/pr35691-5.c: New test. * gcc.dg/pr35691-6.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@253201 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-06 PR tree-optimization/64910Jeff Law
* tree-ssa-reassoc.c (reassociate_bb): Restrict last change to cases where we have 3 or more operands. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@251751 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-042017-09-03 Jeff Law <law@redhat.com>Jeff Law
PR tree-optimization/64910 * tree-ssa-reassoc.c (reassociate_bb): For bitwise binary ops, swap the first and last operand if the last is a constant. PR tree-optimization/64910 * gcc.dg/tree-ssa/pr64910-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@251659 138bc75d-0d04-0410-961f-82ee72b054a4
2017-08-032017-08-03 Richard Biener <rguenther@suse.de>Richard Biener
* tree-ssa-reassoc.c (should_break_up_subtract): Also break up if the use is in USE - X. * gcc.dg/tree-ssa/reassoc-23.c: Adjust to fool early folding and CSE. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@250855 138bc75d-0d04-0410-961f-82ee72b054a4
2017-08-03 PR tree-optimization/81655Jakub Jelinek
PR tree-optimization/81588 * tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle also the case when ranges[i].low and high are 1 for unsigned type with precision 1. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@250849 138bc75d-0d04-0410-961f-82ee72b054a4
2017-08-01 PR tree-optimization/81588Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): If ranges[i].in_p, invert comparison code ccode. For >/>=, swap rhs1 and rhs2 and comparison code unconditionally, for </<= don't do that. Don't swap rhs1/rhs2 again if ranges[i].in_p, instead invert comparison code ccode if opcode or oe->rank is BIT_IOR_EXPR. * gcc.dg/tree-ssa/pr81588.c: New test. * gcc.dg/pr81588.c: New test. * gcc.c-torture/execute/pr81588.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@250760 138bc75d-0d04-0410-961f-82ee72b054a4
2017-07-27 PR tree-optimization/81555Jakub Jelinek
PR tree-optimization/81556 * tree-ssa-reassoc.c (rewrite_expr_tree): Add NEXT_CHANGED argument, if true, force CHANGED for the recursive invocation. (reassociate_bb): Remember original length of ops array, pass len != orig_len as NEXT_CHANGED in rewrite_expr_tree call. * gcc.c-torture/execute/pr81555.c: New test. * gcc.c-torture/execute/pr81556.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@250609 138bc75d-0d04-0410-961f-82ee72b054a4
2017-06-29 * asan.c (asan_emit_stack_protection): Update.Jan Hubicka
(create_cond_insert_point): Update. * auto-profile.c (afdo_propagate_circuit): Update. * basic-block.h (struct edge_def): Turn probability to profile_probability. (EDGE_FREQUENCY): Update. * bb-reorder.c (find_traces_1_round): Update. (better_edge_p): Update. (sanitize_hot_paths): Update. * cfg.c (unchecked_make_edge): Initialize probability to uninitialized. (make_single_succ_edge): Update. (check_bb_profile): Update. (dump_edge_info): Update. (update_bb_profile_for_threading): Update. * cfganal.c (connect_infinite_loops_to_exit): Initialize new edge probabilitycount to 0. * cfgbuild.c (compute_outgoing_frequencies): Update. * cfgcleanup.c (try_forward_edges): Update. (outgoing_edges_match): Update. (try_crossjump_to_edge): Update. * cfgexpand.c (expand_gimple_cond): Update make_single_succ_edge. (expand_gimple_tailcall): Update. (construct_init_block): Use make_single_succ_edge. (construct_exit_block): Use make_single_succ_edge. * cfghooks.c (verify_flow_info): Update. (redirect_edge_succ_nodup): Update. (split_edge): Update. (account_profile_record): Update. * cfgloopanal.c (single_likely_exit): Update. * cfgloopmanip.c (scale_loop_profile): Update. (set_zero_probability): Remove. (duplicate_loop_to_header_edge): Update. * cfgloopmanip.h (loop_version): Update prototype. * cfgrtl.c (try_redirect_by_replacing_jump): Update. (force_nonfallthru_and_redirect): Update. (update_br_prob_note): Update. (rtl_verify_edges): Update. (purge_dead_edges): Update. (rtl_lv_add_condition_to_bb): Update. * cgraph.c: (cgraph_edge::redirect_call_stmt_to_calle): Update. * cgraphunit.c (init_lowered_empty_function): Update. (cgraph_node::expand_thunk): Update. * cilk-common.c: Include profile-count.h * dojump.c (inv): Remove. (jumpifnot): Update. (jumpifnot_1): Update. (do_jump_1): Update. (do_jump): Update. (do_jump_by_parts_greater_rtx): Update. (do_compare_rtx_and_jump): Update. * dojump.h (jumpifnot, jumpifnot_1, jumpif_1, jumpif, do_jump, do_jump_1. do_compare_rtx_and_jump): Update prototype. * dwarf2cfi.c: Include profile-count.h * except.c (dw2_build_landing_pads): Use make_single_succ_edge. (sjlj_emit_dispatch_table): Likewise. * explow.c: Include profile-count.h * expmed.c (emit_store_flag_force): Update. (do_cmp_and_jump): Update. * expr.c (compare_by_pieces_d::generate): Update. (compare_by_pieces_d::finish_mode): Update. (emit_block_move_via_loop): Update. (store_expr_with_bounds): Update. (store_constructor): Update. (expand_expr_real_2): Update. (expand_expr_real_1): Update. * expr.h (try_casesi, try_tablejump): Update prototypes. * gimple-pretty-print.c (dump_probability): Update. (dump_profile): New. (dump_gimple_label): Update. (dump_gimple_bb_header): Update. * graph.c (draw_cfg_node_succ_edges): Update. * hsa-gen.c (convert_switch_statements): Update. * ifcvt.c (cheap_bb_rtx_cost_p): Update. (find_if_case_1): Update. (find_if_case_2): Update. * internal-fn.c (expand_arith_overflow_result_store): Update. (expand_addsub_overflow): Update. (expand_neg_overflow): Update. (expand_mul_overflow): Update. (expand_vector_ubsan_overflow): Update. * ipa-cp.c (good_cloning_opportunity_p): Update. * ipa-split.c (split_function): Use make_single_succ_edge. * ipa-utils.c (ipa_merge_profiles): Update. * loop-doloop.c (add_test): Update. (doloop_modify): Update. * loop-unroll.c (compare_and_jump_seq): Update. (unroll_loop_runtime_iterations): Update. * lra-constraints.c (lra_inheritance): Update. * lto-streamer-in.c (input_cfg): Update. * lto-streamer-out.c (output_cfg): Update. * mcf.c (adjust_cfg_counts): Update. * modulo-sched.c (sms_schedule): Update. * omp-expand.c (expand_omp_for_init_counts): Update. (extract_omp_for_update_vars): Update. (expand_omp_ordered_sink): Update. (expand_omp_for_ordered_loops): Update. (expand_omp_for_generic): Update. (expand_omp_for_static_nochunk): Update. (expand_omp_for_static_chunk): Update. (expand_cilk_for): Update. (expand_omp_simd): Update. (expand_omp_taskloop_for_outer): Update. (expand_omp_taskloop_for_inner): Update. * omp-simd-clone.c (simd_clone_adjust): Update. * optabs.c (expand_doubleword_shift): Update. (expand_abs): Update. (emit_cmp_and_jump_insn_1): Update. (expand_compare_and_swap_loop): Update. * optabs.h (emit_cmp_and_jump_insns): Update prototype. * predict.c (predictable_edge_p): Update. (edge_probability_reliable_p): Update. (set_even_probabilities): Update. (combine_predictions_for_insn): Update. (combine_predictions_for_bb): Update. (propagate_freq): Update. (estimate_bb_frequencies): Update. (force_edge_cold): Update. * profile-count.c (profile_count::dump): Add missing space into dump. (profile_count::debug): Add newline. (profile_count::differs_from_p): Explicitly convert to unsigned. (profile_count::stream_in): Update. (profile_probability::dump): New member function. (profile_probability::debug): New member function. (profile_probability::differs_from_p): New member function. (profile_probability::differs_lot_from_p): New member function. (profile_probability::stream_in): New member function. (profile_probability::stream_out): New member function. * profile-count.h (profile_count_quality): Rename to ... (profile_quality): ... this one. (profile_probability): New. (profile_count): Update. * profile.c (compute_branch_probabilities): Update. * recog.c (peep2_attempt): Update. * sched-ebb.c (schedule_ebbs): Update. * sched-rgn.c (find_single_block_region): Update. (compute_dom_prob_ps): Update. (schedule_region): Update. * sel-sched-ir.c (compute_succs_info): Update. * stmt.c (struct case_node): Update. (do_jump_if_equal): Update. (get_outgoing_edge_probs): Update. (conditional_probability): Update. (emit_case_dispatch_table): Update. (expand_case): Update. (expand_sjlj_dispatch_table): Update. (emit_case_nodes): Update. * targhooks.c: Update. * tracer.c (better_p): Update. (find_best_successor): Update. * trans-mem.c (expand_transaction): Update. * tree-call-cdce.c: Update. * tree-cfg.c (gimple_split_edge): Upate. (move_sese_region_to_fn): Upate. * tree-cfgcleanup.c (cleanup_control_expr_graph): Upate. * tree-eh.c (lower_resx): Upate. (cleanup_empty_eh_move_lp): Upate. * tree-if-conv.c (version_loop_for_if_conversion): Update. * tree-inline.c (copy_edges_for_bb): Update. (copy_cfg_body): Update. * tree-parloops.c (gen_parallel_loop): Update. * tree-profile.c (gimple_gen_ic_func_profiler): Update. (gimple_gen_time_profiler): Update. * tree-ssa-dce.c (remove_dead_stmt): Update. * tree-ssa-ifcombine.c (update_profile_after_ifcombine): Update. * tree-ssa-loop-im.c (execute_sm_if_changed): Update. * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Update. (unloop_loops): Update. (try_peel_loop): Update. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Update. * tree-ssa-loop-split.c (connect_loops): Update. (split_loop): Update. * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Update. (hoist_guard): Update. * tree-ssa-phionlycprop.c (propagate_rhs_into_lhs): Update. * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update. (value_replacement): Update. * tree-ssa-reassoc.c (branch_fixup): Update. * tree-ssa-tail-merge.c (replace_block_by): Update. * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Update. (create_edge_and_update_destination_phis): Update. (compute_path_counts): Update. (recompute_probabilities): Update. (update_joiner_offpath_counts): Update. (freqs_to_counts_path): Update. (duplicate_thread_path): Update. * tree-switch-conversion.c (hoist_edge_and_branch_if_true): Update. (struct switch_conv_info): Update. (gen_inbound_check): Update. * tree-vect-loop-manip.c (slpeel_add_loop_guard): Update. (vect_do_peeling): Update. (vect_loop_versioning): Update. * tree-vect-loop.c (scale_profile_for_vect_loop): Update. (optimize_mask_stores): Update. * ubsan.c (ubsan_expand_null_ifn): Update. * value-prof.c (gimple_divmod_fixed_value): Update. (gimple_divmod_fixed_value_transform): Update. (gimple_mod_pow2): Update. (gimple_mod_pow2_value_transform): Update. (gimple_mod_subtract): Update. (gimple_mod_subtract_transform): Update. (gimple_ic): Update. (gimple_stringop_fixed_value): Update. (gimple_stringops_transform): Update. * value-prof.h: Update. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@249800 138bc75d-0d04-0410-961f-82ee72b054a4
2017-06-282017-06-28 Richard Biener <rguenther@suse.de>Richard Biener
PR middle-end/81227 * fold-const.c (negate_expr_p): Use TYPE_UNSIGNED, not TYPE_OVERFLOW_WRAPS. * match.pd (negate_expr_p): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_diff): Use fold_build2, not fold_binary. * gcc.dg/pr81227.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@249742 138bc75d-0d04-0410-961f-82ee72b054a4
2017-06-12 PR tree-optimization/81003Jakub Jelinek
* tree-ssa-reassoc.c (force_into_ssa_name): New function. (update_range_test): Use it instead of force_gimple_operand_gsi. * gcc.c-torture/compile/pr81003.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@249114 138bc75d-0d04-0410-961f-82ee72b054a4
2017-06-042017-05-23 Jan Hubicka <hubicka@ucw.cz>Jan Hubicka
* config/i386/i386.c (make_resolver_func): Update. * Makefile.in: Add profile-count.h and profile-count.o * auto-profile.c (afdo_indirect_call): Update to new API. (afdo_set_bb_count): Update. (afdo_propagate_edge): Update. (afdo_propagate_circuit): Update. (afdo_calculate_branch_prob): Update. (afdo_annotate_cfg): Update. * basic-block.h: Include profile-count.h (struct edge_def): Turn count to profile_count. (struct basic_block_def): Likewie. (REG_BR_PROB_BASE): Move to profile-count.h (RDIV): Move to profile-count.h * bb-reorder.c (max_entry_count): Turn to profile_count. (find_traces): Update. (rotate_loop):Update. (connect_traces):Update. (sanitize_hot_paths):Update. * bt-load.c (migrate_btr_defs): Update. * cfg.c (RDIV): Remove. (init_flow): Use alloc_block. (alloc_block): Uninitialize count. (unchecked_make_edge): Uninitialize count. (check_bb_profile): Update. (dump_edge_info): Update. (dump_bb_info): Update. (update_bb_profile_for_threading): Update. (scale_bbs_frequencies_int): Update. (scale_bbs_frequencies_gcov_type): Update. (scale_bbs_frequencies_profile_count): New. * cfg.h (update_bb_profile_for_threading): Update. (scale_bbs_frequencies_profile_count): Declare. * cfgbuild.c (compute_outgoing_frequencies): Update. (find_many_sub_basic_blocks): Update. * cfgcleanup.c (try_forward_edges): Update. (try_crossjump_to_edge): Update. * cfgexpand.c (expand_gimple_tailcall): Update. (construct_exit_block): Update. * cfghooks.c (verify_flow_info): Update. (dump_bb_for_graph): Update. (split_edge): Update. (make_forwarder_block): Update. (duplicate_block): Update. (account_profile_record): Update. * cfgloop.c (find_subloop_latch_edge_by_profile): Update. (get_estimated_loop_iterations): Update. * cfgloopanal.c (expected_loop_iterations_unbounded): Update. (single_likely_exit): Update. * cfgloopmanip.c (scale_loop_profile): Update. (loopify): Update. (set_zero_probability): Update. (lv_adjust_loop_entry_edge): Update. * cfgrtl.c (force_nonfallthru_and_redirect): Update. (purge_dead_edges): Update. (rtl_account_profile_record): Update. * cgraph.c (cgraph_node::create): Uninitialize count. (symbol_table::create_edge): Uninitialize count. (cgraph_update_edges_for_call_stmt_node): Update. (cgraph_edge::dump_edge_flags): Update. (cgraph_node::dump): Update. (cgraph_edge::maybe_hot_p): Update. * cgraph.h: Include profile-count.h (create_clone), create_edge, create_indirect_edge): Update. (cgraph_node): Turn count to profile_count. (cgraph_edge0: Likewise. (make_speculative, clone): Update. (create_edge): Update. (init_lowered_empty_function): Update. * cgraphclones.c (cgraph_edge::clone): Update. (duplicate_thunk_for_node): Update. (cgraph_node::create_clone): Update. * cgraphunit.c (cgraph_node::analyze): Update. (cgraph_node::expand_thunk): Update. * final.c (dump_basic_block_info): Update. * gimple-streamer-in.c (input_bb): Update. * gimple-streamer-out.c (output_bb): Update. * graphite.c (print_global_statistics): Update. (print_graphite_scop_statistics): Update. * hsa-brig.c: Include basic-block.h. * hsa-dump.c: Include basic-block.h. * hsa-gen.c (T sum_slice): Update. (convert_switch_statements):Update. * hsa-regalloc.c: Include basic-block.h. * ipa-chkp.c (chkp_produce_thunks): Update. * ipa-cp.c (struct caller_statistics): Update. (init_caller_stats): Update. (gather_caller_stats): Update. (ipcp_cloning_candidate_p): Update. (good_cloning_opportunity_p): Update. (get_info_about_necessary_edges): Update. (dump_profile_updates): Update. (update_profiling_info): Update. (update_specialized_profile): Update. (perhaps_add_new_callers): Update. (decide_about_value): Update. (ipa_cp_c_finalize): Update. * ipa-devirt.c (struct odr_type_warn_count): Update. (struct decl_warn_count): Update. (struct final_warning_record): Update. (possible_polymorphic_call_targets): Update. (ipa_devirt): Update. * ipa-fnsummary.c (redirect_to_unreachable): Update. * ipa-icf.c (sem_function::merge): Update. * ipa-inline-analysis.c (do_estimate_edge_time): Update. * ipa-inline.c (compute_uninlined_call_time): Update. (compute_inlined_call_time): Update. (want_inline_small_function_p): Update. (want_inline_self_recursive_call_p): Update. (edge_badness): Update. (lookup_recursive_calls): Update. (recursive_inlining): Update. (inline_small_functions): Update. (dump_overall_stats): Update. (dump_inline_stats): Update. * ipa-profile.c (ipa_profile_generate_summary): Update. (ipa_propagate_frequency): Update. (ipa_profile): Update. * ipa-prop.c (ipa_make_edge_direct_to_target): Update. * ipa-utils.c (ipa_merge_profiles): Update. * loop-doloop.c (doloop_modify): Update. * loop-unroll.c (report_unroll): Update. (unroll_loop_runtime_iterations): Update. * lto-cgraph.c (lto_output_edge): Update. (lto_output_node): Update. (input_node): Update. (input_edge): Update. (merge_profile_summaries): Update. * lto-streamer-in.c (input_cfg): Update. * lto-streamer-out.c (output_cfg): Update. * mcf.c (create_fixup_graph): Update. (adjust_cfg_counts): Update. (sum_edge_counts): Update. * modulo-sched.c (sms_schedule): Update. * postreload-gcse.c (eliminate_partially_redundant_load): Update. * predict.c (maybe_hot_count_p): Update. (probably_never_executed): Update. (dump_prediction): Update. (combine_predictions_for_bb): Update. (propagate_freq): Update. (handle_missing_profiles): Update. (counts_to_freqs): Update. (rebuild_frequencies): Update. (force_edge_cold): Update. * predict.h: Include profile-count.h (maybe_hot_count_p, counts_to_freqs): UPdate. * print-rtl-function.c: Do not include cfg.h * print-rtl.c: Include basic-block.h * profile-count.c: New file. * profile-count.h: New file. * profile.c (is_edge_inconsistent): Update. (correct_negative_edge_counts): Update. (is_inconsistent): Update. (set_bb_counts): Update. (read_profile_edge_counts): Update. (compute_frequency_overlap): Update. (compute_branch_probabilities): Update; Initialize and deinitialize gcov_count tables. (branch_prob): Update. * profile.h (bb_gcov_counts, edge_gcov_counts): New. (edge_gcov_count): New. (bb_gcov_count): New. * shrink-wrap.c (try_shrink_wrapping): Update. * tracer.c (better_p): Update. * trans-mem.c (expand_transaction): Update. (ipa_tm_insert_irr_call): Update. (ipa_tm_insert_gettmclone_call): Update. * tree-call-cdce.c: Update. * tree-cfg.c (gimple_duplicate_sese_region): Update. (gimple_duplicate_sese_tail): Update. (gimple_account_profile_record): Update. (execute_fixup_cfg): Update. * tree-inline.c (copy_bb): Update. (copy_edges_for_bb): Update. (initialize_cfun): Update. (freqs_to_counts): Update. (copy_cfg_body): Update. (expand_call_inline): Update. * tree-ssa-ifcombine.c (update_profile_after_ifcombine): Update. * tree-ssa-loop-ivcanon.c (unloop_loops): Update. (try_unroll_loop_completely): Update. (try_peel_loop): Update. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Update. * tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): Update. * tree-ssa-loop-split.c (connect_loops): Update. * tree-ssa-loop-unswitch.c (hoist_guard): Update. * tree-ssa-reassoc.c (branch_fixup): Update. * tree-ssa-tail-merge.c (replace_block_by): Update. * tree-ssa-threadupdate.c (create_block_for_threading): Update. (compute_path_counts): Update. (update_profile): Update. (recompute_probabilities): Update. (update_joiner_offpath_counts): Update. (estimated_freqs_path): Update. (freqs_to_counts_path): Update. (clear_counts_path): Update. (ssa_fix_duplicate_block_edges): Update. (duplicate_thread_path): Update. * tree-switch-conversion.c (case_bit_test_cmp): Update. (struct switch_conv_info): Update. * tree-tailcall.c (decrease_profile): Update. * tree-vect-loop-manip.c (slpeel_add_loop_guard): Update. * tree-vect-loop.c (scale_profile_for_vect_loop): Update. * value-prof.c (check_counter): Update. (gimple_divmod_fixed_value): Update. (gimple_mod_pow2): Update. (gimple_mod_subtract): Update. (gimple_ic_transform): Update. (gimple_stringop_fixed_value): Update. * value-prof.h (gimple_ic): Update. * gcc.dg/tree-ssa/attr-hotcold-2.c: Update template. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@248863 138bc75d-0d04-0410-961f-82ee72b054a4
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@248113 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-22 PR tree-optimization/80072Jakub Jelinek
* tree-ssa-reassoc.c (struct operand_entry): Change id field type to unsigned int. (next_operand_entry_id): Change type to unsigned int. (sort_by_operand_rank): Make sure to return the right return value even if unsigned fields are bigger than INT_MAX. (struct oecount): Change cnt and id type to unsigned int. (oecount_hasher::equal): Formatting fix. (oecount_cmp): Make sure to return the right return value even if unsigned fields are bigger than INT_MAX. (undistribute_ops_list): Change next_oecount_id type to unsigned int. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@246408 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-10 PR tree-optimization/79411Jakub Jelinek
* tree-ssa-reassoc.c (is_reassociable_op): Return false if stmt operands are SSA_NAMEs used in abnormal phis. (can_reassociate_p): Return false if op is SSA_NAME used in abnormal phis. * gcc.c-torture/compile/pr79411.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@245324 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-24Fix false positive for -Walloc-size-larger-than (PR bootstrap/79132).Martin Liska
2017-01-24 Martin Liska <mliska@suse.cz> PR bootstrap/79132 * tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Insert assert that would prevent us to call alloca with -1 as argument. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@244857 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-01 Update copyright years.Jakub Jelinek
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@243994 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-09 PR tree-optimization/78726Jakub Jelinek
* tree-ssa-reassoc.c (make_new_ssa_for_def): Add OPCODE and OP argument. For lhs uses in debug stmts, don't replace lhs with new_lhs, but with a debug temp set to new_lhs opcode op. (make_new_ssa_for_all_defs): Add OPCODE argument, pass OPCODE and OP down to make_new_ssa_for_def. (zero_one_operation): Call make_new_ssa_for_all_defs even when stmts_to_fix is empty, if *def has not changed yet. Pass OPCODE to make_new_ssa_for_all_defs. * gcc.c-torture/execute/pr78726.c: New test. * gcc.dg/guality/pr78726.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@243476 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-092016-11-09 Richard Biener <rguenther@suse.de>Richard Biener
* fold-const.c (tree_swap_operands_p): Remove unused arg. * fold-const.c (tree_swap_operands_p): Likewise. (fold_binary_loc): Adjust. (fold_ternary_loc): Likewise. * genmatch.c (dt_operand::gen_gimple_exp): Likewise. * gimple-fold.c (fold_stmt_1): Likewise. * gimple-match-head.c (gimple_resimplify2): Likewise. (gimple_resimplify3): Likewise. (gimple_simplify): Likewise. * tree-ssa-dom.c (record_equality): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_var_bound): Likewise. * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition_1): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@242004 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-31 PR tree-optimization/77860Jakub Jelinek
* tree-ssa-reassoc.c (eliminate_using_constants): Handle also integral complex and vector constants. * gcc.dg/pr77860.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@241706 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-13Move MEMMODEL_* from coretypes.h to memmodel.hThomas Preud'homme
2016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com> gcc/ * coretypes.h: Move MEMMODEL_* macros and enum memmodel definition into ... * memmodel.h: This file. * alias.c, asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, caller-save.c, calls.c, ccmp.c, cfgbuild.c, cfgcleanup.c, cfgexpand.c, cfgloopanal.c, cfgrtl.c, cilk-common.c, combine.c, combine-stack-adj.c, common/config/aarch64/aarch64-common.c, common/config/arm/arm-common.c, common/config/bfin/bfin-common.c, common/config/c6x/c6x-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/nvptx/nvptx-common.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-c.c, config/aarch64/cortex-a57-fma-steering.c, config/arc/arc.c, config/arc/arc-c.c, config/arm/arm-builtins.c, config/arm/arm-c.c, config/avr/avr.c, config/avr/avr-c.c, config/avr/avr-log.c, config/bfin/bfin.c, config/c6x/c6x.c, config/cr16/cr16.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/epiphany/epiphany.c, config/epiphany/mode-switch-use.c, config/epiphany/resolve-sw-modes.c, config/fr30/fr30.c, config/frv/frv.c, config/ft32/ft32.c, config/h8300/h8300.c, config/i386/i386-c.c, config/i386/winnt.c, config/iq2000/iq2000.c, config/lm32/lm32.c, config/m32c/m32c.c, config/m32r/m32r.c, config/m68k/m68k.c, config/mcore/mcore.c, config/microblaze/microblaze.c, config/mmix/mmix.c, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-memory-manipulation.c, config/nds32/nds32-predicates.c, config/nds32/nds32.c, config/nios2/nios2.c, config/nvptx/nvptx.c, config/pa/pa.c, config/pdp11/pdp11.c, config/rl78/rl78.c, config/rs6000/rs6000-c.c, config/rx/rx.c, config/s390/s390-c.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh-c.c, config/sh/sh-mem.cc, config/sh/sh_treg_combine.cc, config/sol2.c, config/spu/spu.c, config/stormy16/stormy16.c, config/tilegx/tilegx.c, config/tilepro/tilepro.c, config/v850/v850.c, config/vax/vax.c, config/visium/visium.c, config/vms/vms-c.c, config/xtensa/xtensa.c, coverage.c, cppbuiltin.c, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, df-core.c, df-problems.c, df-scan.c, dojump.c, dse.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, except.c, explow.c, expmed.c, expr.c, final.c, fold-const.c, function.c, fwprop.c, gcse.c, ggc-page.c, haifa-sched.c, hsa-brig.c, hsa-gen.c, hw-doloop.c, ifcvt.c, init-regs.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-lives.c, ira.c, jump.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lra.c, lra-assigns.c, lra-coalesce.c, lra-constraints.c, lra-eliminations.c, lra-lives.c, lra-remat.c, lra-spills.c, mode-switching.c, modulo-sched.c, omp-low.c, passes.c, postreload-gcse.c, postreload.c, predict.c, print-rtl-function.c, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, reload.c, reload1.c, reorg.c, resource.c, rtl-chkp.c, rtl-tests.c, rtlanal.c, rtlhooks.c, sched-deps.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, shrink-wrap.c, simplify-rtx.c, stack-ptr-mod.c, stmt.c, stor-layout.c, target-globals.c, targhooks.c, toplev.c, tree-nested.c, tree-outof-ssa.c, tree-profile.c, tree-ssa-coalesce.c, tree-ssa-ifcombine.c, tree-ssa-loop-ivopts.c, tree-ssa-loop.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-vect-data-refs.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Include memmodel.h. * genattrtab.c (write_header): Include memmodel.h in generated file. * genautomata.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genconditions.c (write_header): Include memmodel.h earlier in generated file. * genemit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * Makefile.in (PLUGIN_HEADERS): Include memmodel.h gcc/ada/ * gcc-interface/utils2.c: Include memmodel.h. gcc/c-family/ * c-cppbuiltin.c: Include memmodel.h. * c-opts.c: Likewise. * c-pragma.c: Likewise. * c-warn.c: Likewise. gcc/c/ * c-typeck.c: Include memmodel.h. gcc/cp/ * decl2.c: Include memmodel.h. * rtti.c: Likewise. gcc/fortran/ * trans-intrinsic.c: Include memmodel.h. gcc/go/ * go-backend.c: Include memmodel.h. libgcc/ * libgcov-profiler.c: Replace MEMMODEL_* macros by their __ATOMIC_* equivalent. * config/tilepro/atomic.c: Likewise and stop casting model to enum memmodel. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@241121 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-12 PR tree-optimization/77929Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle (*ops)[ranges[i].idx]->op != ranges[i].exp case. * gcc.c-torture/compile/pr77929.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@241019 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-09 PR tree-optimization/77901Jakub Jelinek
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize if ranges[i].exp is SSA_NAME when looking for >= and only when ranges[i].exp is NULL or SSA_NAME when looking for the other comparison. * gcc.c-torture/compile/pr77901.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@240899 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-07 PR tree-optimization/77664Jakub Jelinek
* tree-ssa-reassoc.c (update_range_test): Also clear low and high for the other ranges. (optimize_range_tests_diff): Fix up formatting. (optimize_range_tests_var_bound): New function. (optimize_range_tests): Use it. * gcc.dg/tree-ssa/pr77664.c: New test. * gcc.dg/pr77664.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@240858 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-26Fix PR77719Kugan Vivekanandarajah
gcc/testsuite/ChangeLog: 2016-09-26 Kugan Vivekanandarajah <kuganv@linaro.org> PR middle-end/77719 * gfortran.dg/pr77719.f90: New test. gcc/ChangeLog: 2016-09-26 Kugan Vivekanandarajah <kuganv@linaro.org> PR middle-end/77719 * tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs instead of gimple_assign_lhs as stmt can be builtins too. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@240505 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-21Incorrect arithmetic optimization involving bitfield argumentsKugan Vivekanandarajah
gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> PR tree-optimization/72835 * tree-ssa-reassoc.c (make_new_ssa_for_def): New. (make_new_ssa_for_all_defs): Likewise. (zero_one_operation): Replace all SSA_NAMEs defined in the chain. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> PR tree-optimization/72835 * gcc.dg/tree-ssa/pr72835.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@240299 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-27gcc/testsuite/ChangeLog:Kugan Vivekanandarajah
2016-07-28 Kugan Vivekanandarajah <kuganv@linaro.org> PR middle-end/71994 * gcc.dg/torture/pr71994.c: New test. gcc/ChangeLog: 2016-07-28 Kugan Vivekanandarajah <kuganv@linaro.org> PR middle-end/71994 * tree-ssa-reassoc.c (maybe_optimize_range_tests): Check tcc_comparison before calling get_ops. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@238802 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-26use auto_sbitmap in various placesTrevor Saunders
gcc/ChangeLog: 2016-07-26 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * bt-load.c (compute_out): Use auto_sbitmap class. (link_btr_uses): Likewise. * cfganal.c (mark_dfs_back_edges): Likewise. (post_order_compute): Likewise. (inverted_post_order_compute): Likewise. (pre_and_rev_post_order_compute_fn): Likewise. (single_pred_before_succ_order): Likewise. * cfgexpand.c (pass_expand::execute): Likewise. * cfgloop.c (verify_loop_structure): Likewise. * cfgloopmanip.c (fix_bb_placements): Likewise. (remove_path): Likewise. (update_dominators_in_loop): Likewise. * cfgrtl.c (break_superblocks): Likewise. * ddg.c (check_sccs): Likewise. (create_ddg_all_sccs): Likewise. * df-core.c (df_worklist_dataflow): Likewise. * dse.c (dse_step3): Likewise. * except.c (eh_region_outermost): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (prune_expressions): Likewise. (prune_insertions_deletions): Likewise. * gimple-ssa-backprop.c (backprop::~backprop): Likewise. * graph.c (draw_cfg_nodes_no_loops): Likewise. * ira-lives.c (remove_some_program_points_and_update_live_ranges): Likewise. * lcm.c (compute_earliest): Likewise. (compute_farthest): Likewise. * loop-unroll.c (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. (unroll_loop_stupid): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lra-lives.c: Likewise. * lra.c (lra): Likewise. * modulo-sched.c (schedule_reg_moves): Likewise. (optimize_sc): Likewise. (get_sched_window): Likewise. (sms_schedule_by_order): Likewise. (check_nodes_order): Likewise. (order_nodes_of_sccs): Likewise. (order_nodes_in_scc): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (pass_cprop_hardreg::execute): Likewise. * reload1.c (reload): Likewise. * sched-rgn.c (haifa_find_rgns): Likewise. (split_edges): Likewise. (compute_trg_info): Likewise. * sel-sched.c (init_seqno): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. * tree-into-ssa.c (update_ssa): Likewise. * tree-ssa-live.c (live_worklist): Likewise. * tree-ssa-loop-im.c (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): * Likewise. (try_peel_loop): Likewise. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): * Likewise. * tree-ssa-pre.c (compute_antic): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Likewise. * var-tracking.c (vt_find_locations): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@238748 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-25Call get_ops just for SSA_NAMEs (PR tree-optimization/71987)Martin Liska
PR tree-optimization/71987 * tree-ssa-reassoc.c (maybe_optimize_range_tests): Call get_ops just for SSA_NAMEs. Fix GNU coding style. * gcc.dg/torture/pr71987.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@238704 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-24gcc/ChangeLog:Kugan Vivekanandarajah
2016-07-24 Kugan Vivekanandarajah <kuganv@linaro.org> PR middle-end/66726 * tree-ssa-reassoc.c (optimize_vec_cond_expr): Handle tcc_compare stmt whose result is used in PHI. (final_range_test_p): Likewise. (maybe_optimize_range_tests): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@238695 138bc75d-0d04-0410-961f-82ee72b054a4