Commit Graph

157264 Commits

Author SHA1 Message Date
Andreas Tobler 59fcf6c3ec re PR libgcc/82635 (std::thread's join broken on FreeBSD with all GCCs >= 5)
2017-11-04  Andreas Tobler  <andreast@gcc.gnu.org>

    PR libgcc/82635
    * config/i386/freebsd-unwind.h (MD_FALLBACK_FRAME_STATE_FOR): Use a
    sysctl to determine whether we're in a trampoline.
    Keep the pattern matching method for systems without
    KERN_PROC_SIGTRAMP sysctl.

From-SVN: r254411
2017-11-04 20:40:23 +01:00
Andre Vehreschild 7c4acac3a0 trans-expr.c (gfc_trans_assignment_1): Character kind conversion may create a loop variant temporary, too.
gcc/fortran/ChangeLog:

2017-11-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	* trans-expr.c (gfc_trans_assignment_1): Character kind conversion may
	create a loop variant temporary, too.
	* trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and
	not as scalars.
	* trans.c (get_array_span): Take the character kind into account when
	doing pointer arithmetic.

gcc/testsuite/ChangeLog:

2017-11-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray/send_char_array_1.f90: New test.

From-SVN: r254407
2017-11-04 15:35:45 +01:00
Thomas Koenig 0260e27840 re PR fortran/70330 (ICE with -Wextra -Wno-unused-dummy-argument and unused optional dummy argument)
2017-11-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/70330
	* gfortran.dg/pr70330.f90: New test.

From-SVN: r254406
2017-11-04 13:54:27 +00:00
Thomas Koenig 9a3d38f6dc re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
2017-11-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/29600
	* gfortran.h (gfc_check_f): Replace fm3l with fm4l.
	* intrinsic.h (gfc_resolve_maxloc): Add gfc_expr * to argument
	list in protoytpe.
	(gfc_resolve_minloc): Likewise.
	* check.c (gfc_check_minloc_maxloc): Handle kind argument.
	* intrinsic.c (add_sym_3_ml): Rename to
	(add_sym_4_ml): and handle kind argument.
	(add_function): Replace add_sym_3ml with add_sym_4ml and add
	extra arguments for maxloc and minloc.
	(check_specific): Change use of check.f3ml with check.f4ml.
	* iresolve.c (gfc_resolve_maxloc): Handle kind argument. If
	the kind is smaller than the smallest library version available,
	use gfc_default_integer_kind and convert afterwards.
	(gfc_resolve_minloc): Likewise.

2017-11-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/29600
	* gfortran.dg/minmaxloc_8.f90: New test.

From-SVN: r254405
2017-11-04 13:20:32 +00:00
Paul Thomas 77dacf9da6 re PR fortran/81735 (double free or corruption (fasttop) error (SIGABRT) with character(:) and custom return type with allocatable)
2017-11-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81735
	* trans-decl.c (gfc_trans_deferred_vars): Do a better job of a
	case where 'tmp' was used unititialized and remove TODO.

2017-11-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81735
	* gfortran.dg/pr81735.f90: New test.

From-SVN: r254404
2017-11-04 09:07:09 +00:00
Steven G. Kargl 9cfdd48417 re PR fortran/82796 (Private+equivalence in used module breaks compilation of pure function)
2017-11-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82796
	* resolve.c (resolve_equivalence): An entity in a common block within
 	a module cannot appear in an equivalence statement if the entity is
	with a pure procedure.

2017-11-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82796
	* gfortran.dg/equiv_pure.f90: New test.

From-SVN: r254403
2017-11-04 00:34:40 +00:00
GCC Administrator da768c5b5c Daily bump.
From-SVN: r254402
2017-11-04 00:16:16 +00:00
Jeff Law 150e34760f re PR target/82823 (ICE in ix86_expand_prologue, at config/i386/i386.c:13171 with -fstack-clash-protection)
PR target/82823
	* g++.dg/torture/pr82823.C: New test.

From-SVN: r254398
2017-11-03 14:42:41 -06:00
Jeff Law 65ee6cb539 Add BZ marker to a recent change
From-SVN: r254397
2017-11-03 14:36:01 -06:00
Jeff Law 61959ba10b i386.c (ix86_emit_restore_reg_using_pop): Prototype.
* config/i386/i386.c (ix86_emit_restore_reg_using_pop): Prototype.
	(ix86_adjust_stack_and_probe_stack_clash): Use a push/pop sequence
	to probe at the start of a noreturn function.

	* gcc.target/i386/stack-check-12.c: New test.

From-SVN: r254396
2017-11-03 14:30:53 -06:00
Jakub Jelinek 245f6de13d re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field not optimised into copying whole 32 bits at once)
PR tree-optimization/78821
	* gimple-ssa-store-merging.c: Update the file comment.
	(MAX_STORE_ALIAS_CHECKS): Define.
	(struct store_operand_info): New type.
	(store_operand_info::store_operand_info): New constructor.
	(struct store_immediate_info): Add rhs_code and ops data members.
	(store_immediate_info::store_immediate_info): Add rhscode, op0r
	and op1r arguments to the ctor, initialize corresponding data members.
	(struct merged_store_group): Add load_align_base and load_align
	data members.
	(merged_store_group::merged_store_group): Initialize them.
	(merged_store_group::do_merge): Update them.
	(merged_store_group::apply_stores): Pick the constant for
	encode_tree_to_bitpos from one of the two operands, or skip
	encode_tree_to_bitpos if neither operand is a constant.
	(class pass_store_merging): Add process_store method decl.  Remove
	bool argument from terminate_all_aliasing_chains method decl.
	(pass_store_merging::terminate_all_aliasing_chains): Remove
	var_offset_p argument and corresponding handling.
	(stmts_may_clobber_ref_p): New function.
	(compatible_load_p): New function.
	(imm_store_chain_info::coalesce_immediate_stores): Terminate group
	if there is overlap and rhs_code is not INTEGER_CST.  For
	non-overlapping stores terminate group if rhs is not mergeable.
	(get_alias_type_for_stmts): Change first argument from
	auto_vec<gimple *> & to vec<gimple *> &.  Add IS_LOAD, CLIQUEP and
	BASEP arguments.  If IS_LOAD is true, look at rhs1 of the stmts
	instead of lhs.  Compute *CLIQUEP and *BASEP in addition to the
	alias type.
	(get_location_for_stmts): Change first argument from
	auto_vec<gimple *> & to vec<gimple *> &.
	(struct split_store): Remove orig_stmts data member, add orig_stores.
	(split_store::split_store): Create orig_stores rather than orig_stmts.
	(find_constituent_stmts): Renamed to ...
	(find_constituent_stores): ... this.  Change second argument from
	vec<gimple *> * to vec<store_immediate_info *> *, push pointers
	to info structures rather than the statements.
	(split_group): Rename ALLOW_UNALIGNED argument to
	ALLOW_UNALIGNED_STORE, add ALLOW_UNALIGNED_LOAD argument and handle
	it.  Adjust find_constituent_stores caller.
	(imm_store_chain_info::output_merged_store): Handle rhs_code other
	than INTEGER_CST, adjust split_group, get_alias_type_for_stmts and
	get_location_for_stmts callers.  Set MR_DEPENDENCE_CLIQUE and
	MR_DEPENDENCE_BASE on the MEM_REFs if they are the same in all stores.
	(mem_valid_for_store_merging): New function.
	(handled_load): New function.
	(pass_store_merging::process_store): New method.
	(pass_store_merging::execute): Use process_store method.  Adjust
	terminate_all_aliasing_chains caller.

	* gcc.dg/store_merging_13.c: New test.
	* gcc.dg/store_merging_14.c: New test.

From-SVN: r254391
2017-11-03 20:08:25 +01:00
Steven G. Kargl 248b06ba7d 2017-11-3 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/large_real_kind_2.F90: Test passes on FreeBSD.  Remove
	dg-xfail-if directive.

From-SVN: r254390
2017-11-03 19:03:59 +00:00
Wilco Dijkstra 26895c21eb Improve aarch64_legitimate_constant_p
This patch further improves aarch64_legitimate_constant_p.  Allow all
integer, floating point and vector constants.  Allow label references
and non-anchor symbols with an immediate offset.  This allows such
constants to be rematerialized, resulting in smaller code and fewer stack
spills.  SPEC2006 codesize reduces by 0.08%, SPEC2017 by 0.13%.

    gcc/
	* config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
	Return true for more constants, symbols and label references.
	(aarch64_valid_floating_const): Remove unused function.

From-SVN: r254388
2017-11-03 18:19:33 +00:00
Sandra Loosemore f66060c602 msa.c: Add -fcommon to dg-options.
2017-11-03  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* gcc.target/mips/msa.c: Add -fcommon to dg-options.

From-SVN: r254387
2017-11-03 13:45:45 -04:00
Jeff Law 74a6366d23 i386.c (ix86_expand_prologue): Tighten assert for int_registers_saved.
* config/i386/i386.c (ix86_expand_prologue): Tighten assert
	for int_registers_saved.

From-SVN: r254386
2017-11-03 11:14:23 -06:00
Uros Bizjak ece615ecc6 re PR testsuite/82828 (i386/pr70263-2.c fail)
PR testsuite/82828
	PR rtl-optimization/70263
	* gcc.target/i386/pr70263-2.c: Fix invalid testcase.

From-SVN: r254385
2017-11-03 17:37:39 +01:00
Wilco Dijkstra 33a2e348a5 re PR c++/82768 (ICE in synthesize_implicit_template_parm, at cp/parser.c:39338)
Fix PR82768

Forcing LR at the bottom of the frame caused a few test failures.
Since there are some cases that generate worse code, revert this
part, and the frame tests pass again.

    gcc/
	PR target/82786
	* config/aarch64/aarch64.c (aarch64_layout_frame):
	Undo forcing of LR at bottom of frame.

From-SVN: r254384
2017-11-03 16:29:47 +00:00
Jeff Law 2965f1274c cfganal.c (single_pred_edge_ignoring_loop_edges): New function extracted from tree-ssa-dom.c.
* cfganal.c (single_pred_edge_ignoring_loop_edges): New function
	extracted from tree-ssa-dom.c.
	* cfganal.h (single_pred_edge_ignoring_loop_edges): Prototype.
	* tree-ssa-dom.c (single_incoming_edge_ignoring_loop_edges): Remove.
	(record_equivalences_from_incoming_edge): Add additional argument
	to single_pred_edge_ignoring_loop_edges call.
	* tree-ssa-uncprop.c (single_incoming_edge_ignoring_loop_edges): Remove.
	(uncprop_dom_walker::before_dom_children): Add additional argument
	to single_pred_edge_ignoring_loop_edges call.
	* tree-ssa-sccvn.c (sccvn_dom_walker::before_dom_children): Use
	single_pred_edge_ignoring_loop_edges rather than open coding.
	* tree-vrp.c (evrp_dom_walker::before_dom_children): Similarly.

From-SVN: r254383
2017-11-03 10:28:28 -06:00
Marc Glisse 6362654793 Generalize -(-X) a little
2017-11-03  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* match.pd (-(-A)): Rewrite.

gcc/testsuite/
	* gcc.dg/tree-ssa/negneg-1.c: New file.
	* gcc.dg/tree-ssa/negneg-2.c: Likewise.
	* gcc.dg/tree-ssa/negneg-3.c: Likewise.
	* gcc.dg/tree-ssa/negneg-4.c: Likewise.

From-SVN: r254382
2017-11-03 16:23:57 +00:00
Jonathan Wakely e641ee437f Define std::endian for C++2a (P0463R1)
* include/std/type_traits (endian): Define new enumeration type.
	* testsuite/20_util/endian/1.cc: New test.

From-SVN: r254381
2017-11-03 15:45:49 +00:00
Segher Boessenkool d04814543c rs6000: Remove rs6000_emit_sISEL
Instead of calling rs6000_emit_sISEL, call rs6000_emit_int_cmove
directly, in the one place it is used.


	* config/rs6000/rs60000-protos.h (rs6000_emit_sISEL): Delete.
	(rs6000_emit_int_cmove): New declaration.
	* config/rs6000/rs6000.c (rs6000_emit_int_cmove): Delete declaration.
	(rs6000_emit_sISEL): Delete.
	(rs6000_emit_int_cmove): Make non-static.
	* config/rs6000/rs6000.md (cstore<mode>4): Use rs6000_emit_int_cmove
	instead of rs6000_emit_sISEL.

From-SVN: r254380
2017-11-03 16:44:29 +01:00
Jan Hubicka e7a740068e asan.c (create_cond_insert_point): Maintain profile.
* asan.c (create_cond_insert_point): Maintain profile.
	* ipa-utils.c (ipa_merge_profiles): Be sure only IPA profiles are
	merged.
	* basic-block.h (struct basic_block_def): Remove frequency.
	(EDGE_FREQUENCY): Use to_frequency
	* bb-reorder.c (push_to_next_round_p): Use only IPA counts for global
	heuristics.
	(find_traces): Update to use to_frequency.
	(find_traces_1_round): Likewise; use only IPA counts.
	(bb_to_key): Likewise.
	(connect_traces): Use IPA counts only.
	(copy_bb_p): Update to use to_frequency.
	(fix_up_crossing_landing_pad): Likewise.
	(sanitize_hot_paths): Likewise.
	* bt-load.c (basic_block_freq): Likewise.
	* cfg.c (init_flow): Set count_max to uninitialized.
	(check_bb_profile): Remove frequencies; check counts.
	(dump_bb_info): Do not dump frequencies.
	(update_bb_profile_for_threading): Update counts only.
	(scale_bbs_frequencies_int): Likewise.
	(MAX_SAFE_MULTIPLIER): Remove.
	(scale_bbs_frequencies_gcov_type): Update counts only.
	(scale_bbs_frequencies_profile_count): Update counts only.
	(scale_bbs_frequencies): Update counts only.
	* cfg.h (struct control_flow_graph): Add count-max.
	(update_bb_profile_for_threading): Update prototype.
	* cfgbuild.c (find_bb_boundaries): Do not update frequencies.
	(find_many_sub_basic_blocks): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	(try_crossjump_to_edge): Likewise.
	* cfgexpand.c (expand_gimple_cond): Likewise.
	(expand_gimple_tailcall): Likewise.
	(construct_init_block): Likewise.
	(construct_exit_block): Likewise.
	* cfghooks.c (verify_flow_info): Check consistency of counts.
	(dump_bb_for_graph): Do not dump frequencies.
	(split_block_1): Do not update frequencies.
	(split_edge): Do not update frequencies.
	(make_forwarder_block): Do not update frequencies.
	(duplicate_block): Do not update frequencies.
	(account_profile_record): Do not update frequencies.
	* cfgloop.c (find_subloop_latch_edge_by_profile): Use IPA counts
	for global heuristics.
	* cfgloopanal.c (average_num_loop_insns): Update to use to_frequency.
	(expected_loop_iterations_unbounded): Use counts only.
	* cfgloopmanip.c (scale_loop_profile): Simplify.
	(create_empty_loop_on_edge): Simplify
	(loopify): Simplify
	(duplicate_loop_to_header_edge): Simplify
	* cfgrtl.c (force_nonfallthru_and_redirect): Update profile.
	(update_br_prob_note): Take care of removing note when profile
	becomes undefined.
	(relink_block_chain): Do not dump frequency.
	(rtl_account_profile_record): Use to_frequency.
	* cgraph.c (symbol_table::create_edge): Convert count to ipa count.
	(cgraph_edge::redirect_call_stmt_to_calle): Conver tcount to ipa count.
	(cgraph_update_edges_for_call_stmt_node): Likewise.
	(cgraph_edge::verify_count_and_frequency): Update.
	(cgraph_node::verify_node): Temporarily disable frequency verification.
	* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
	to_cgraph_frequency.
	(cgraph_edge::rebuild_edges): Convert to ipa counts.
	* cgraphunit.c (init_lowered_empty_function): Do not initialize
	frequencies.
	(cgraph_node::expand_thunk): Update profile.
	* except.c (dw2_build_landing_pads): Do not update frequency.
	* final.c (compute_alignments): Use to_frequency.
	(dump_basic_block_info): Do not dump frequency.
	* gimple-pretty-print.c (dump_profile): Do not dump frequency.
	(dump_gimple_bb_header): Do not dump frequency.
	* gimple-ssa-isolate-paths.c (isolate_path): Do not update frequency;
	do update count.
	* gimple-streamer-in.c (input_bb): Do not stream frequency.
	* gimple-streamer-out.c (output_bb): Do not stream frequency.
	* haifa-sched.c (sched_pressure_start_bb): Use to_freuqency.
	(init_before_recovery): Do not update frequency.
	(sched_create_recovery_edges): Do not update frequency.
	* hsa-gen.c (convert_switch_statements): Do not update frequency.
	* ipa-cp.c (ipcp_propagate_stage): Update search for max_count.
	(ipa_cp_c_finalize): Set max_count to uninitialized.
	* ipa-fnsummary.c (get_minimal_bb): Use counts.
	(param_change_prob): Use counts.
	* ipa-profile.c (ipa_profile_generate_summary): Do not summarize
	local profiles.
	* ipa-split.c (consider_split): Use to_frequency.
	(split_function): Use to_frequency.
	* ira-build.c (loop_compare_func): Likewise.
	(mark_loops_for_removal): Likewise.
	(mark_all_loops_for_removal): Likewise.
	* loop-doloop.c (doloop_modify): Do not update frequency.
	* loop-unroll.c (unroll_loop_runtime_iterations): Do not update
	frequency.
	* lto-streamer-in.c (input_function): Update count_max.
	* omp-expand.c (expand_omp_taskreg): Update count_max.
	* omp-simd-clone.c (simd_clone_adjust): Update profile.
	* predict.c (maybe_hot_frequency_p): Use to_frequency.
	(maybe_hot_count_p): Use ipa counts only.
	(maybe_hot_bb_p): Simplify.
	(maybe_hot_edge_p): Simplify.
	(probably_never_executed): Do not take frequency argument.
	(probably_never_executed_bb_p): Do not pass frequency.
	(probably_never_executed_edge_p): Likewise.
	(combine_predictions_for_bb): Check that profile is nonzero.
	(propagate_freq): Do not set frequency.
	(drop_profile): Simplify.
	(counts_to_freqs): Simplify.
	(expensive_function_p): Use to_frequency.
	(propagate_unlikely_bbs_forward): Simplify.
	(determine_unlikely_bbs): Simplify.
	(estimate_bb_frequencies): Add hack to silence graphite issues.
	(compute_function_frequency): Use ipa counts.
	(pass_profile::execute): Update.
	(rebuild_frequencies): Use counts only.
	(force_edge_cold): Use counts only.
	* profile-count.c (profile_count::dump): Dump new count types.
	(profile_count::differs_from_p): Check compatiblity.
	(profile_count::to_frequency): New function.
	(profile_count::to_cgraph_frequency): New function.
	* profile-count.h (struct function): Declare.
	(enum profile_quality): Add profile_guessed_local and
	profile_guessed_global0.
	(class profile_proability): Decrease number of bits to 29;
	update from_reg_br_prob_note and to_reg_br_prob_note.
	(class profile_count: Update comment; decrease number of bits
	to 61. Check compatibility.
	(profile_count::compatible_p): New private member function.
	(profile_count::ipa_p): New member function.
	(profile_count::operator<): Handle global zero correctly.
	(profile_count::operator>): Handle global zero correctly.
	(profile_count::operator<=): Handle global zero correctly.
	(profile_count::operator>=): Handle global zero correctly.
	(profile_count::nonzero_p): New member function.
	(profile_count::force_nonzero): New member function.
	(profile_count::max): New member function.
	(profile_count::apply_scale): Handle IPA scalling.
	(profile_count::guessed_local): New member function.
	(profile_count::global0): New member function.
	(profile_count::ipa): New member function.
	(profile_count::to_frequency): Declare.
	(profile_count::to_cgraph_frequency): Declare.
	* profile.c (OVERLAP_BASE): Delete.
	(compute_frequency_overlap): Delete.
	(compute_branch_probabilities): Do not use compute_frequency_overlap.
	* regs.h (REG_FREQ_FROM_BB): Use to_frequency.
	* sched-ebb.c (rank): Use counts only.
	* shrink-wrap.c (handle_simple_exit): Use counts only.
	(try_shrink_wrapping): Use counts only.
	(place_prologue_for_one_component): Use counts only.
	* tracer.c (find_best_predecessor): Use to_frequency.
	(find_trace): Use to_frequency.
	(tail_duplicate): Use to_frequency.
	* trans-mem.c (expand_transaction): Do not update frequency.
	* tree-call-cdce.c: Do not update frequency. 
	* tree-cfg.c (gimple_find_sub_bbs): Likewise.
	(gimple_merge_blocks): Likewise.
	(gimple_split_edge): Likewise.
	(gimple_duplicate_sese_region): Likewise.
	(gimple_duplicate_sese_tail): Likewise.
	(move_sese_region_to_fn): Likewise.
	(gimple_account_profile_record): Likewise.
	(insert_cond_bb): Likewise.
	* tree-complex.c (expand_complex_div_wide): Likewise.
	* tree-eh.c (lower_resx): Update profile.
	* tree-inline.c (copy_bb): Simplify count scaling; do not scale
	frequencies.
	(initialize_cfun): Do not initialize frequencies
	(freqs_to_counts): Delete.
	(copy_cfg_body): Ignore count parameter.
	(copy_body): Update.
	(expand_call_inline): Update count_max.
	(optimize_inline_calls): Update count_max.
	(tree_function_versioning): Update count_max.
	* tree-ssa-coalesce.c (coalesce_cost_bb): Use to_frequency.
	* tree-ssa-ifcombine.c (update_profile_after_ifcombine): Do not update
	frequency.
	* tree-ssa-loop-im.c (execute_sm_if_changed): Use counts only.
	* tree-ssa-loop-ivcanon.c (unloop_loops): Do not update freuqency.
	(try_peel_loop): Likewise.
	* tree-ssa-loop-ivopts.c (get_scaled_computation_cost_at): Use
	to_frequency.
	* tree-ssa-loop-manip.c (niter_for_unrolled_loop): Pass -1.
	(tree_transform_and_unroll_loop): Do not use frequencies
	* tree-ssa-loop-niter.c (estimate_numbers_of_iterations):
	Use reliable prediction only.
	* tree-ssa-loop-unswitch.c (hoist_guard): Do not use frequencies.
	* tree-ssa-sink.c (select_best_block): Use to_frequency.
	* tree-ssa-tail-merge.c (replace_block_by): Temporarily disable
	probability scaling.
	* tree-ssa-threadupdate.c (create_block_for_threading): Do
	not update frequency
	(any_remaining_duplicated_blocks): Likewise.
	(update_profile): Likewise.
	(estimated_freqs_path): Delete.
	(freqs_to_counts_path): Delete.
	(clear_counts_path): Delete.
	(ssa_fix_duplicate_block_edges): Likewise.
	(duplicate_thread_path): Likewise.
	* tree-switch-conversion.c (gen_inbound_check): Use counts.
	* tree-tailcall.c (decrease_profile): Do not update frequency.
	(eliminate_tail_call): Likewise.
	* tree-vect-loop-manip.c (vect_do_peeling): Likewise.
	* tree-vect-loop.c (scale_profile_for_vect_loop): Likewise.
	(optimize_mask_stores): Likewise.
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
	* ubsan.c (ubsan_expand_null_ifn): Update profile.
	(ubsan_expand_ptr_ifn): Update profile.
	* value-prof.c (gimple_ic): Simplify.
	* value-prof.h (gimple_ic): Update prototype.
	* ipa-inline-transform.c (inline_transform): Fix scaling conditoins.
	* ipa-inline.c (compute_uninlined_call_time): Be sure that
	counts are nonzero.
	(want_inline_self_recursive_call_p): Likewise.
	(resolve_noninline_speculation): Only cummulate defined counts.
	(inline_small_functions): Use nonzero_p.
	(ipa_inline): Do not access freed node.

Unknown ChangeLog:

2017-11-02  Jan Hubicka  <hubicka@ucw.cz>

	* testsuite/gcc.dg/no-strict-overflow-3.c (foo): Update magic
	value to not clash with frequency.
	* testsuite/gcc.dg/strict-overflow-3.c (foo): Likewise.
	* testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c: Update template.
	* testsuite/gcc.dg/tree-ssa/dump-2.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-10.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-11.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-12.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-5.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-8.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-9.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-cd.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-pr56541.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-pr68583.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-pr69489-1.c: Update template.
	* testsuite/gcc.dg/tree-ssa/ifc-pr69489-2.c: Update template.
	* testsuite/gcc.target/i386/pr61403.c: Update template.

From-SVN: r254379
2017-11-03 15:42:30 +00:00
Wilco Dijkstra 13494fcb36 Set default sched pressure algorithm
The Arm backend sets the default sched-pressure algorithm to SCHED_PRESSURE_MODEL.
Benchmarking on AArch64 shows this speeds up floating point performance on SPEC -
eg. CactusBSSN improves by ~16%.  The gains are mostly due to less spilling,
so enable this on AArch64 by default.

    gcc/
	* config/aarch64/aarch64.c (aarch64_override_options_internal):
	Set PARAM_SCHED_PRESSURE_ALGORITHM to SCHED_PRESSURE_MODEL.

From-SVN: r254378
2017-11-03 15:20:53 +00:00
Kito Cheng 13e4f305e0 RISC-V: Handle non-legitimate address in riscv_legitimize_move
GCC may generate non-legitimate address due to we allow some
load/store with non-legitimate address in pic.md.

gcc/ChangeLog

2017-11-03  Kito Cheng  <kito.cheng@gmail.com>

        * config/riscv/riscv.c (riscv_legitimize_move): Handle
        non-legitimate address.

From-SVN: r254376
2017-11-03 14:59:39 +00:00
Nathan Sidwell 91afdf4c79 [PATCH] Fix testsuire error message
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00196.html
	* lib/scanlang.exp: Fix error message to refer to scan-lang-dump.

From-SVN: r254375
2017-11-03 14:18:01 +00:00
Segher Boessenkool 187bd6cd5e rs6000: Improve *lt0 patterns
The rs6000 port currently has an *lt0_disi define_insn, setting the DI
result to whether the SI argument is negative or not.  It turns out the
generic optimisers cannot always figure out in the other cases either
that this is just a shift for us.  This patch adds patterns for all
four SI/DI combinations.


	* config/rs6000/rs6000.md (*lt0_disi): Delete.
	(*lt0_<mode>di, *lt0_<mode>si): New.

From-SVN: r254374
2017-11-03 15:09:10 +01:00
Segher Boessenkool b15a4bc972 rs6000: move_from_CR_ov_bit is TARGET_PAIRED_FLOAT, not TARGET_ISEL
* config/rs6000/rs6000.md (move_from_CR_ov_bit): Change condition to
	TARGET_PAIRED_FLOAT.

From-SVN: r254373
2017-11-03 15:07:25 +01:00
Siddhesh Poyarekar 52ee8191dc [aarch64] Add Qualcomm saphira CPU support.
This patch adds an mcpu option for the Qualcomm saphira server part.
Tested on aarch64 and did not find any regressions resulting from this
patch.

2017-11-03  Siddhesh Poyarekar  <siddhesh.poyarekar@linaro.org>
	    Jim Wilson  <jim.wilson@linaro.org>

	* config/aarch64/aarch64-cores.def (saphira): New CPU.
	* config/aarch64/aarch64-tune.md: Regenerated.
	* doc/invoke.texi (AArch64 Options/-mtune): Add "saphira".
	* gcc/config/aarch64/aarch64.c (saphira_tunings): New tuning table.


Co-Authored-By: Jim Wilson <jim.wilson@linaro.org>

From-SVN: r254372
2017-11-03 13:26:28 +00:00
Nathan Sidwell a93ee058fa [PR c++/82710] false positive paren warning
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00186.html
	PR c++/82710
	* decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
	warning too.

	PR c++/82710
	* g++.dg/warn/pr82710.C: More cases.

From-SVN: r254371
2017-11-03 13:16:06 +00:00
Jonathan Wakely 97695d99b0 Remove _Node_insert_return::get() member functions (P0508R0)
* include/bits/node_handle.h (_Node_insert_return::get): Remove, as
	per P0508R0.

From-SVN: r254368
2017-11-03 11:04:45 +00:00
Cupertino Miranda b0c7ddf816 [ARC] Fix to unwinding.
gcc/ChangeLog:
2017-11-03  Cupertino Miranda  <cmiranda@synopsys.com>

        * config/arc/arc.c (arc_save_restore): Corrected CFA note.
        (arc_expand_prologue): Restore blink for millicode.
        * config/arc/linux.h (LINK_EH_SPEC): Defined.

libgcc/ChangeLog:
2017-11-03  Cupertino Miranda  <cmiranda@synopsys.com>
            Vineet Gupta <vgupta@synopsys.com>

        * config.host (arc*-*-linux*): Set md_unwind_header variable.
        * config/arc/linux-unwind-reg.def: New file.
        * config/arc/linux-unwind.h: Likewise.

Co-Authored-By: Vineet Gupta <vgupta@synopsys.com>

From-SVN: r254367
2017-11-03 11:51:18 +01:00
Richard Sandiford a34a16abe5 PR82809: register handling in ix86_vector_duplicate_value
When adding the call to gen_vec_duplicate, I failed to notice that
code further down modified the VEC_DUPLICATE in place.  That isn't
safe if gen_vec_duplicate returned a const_vector.

2017-11-02  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR target/82809
	* config/i386/i386.c (ix86_vector_duplicate_value): Use
	gen_vec_duplicate after forcing the scalar into a register.

gcc/testsuite/
	* gcc.dg/pr82809.c: New test.

From-SVN: r254366
2017-11-03 09:24:28 +00:00
Segher Boessenkool f53bd85648 combine: Print insns we try to combine
This adds some extra debug info to the dump file for combine: print
the insns that are input to try_combine.  I was worried printing more
will make the dump file only harder to read, but especially the info
from the REG_DEAD notes is invaluable.


	* combine (try_combine): Print the insns input to try_combine to the
	dump file.

From-SVN: r254365
2017-11-03 01:19:06 +01:00
GCC Administrator 89513a1c42 Daily bump.
From-SVN: r254364
2017-11-03 00:16:19 +00:00
Paolo Carlini d5f0b3f0bb re PR c++/81957 (ICE decltype)
/cp
2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81957
	* pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
	(expand_integer_pack, convert_template_argument, coerce_template_parms,
	gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
	unify): Adjust calls.
	* tree.c (cp_build_qualified_type_real): Likewise.
	* cp-tree.h (make_pack_expansion): Adjust declaration.

/testsuite
2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81957
	* g++.dg/cpp0x/variadic-crash5.C: New.

From-SVN: r254361
2017-11-03 00:13:06 +00:00
Steve Ellcey 718afa1acd re PR target/79868 (aarch64: diagnostic "malformed target %s value" not translateable)
PR target/79868
	* gcc.target/aarch64/spellcheck_1.c: Update dg-error string to match
	new format.
	* gcc.target/aarch64/spellcheck_2.c: Ditto.
	* gcc.target/aarch64/spellcheck_3.c: Ditto.
	* gcc.target/aarch64/target_attr_11.c: Ditto.
	* gcc.target/aarch64/target_attr_12.c: Ditto.
	* gcc.target/aarch64/target_attr_17.c: Ditto.

From-SVN: r254360
2017-11-02 21:58:05 +00:00
Steve Ellcey ab93e9b7d0 re PR target/79868 (aarch64: diagnostic "malformed target %s value" not translateable)
PR target/79868
	* config/aarch64/aarch64-c.c (aarch64_pragma_target_parse):
	Remove second argument from aarch64_process_target_attr call.
	* config/aarch64/aarch64-protos.h (aarch64_process_target_attr):
	Ditto.
	* config/aarch64/aarch64.c (aarch64_attribute_info): Change
	field type.
	(aarch64_handle_attr_arch): Remove second argument.
	(aarch64_handle_attr_cpu): Ditto.
	(aarch64_handle_attr_tune): Ditto.
	(aarch64_handle_attr_isa_flags): Ditto.
	(aarch64_process_one_target_attr): Ditto.
	(aarch64_process_target_attr): Ditto.
	(aarch64_option_valid_attribute_p): Remove second argument.
	on aarch64_process_target_attr call.

From-SVN: r254359
2017-11-02 21:56:00 +00:00
David Malcolm ace725989e Add selftest for diagnostic_get_location_text
gcc/ChangeLog:
	* diagnostic.c: Include "selftest-diagnostic.h".
	(selftest::assert_location_text): New function.
	(selftest::test_diagnostic_get_location_text): New function.
	(selftest::diagnostic_c_tests): Call it.

From-SVN: r254355
2017-11-02 20:13:18 +00:00
David Malcolm ba7bfd9f04 Move selftest::test_diagnostic_context to its own header
It's useful to not rely on global_dc in selftests, so this patch
moves class selftest::test_diagnostic_context from
diagnostic-show-locus.c to a new header and source file.

gcc/ChangeLog:
	* Makefile.in (OBJS-libcommon): Add selftest-diagnostic.o.
	* diagnostic-show-locus.c: Include "selftest-diagnostic.h".
	(class selftest::test_diagnostic_context): Move to...
	* selftest-diagnostic.c: New file.
	* selftest-diagnostic.h: New file.

From-SVN: r254354
2017-11-02 20:09:18 +00:00
James Bowman 7c42a3675c Add FT32B support
FT32B is a new FT32 architecture type. FT32B has a code compression
scheme which uses linker relaxations. It also has a security option to
prevent reads from program memory.

gcc/
	* config/ft32/ft32.c (ft32_addr_space_legitimate_address_p): increase
	offset range for FT32B.
	* config/ft32/ft32.h: option "mcompress" enables relaxation.
	* config/ft32/ft32.md: Add TARGET_NOPM.
	* config/ft32/ft32.opt: Add mft32b, mcompress, mnopm.
	* gcc/doc/invoke.texi: Add mft32b, mcompress, mnopm.

From-SVN: r254351
2017-11-02 19:41:02 +00:00
Nathan Sidwell 9918e7966c [C++ PATCH] overloaded operator fns [8/N]
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00095.html
	* cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
	(IDENTIFIER_NEW_OP_P): New.
	* decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
	* pt.c (push_template_decl_real): Likewise.
	* typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.

From-SVN: r254350
2017-11-02 18:29:26 +00:00
Nathan Sidwell dfa65d3fd1 [PR c++/82710] false positive paren warning
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00119.html
	PR c++/82710
	* decl.c (grokdeclarator): Don't warn when parens protect a return
	type from a qualified name.

	PR c++/82710
	* g++.dg/warn/pr82710.C: New.

From-SVN: r254349
2017-11-02 18:26:29 +00:00
Wilco Dijkstra e10dbae3da Define MALLOC_ABI_ALIGNMENT
The AArch64 backend currently doesn't set MALLOC_ABI_ALIGNMENT, so
add this to enable alignment optimizations on malloc pointers.
Use the same value as STACK_BOUNDARY and BIGGEST_ALIGNMENT.

    gcc/
	* config/aarch64/aarch64.h (MALLOC_ABI_ALIGNMENT): New define.

From-SVN: r254348
2017-11-02 15:12:51 +00:00
Eric Botcazou 441c7bba9e Move testsuite entries to proper file
From-SVN: r254346
2017-11-02 14:59:59 +00:00
Jeff Law b95f2911ef gimple-ssa-sprintf.c (sprintf_dom_walker): Remove virtual keyword on FINAL OVERRIDE members.
* gimple-ssa-sprintf.c (sprintf_dom_walker): Remove
	virtual keyword on FINAL OVERRIDE members.

	* tree-ssa-propagate.h (ssa_propagation_engine): Group
	virtuals together.  Add virtual destructor.
	(substitute_and_fold_engine): Similarly.

From-SVN: r254345
2017-11-02 08:54:58 -06:00
Nathan Sidwell 3c3947b804 Re: [PATCH] fix fdump-lang-raw ICE
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00093.html
	* g++.dg/lang-dump.C: New.

From-SVN: r254344
2017-11-02 14:10:12 +00:00
Jan Hubicka 6d7e169ebd * x86-tune.def (X86_TUNE_USE_INCDEC): Enable for Haswell+.
From-SVN: r254343
2017-11-02 13:49:31 +00:00
Richard Biener 1e8fc1ce6e re PR target/82795 (ICE in predicate_mem_writes, at tree-if-conv.c:2251)
2017-11-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82795
	* tree-if-conv.c (predicate_mem_writes): Remove bogus assert.

	* gcc.target/i386/pr82795.c: New testcase.

From-SVN: r254342
2017-11-02 13:13:53 +00:00
Rainer Orth dea82cdb40 Cleanup Solaris linker version checks
* acinclude.m4 (gcc_AC_INITFINI_ARRAY): Don't require
	gcc_SUN_LD_VERSION.
	(gcc_GAS_CHECK_FEATURE): Remove.
	* configure.ac (ld_vers) <*-*-solaris2*>: Move comments from
	gcc_AC_INITFINI_ARRAY here.  Update for Solaris 11.4 changes.
	* configure: Regenerate.

From-SVN: r254340
2017-11-02 10:49:16 +00:00
Claudiu Zissulescu 5b5905bb07 [ARC][ZOL] Account for empty body loops
gcc/
2017-11-02  Claudiu Zissulescu <claziss@synopsys.com>

	    * config/arc/arc.c (hwloop_optimize): Account for empty
	    body loops.

testsuite/
2017-11-02  Claudiu Zissulescu <claziss@synopsys.com>

 	    * gcc.target/arc/loop-1.c: Add test.

From-SVN: r254339
2017-11-02 11:20:18 +01:00