1. 29 Jan, 2020 17 commits
    • IRA: Revert 11b8091f to fix PR 93221 · bcf3fa7c
      A previous change to simplify LRA introduced in 11b809 (From-SVN: r279550)
      disabled hard register splitting for -O0. This causes a problem on aarch64 in
      cases where parameters are passed in multiple registers (in the bug report an OI
      passed in 2 V4SI registers). This is mandated by the AAPCS.
      
      gcc/ChangeLog:
      2020-01-29  Joel Hutton  <Joel.Hutton@arm.com>
      
      	PR target/93221
      	* ira.c (ira): Revert use of simplified LRA algorithm.
      
      gcc/testsuite/ChangeLog:
      2020-01-29  Joel Hutton  <Joel.Hutton@arm.com>
      
      	PR target/93221
      	* gcc.target/aarch64/pr93221.c: New test.
      Andre Vieira committed
    • libstdc++: Simplify constraints on std::compare_three_way · f214ffb3
      The __3way_builtin_ptr_cmp concept can use three_way_comparable_with to
      check whether <=> is valid. Doing that makes it obvious that the
      disjunction on compare_three_way::operator() is redundant, because
      the second constraint subsumes the first.
      
      The workaround for PR c++/91073 can also be removed as that bug is fixed
      now.
      
      	* libsupc++/compare (__detail::__3way_builtin_ptr_cmp): Use
      	three_way_comparable_with.
      	(__detail::__3way_cmp_with): Remove workaround for fixed bug.
      	(compare_three_way::operator()): Remove redundant constraint from
      	requires-clause.
      	(__detail::_Synth3way::operator()): Use three_way_comparable_with
      	instead of workaround.
      	* testsuite/18_support/comparisons/object/93479.cc: Prune extra
      	output due to simplified constraints on compare_three_way::operator().
      Jonathan Wakely committed
    • libstdc++: Make std::compare_three_way check if <=> is valid (PR 93479) · 83b02010
      Currently types that cannot be compared using <=> but which are
      convertible to pointers will be compared by converting to pointers
      first. They should not be comparable.
      
      	PR libstdc++/93479
      	* libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid.
      	* testsuite/18_support/comparisons/object/93479.cc: New test.
      Jonathan Wakely committed
    • libstdc++: Make tests for std::ranges access functions more robust · 5cd2e126
      	* testsuite/std/ranges/access/end.cc: Do not assume test_range::end()
      	returns the same type as test_range::begin(). Add comments.
      	* testsuite/std/ranges/access/rbegin.cc: Likewise.
      	* testsuite/std/ranges/access/rend.cc: Likewise.
      	* testsuite/std/ranges/range.cc: Do not assume the sentinel for
      	test_range is the same as its iterator type.
      	* testsuite/util/testsuite_iterators.h (test_range::sentinel): Add
      	operator- overloads to satisfy sized_sentinel_for when the iterator
      	satisfies random_access_iterator.
      Jonathan Wakely committed
    • SRA: Also propagate accesses from LHS to RHS [PR92706] · 6693911f
      2020-01-29  Martin Jambor  <mjambor@suse.cz>
      
      	PR tree-optimization/92706
      	* tree-sra.c (struct access): Fields first_link, last_link,
      	next_queued and grp_queued renamed to first_rhs_link, last_rhs_link,
      	next_rhs_queued and grp_rhs_queued respectively, new fields
      	first_lhs_link, last_lhs_link, next_lhs_queued and grp_lhs_queued.
      	(struct assign_link): Field next renamed to next_rhs, new field
      	next_lhs.  Updated comment.
      	(work_queue_head): Renamed to rhs_work_queue_head.
      	(lhs_work_queue_head): New variable.
      	(add_link_to_lhs): New function.
      	(relink_to_new_repr): Also relink LHS lists.
      	(add_access_to_work_queue): Renamed to add_access_to_rhs_work_queue.
      	(add_access_to_lhs_work_queue): New function.
      	(pop_access_from_work_queue): Renamed to
      	pop_access_from_rhs_work_queue.
      	(pop_access_from_lhs_work_queue): New function.
      	(build_accesses_from_assign): Also add links to LHS lists and to LHS
      	work_queue.
      	(child_would_conflict_in_lacc): Renamed to
      	child_would_conflict_in_acc.  Adjusted parameter names.
      	(create_artificial_child_access): New parameter set_grp_read, use it.
      	(subtree_mark_written_and_enqueue): Renamed to
      	subtree_mark_written_and_rhs_enqueue.
      	(propagate_subaccesses_across_link): Renamed to
      	propagate_subaccesses_from_rhs.
      	(propagate_subaccesses_from_lhs): New function.
      	(propagate_all_subaccesses): Also propagate subaccesses from LHSs to
      	RHSs.
      
      	testsuite/
      	* gcc.dg/tree-ssa/pr92706-1.c: New test.
      Martin Jambor committed
    • SRA: Total scalarization after access propagation [PR92706] · 636e80ee
      2020-01-29  Martin Jambor  <mjambor@suse.cz>
      
      	PR tree-optimization/92706
      	* tree-sra.c (struct access): Adjust comment of
      	grp_total_scalarization.
      	(find_access_in_subtree): Look for single children spanning an entire
      	access.
      	(scalarizable_type_p): Allow register accesses, adjust callers.
      	(completely_scalarize): Remove function.
      	(scalarize_elem): Likewise.
      	(create_total_scalarization_access): Likewise.
      	(sort_and_splice_var_accesses): Do not track total scalarization
      	flags.
      	(analyze_access_subtree): New parameter totally, adjust to new meaning
      	of grp_total_scalarization.
      	(analyze_access_trees): Pass new parameter to analyze_access_subtree.
      	(can_totally_scalarize_forest_p): New function.
      	(create_total_scalarization_access): Likewise.
      	(create_total_access_and_reshape): Likewise.
      	(total_should_skip_creating_access): Likewise.
      	(totally_scalarize_subtree): Likewise.
      	(analyze_all_variable_accesses): Perform total scalarization after
      	subaccess propagation using the new functions above.
      	(initialize_constant_pool_replacements): Output initializers by
      	traversing the access tree.
      
      	testsuite/
      	* gcc.dg/tree-ssa/pr92706-2.c: New test.
      	* gcc.dg/guality/pr59776.c: Xfail tests for s2.g.
      Martin Jambor committed
    • SRA: Add verification of accesses · 5b9e89c9
      2020-01-29  Martin Jambor  <mjambor@suse.cz>
      
      	* tree-sra.c (verify_sra_access_forest): New function.
      	(verify_all_sra_access_forests): Likewise.
      	(create_artificial_child_access): Set parent.
      	(analyze_all_variable_accesses): Call the verifier.
      Martin Jambor committed
    • ipa: Fix removal of multi-target speculation. · 7c710777
      	* cgraph.c (cgraph_edge::resolve_speculation): Only lookup direct edge
      	if called on indirect edge.
      	(cgraph_edge::redirect_call_stmt_to_callee): Lookup indirect edge of
      	speculative call if needed.
      
      	* gcc.dg/tree-prof/indir-call-prof-2.c: New testcase.
      Jan Hubicka committed
    • Adjust formatting of acc_get_property tests · 87c3fcfa
      libgomp/
       * testsuite/libgomp.oacc-c-c++-common/acc_get_property.c:
       Adjust to GNU coding style.
       * testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c: Likewise.
       * testsuite/libgomp.oacc-c-c++-common/acc_get_property-gcn.c: Likewise.
       * testsuite/libgomp.oacc-c-c++-common/acc_get_property-host.c: Likewise.
       * testsuite/libgomp.oacc-c-c++-common/acc_get_property-nvptx.c: Likewise.
      Frederik Harwath committed
    • Add OpenACC acc_get_property support for AMD GCN · 2e5ea579
      Add full support for the OpenACC 2.6 acc_get_property and
      acc_get_property_string functions to the libgomp GCN plugin.
      
      libgomp/
      	* plugin-gcn.c (struct agent_info): Add fields "name" and
      	"vendor_name" ...
      	(GOMP_OFFLOAD_init_device): ... and init from here.
      	(struct hsa_context_info): Add field "driver_version_s" ...
      	(init_hsa_contest): ... and init from here.
      	(GOMP_OFFLOAD_openacc_get_property): Replace stub with a proper
      	implementation.
      	* testsuite/libgomp.oacc-c-c++-common/acc_get_property.c:
      	Enable test execution for amdgcn and host offloading targets.
      	* testsuite/libgomp.oacc-fortran/acc_get_property.f90: Likewise.
      	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c
      	(expect_device_properties): Split function into ...
      	(expect_device_string_properties): ... this new function ...
      	(expect_device_memory): ... and this new function.
      	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-gcn.c:
      	Add test.
      Frederik Harwath committed
    • testsuite: XFAIL gcc.dg/torture/pr93133.c for powerpc*-*-* [PR93393] · f57ccb55
      2020-01-29  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/testsuite/
      	PR testsuite/93393
      	* gcc.dg/torture/pr93133.c: XFAIL for powerpc*-*-*.
      Richard Sandiford committed
    • openmp: c++: Consider typeinfo decls to be predetermined shared [PR91118] · 8d7c0bf8
      If the typeinfo decls appear in OpenMP default(none) regions, as we no longer
      predetermine const with no mutable members, they are diagnosed as errors,
      but it isn't something the users can actually provide explicit sharing for in
      the clauses.
      
      2020-01-29  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/91118
      	* cp-gimplify.c (cxx_omp_predetermined_sharing): Return
      	OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
      
      	* g++.dg/gomp/pr91118-1.C: New test.
      	* g++.dg/gomp/pr91118-2.C: New test.
      Jakub Jelinek committed
    • openmp: Handle rest of EXEC_OACC_* in oacc_code_to_statement [PR93463] · aa1b5696
      As the testcase shows, some EXEC_OACC_* codes weren't handled in
      oacc_code_to_statement.  Fixed thusly.
      
      2020-01-29  Jakub Jelinek  <jakub@redhat.com>
      
      	PR fortran/93463
      	* openmp.c (oacc_code_to_statement): Handle
      	EXEC_OACC_{ROUTINE,UPDATE,WAIT,CACHE,{ENTER,EXIT}_DATA,DECLARE}.
      
      	* gfortran.dg/goacc/pr93463.f90: New test.
      Jakub Jelinek committed
    • analyzer: fix build with gcc 4.4 (PR 93276) · 7892ff37
      All that is really needed is make sure you #include "diagnostic-core.h"
      before including pretty-print.h.  By including
      diagnostic-core.h first, you do:
      and then pretty-print.h will do:
      If instead pretty-print.h is included first, then it will use __gcc_diag__
      instead of __gcc_tdiag__ and thus will assume %E/%D etc. can't be handled.
      
      2020-01-29  Jakub Jelinek  <jakub@redhat.com>
      
      	* analyzer.h (PUSH_IGNORE_WFORMAT, POP_IGNORE_WFORMAT): Remove.
      	* constraint-manager.cc: Include diagnostic-core.h before graphviz.h.
      	(range::dump, equiv_class::print): Don't use PUSH_IGNORE_WFORMAT or
      	POP_IGNORE_WFORMAT.
      	* state-purge.cc: Include diagnostic-core.h before
      	gimple-pretty-print.h.
      	(state_purge_annotator::add_node_annotations, print_vec_of_names):
      	Don't use PUSH_IGNORE_WFORMAT or POP_IGNORE_WFORMAT.
      	* region-model.cc: Move diagnostic-core.h include before graphviz.h.
      	(path_var::dump, svalue::print, constant_svalue::print_details,
      	region::dump_to_pp, region::dump_child_label, region::print_fields,
      	map_region::print_fields, map_region::dump_dot_to_pp,
      	map_region::dump_child_label, array_region::print_fields,
      	array_region::dump_dot_to_pp): Don't use PUSH_IGNORE_WFORMAT or
      	POP_IGNORE_WFORMAT.
      Jakub Jelinek committed
    • tree-optimization/93428 - avoid load permutation vector clobbering · 148018bc
      With SLP now being a graph with shared nodes across instances we have
      to make sure to compute the load permutation of nodes once, not
      overwriting the result of earlier analysis.
      
      2020-01-28  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/93428
      	* tree-vect-slp.c (vect_build_slp_tree_2): Compute the load
      	permutation when the load node is created.
      	(vect_analyze_slp_instance): Re-use it here.
      
      	* gcc.dg/torture/pr93428.c: New testcase.
      Richard Biener committed
    • Fix bogus Changelog entry. · 345ea961
      	* ipa-prop.c (update_indirect_edges_after_inlining): Fix warning.
      Jan Hubicka committed
    • Daily bump. · 1e8900ea
      GCC Administrator committed
  2. 28 Jan, 2020 23 commits
    • PR middle-end/93437 - bogus -Warray-bounds on protobuf generated code · 4dd27b52
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/93437
      	* g++.dg/warn/Wstringop-overflow-5.C: New test.
      Martin Sebor committed
    • c++: Fix return deduction of lambda in discarded stmt. · a4b4b1e3
      A return statement in a discarded statement is not used for return type
      deduction, but we still want to do deduction for a return statement in a
      lambda in a discarded statement.
      
      	PR c++/93442
      	* parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
      Jason Merrill committed
    • c++: Fix guard variable and attribute weak. · 25d62480
      My patch for PR 91476 worked for decls that are implicitly comdat/weak due
      to C++ linkage rules, but broke variables explicitly marked weak.
      
      	PR c++/93477
      	PR c++/91476
      	* decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
      Jason Merrill committed
    • ipa: fix warning in ipa-prop.c · 99eb1a82
      	* ipa-prop.c (update_indirect_edges_after_inlining):
      Jan Hubicka committed
    • analyzer: fix ICE when longjmp isn't marked 'noreturn' (PR 93316) · 5aebfb71
      Comments 11-16 within PR analyzer/93316 discuss an ICE in some setjmp
      tests seen on AIX and powerpc-darwin9.
      
      The issue turned out to be an implicit assumption that longjmp is
      marked "noreturn".  There are two places in engine.cc where the code
      attempted to locate the longjmp GIMPLE_CALL by finding the final stmt
      within its supernode, in one place casting it via "as_a <gcall *>",
      in the other using it as the location_t of the
      "rewinding from longjmp..." event.
      
      When longjmp isn't marked noreturn, its basic block and hence supernode
      can have additional stmts after the longjmp; in the setjmp-3.c case
      this was a GIMPLE_RETURN, leading to a ICE when casting this to a
      GIMPLE_CALL.
      
      This patch fixes the two places in question to use the
        rewind_info_t::get_longjmp_call
      member function introduced by 342e14ff,
      fixing the ICE (and ensuring the correct location_t is used for events).
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93316
      	* engine.cc (rewind_info_t::update_model): Get the longjmp call
      	stmt via get_longjmp_call () rather than assuming it is the last
      	stmt in the longjmp's supernode.
      	(rewind_info_t::add_events_to_path): Get the location_t for the
      	rewind_from_longjmp_event via get_longjmp_call () rather than from
      	the supernode's get_end_location ().
      David Malcolm committed
    • Fix for PR93272 - LRA: EH reg allocated to hold local variable · 5c8a1211
      2020-01-28  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/93272
      	* ira-lives.c (process_out_of_region_eh_regs): New function.
      	(process_bb_node_lives): Call it.
      Vladimir N. Makarov committed
    • diagnostics: make error message lowercase. · 32387f76
      	* coverage.c (read_counts_file): Make error message lowercase.
      Jan Hubicka committed
    • ipa: fix handling of multiple speculations (PR93318) · 40d24031
      This patch started as work to resole Richard's comment on quadratic lookups
      in resolve_speculation. While doing it I however noticed multiple problems
      in the new speuclative call code which made the patch quite big. In
      particular:
       1) Before applying speculation we consider only targets with at lest
          probability 1/2.
          If profile is sane at most two targets can have probability greater or
          equal to 1/2. So the new multi-target speculation code got enabled only
          in very special scenario when there ae precisely two target with precise
          probability 1/2 (which is tested by the single testcase).
      
          As a conseuqence the multiple target logic got minimal test coverage and
          this made us to miss several ICEs.
       2) Profile updating in profile merging, tree-inline and indirect call
          expansion was wrong which led to inconsistent profiles (as already seen
          on the testcase).
       3) Code responsible to turn speculative call to direct call was broken for
          anything with more than one target.
       4) There were multiple cases where call_site_hash went out of sync which
          eventually leads to an ICE..
       5) Some code expects that all speculative call targets forms a sequence in
          the callee linked list but there is no code to maintain that invariant
          nor a verifier.
      Fixing this it became obvious that the current API of speculative_call_info is
      not useful because it really builds on fact tht there are precisely three
      components (direct call, ref and indirect call) in every speculative call
      sequence.  I ended up replacing it with iterator API for direct call
      (first_speculative_call_target, next_speculative_call_target) and accessors for
      the other coponents updating comment in cgraph.h.
      
      Finally I made the work with call site hash more effetive by updating edge
      manipulation to keep them in sequence. So first one can be looked up from the
      hash and then they can be iterated by callee.
      
      There are other things that can be improved (for example the speculation should
      start with most common target first), but I will try to keep that for next
      stage1. This patch is mostly about getting rid of ICE and profile corruption
      which is a regression from GCC 9.
      
      Honza
      
      gcc/ChangeLog:
      
      2020-01-28  Jan Hubicka  <hubicka@ucw.cz>
      
      	PR lto/93318
      	* cgraph.c (cgraph_add_edge_to_call_site_hash): Update call site
      	hash only when edge is first within the sequence.
      	(cgraph_edge::set_call_stmt): Update handling of speculative calls.
      	(symbol_table::create_edge): Do not set target_prob.
      	(cgraph_edge::remove_caller): Watch for speculative calls when updating
      	the call site hash.
      	(cgraph_edge::make_speculative): Drop target_prob parameter.
      	(cgraph_edge::speculative_call_info): Remove.
      	(cgraph_edge::first_speculative_call_target): New member function.
      	(update_call_stmt_hash_for_removing_direct_edge): New function.
      	(cgraph_edge::resolve_speculation): Rewrite to new API.
      	(cgraph_edge::speculative_call_for_target): New member function.
      	(cgraph_edge::make_direct): Rewrite to new API; fix handling of
      	multiple speculation targets.
      	(cgraph_edge::redirect_call_stmt_to_callee): Likewise; fix updating
      	of profile.
      	(verify_speculative_call): Verify that targets form an interval.
      	* cgraph.h (cgraph_edge::speculative_call_info): Remove.
      	(cgraph_edge::first_speculative_call_target): New member function.
      	(cgraph_edge::next_speculative_call_target): New member function.
      	(cgraph_edge::speculative_call_target_ref): New member function.
      	(cgraph_edge;:speculative_call_indirect_edge): New member funtion.
      	(cgraph_edge): Remove target_prob.
      	* cgraphclones.c (cgraph_node::set_call_stmt_including_clones):
      	Fix handling of speculative calls.
      	* ipa-devirt.c (ipa_devirt): Fix handling of speculative cals.
      	* ipa-fnsummary.c (analyze_function_body): Likewise.
      	* ipa-inline.c (speculation_useful_p): Use new speculative call API.
      	* ipa-profile.c (dump_histogram): Fix formating.
      	(ipa_profile_generate_summary): Watch for overflows.
      	(ipa_profile): Do not require probablity to be 1/2; update to new API.
      	* ipa-prop.c (ipa_make_edge_direct_to_target): Update to new API.
      	(update_indirect_edges_after_inlining): Update to new API.
      	* ipa-utils.c (ipa_merge_profiles): Rewrite merging of speculative call
      	profiles.
      	* profile-count.h: (profile_probability::adjusted): New.
      	* tree-inline.c (copy_bb): Update to new speculative call API; fix
      	updating of profile.
      	* value-prof.c (gimple_ic_transform): Rename to ...
      	(dump_ic_profile): ... this one; update dumping.
      	(stream_in_histogram_value): Fix formating.
      	(gimple_value_profile_transformations): Update.
      
      gcc/testsuite/ChangeLog:
      
      2020-01-28  Jan Hubicka  <hubicka@ucw.cz>
      
      	* g++.dg/tree-prof/indir-call-prof.C: Update template.
      	* gcc.dg/tree-prof/crossmodule-indircall-1.c: Add more targets.
      	* gcc.dg/tree-prof/crossmodule-indircall-1a.c: Add more targets.
      	* gcc.dg/tree-prof/indir-call-prof.c: Update template.
      Jan Hubicka committed
    • c++: Allow template rvalue-ref conv to bind to lvalue ref. · 14e320db
      When I implemented the [over.match.ref] rule that a reference conversion
      function needs to match l/rvalue of the target reference type it changed our
      handling of this testcase.  It seems to me that our current behavior is what
      the standard says, but it doesn't seem desirable, and all the other
      compilers have our old behavior.  So let's limit the change to non-templates
      until there's some clarification from the committee.
      
      	PR c++/90546
      	* call.c (build_user_type_conversion_1): Allow a template conversion
      	returning an rvalue reference to bind directly to an lvalue.
      Jason Merrill committed
    • ipa: fix handling of multiple speculations (PR93318) · 845bb366
      This patch started as work to resole Richard's comment on quadratic lookups
      in resolve_speculation. While doing it I however noticed multiple problems
      in the new speuclative call code which made the patch quite big. In
      particular:
       1) Before applying speculation we consider only targets with at lest
          probability 1/2.
          If profile is sane at most two targets can have probability greater or
          equal to 1/2. So the new multi-target speculation code got enabled only
          in very special scenario when there ae precisely two target with precise
          probability 1/2 (which is tested by the single testcase).
      
          As a conseuqence the multiple target logic got minimal test coverage and
          this made us to miss several ICEs.
       2) Profile updating in profile merging, tree-inline and indirect call
          expansion was wrong which led to inconsistent profiles (as already seen
          on the testcase).
       3) Code responsible to turn speculative call to direct call was broken for
          anything with more than one target.
       4) There were multiple cases where call_site_hash went out of sync which
          eventually leads to an ICE..
       5) Some code expects that all speculative call targets forms a sequence in
          the callee linked list but there is no code to maintain that invariant
          nor a verifier.
      Fixing this it became obvious that the current API of speculative_call_info is
      not useful because it really builds on fact tht there are precisely three
      components (direct call, ref and indirect call) in every speculative call
      sequence.  I ended up replacing it with iterator API for direct call
      (first_speculative_call_target, next_speculative_call_target) and accessors for
      the other coponents updating comment in cgraph.h.
      
      Finally I made the work with call site hash more effetive by updating edge
      manipulation to keep them in sequence. So first one can be looked up from the
      hash and then they can be iterated by callee.
      
      There are other things that can be improved (for example the speculation should
      start with most common target first), but I will try to keep that for next
      stage1. This patch is mostly about getting rid of ICE and profile corruption
      which is a regression from GCC 9.
      
      gcc/ChangeLog:
      
      	PR lto/93318
      	* cgraph.c (cgraph_add_edge_to_call_site_hash): Update call site
      	hash only when edge is first within the sequence.
      	(cgraph_edge::set_call_stmt): Update handling of speculative calls.
      	(symbol_table::create_edge): Do not set target_prob.
      	(cgraph_edge::remove_caller): Watch for speculative calls when updating
      	the call site hash.
      	(cgraph_edge::make_speculative): Drop target_prob parameter.
      	(cgraph_edge::speculative_call_info): Remove.
      	(cgraph_edge::first_speculative_call_target): New member function.
      	(update_call_stmt_hash_for_removing_direct_edge): New function.
      	(cgraph_edge::resolve_speculation): Rewrite to new API.
      	(cgraph_edge::speculative_call_for_target): New member function.
      	(cgraph_edge::make_direct): Rewrite to new API; fix handling of
      	multiple speculation targets.
      	(cgraph_edge::redirect_call_stmt_to_callee): Likewise; fix updating
      	of profile.
      	(verify_speculative_call): Verify that targets form an interval.
      	* cgraph.h (cgraph_edge::speculative_call_info): Remove.
      	(cgraph_edge::first_speculative_call_target): New member function.
      	(cgraph_edge::next_speculative_call_target): New member function.
      	(cgraph_edge::speculative_call_target_ref): New member function.
      	(cgraph_edge;:speculative_call_indirect_edge): New member funtion.
      	(cgraph_edge): Remove target_prob.
      	* cgraphclones.c (cgraph_node::set_call_stmt_including_clones):
      	Fix handling of speculative calls.
      	* ipa-devirt.c (ipa_devirt): Fix handling of speculative cals.
      	* ipa-fnsummary.c (analyze_function_body): Likewise.
      	* ipa-inline.c (speculation_useful_p): Use new speculative call API.
      	* ipa-profile.c (dump_histogram): Fix formating.
      	(ipa_profile_generate_summary): Watch for overflows.
      	(ipa_profile): Do not require probablity to be 1/2; update to new API.
      	* ipa-prop.c (ipa_make_edge_direct_to_target): Update to new API.
      	(update_indirect_edges_after_inlining): Update to new API.
      	* ipa-utils.c (ipa_merge_profiles): Rewrite merging of speculative call
      	profiles.
      	* profile-count.h: (profile_probability::adjusted): New.
      	* tree-inline.c (copy_bb): Update to new speculative call API; fix
      	updating of profile.
      	* value-prof.c (gimple_ic_transform): Rename to ...
      	(dump_ic_profile): ... this one; update dumping.
      	(stream_in_histogram_value): Fix formating.
      	(gimple_value_profile_transformations): Update.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/tree-prof/indir-call-prof.C: Update template.
      	* gcc.dg/tree-prof/crossmodule-indircall-1.c: Add more targets.
      	* gcc.dg/tree-prof/crossmodule-indircall-1a.c: Add more targets.
      	* gcc.dg/tree-prof/indir-call-prof.c: Update template.
      Jan Hubicka committed
    • i386: Prefer TARGET_AVX over TARGET_SSE_TYPELESS_STORES · dd9b529f
      movaps/movups is one byte shorter than movdqa/movdqu.  But it isn't the
      case for AVX nor AVX512.  This patch prefers TARGET_AVX over
      TARGET_SSE_TYPELESS_STORES and adjust vmovups checks in assembly ouputs.
      
      gcc/
      
      	PR target/91461
      	* config/i386/i386.md (*movoi_internal_avx): Remove
      	TARGET_SSE_TYPELESS_STORES check.
      	(*movti_internal): Prefer TARGET_AVX over
      	TARGET_SSE_TYPELESS_STORES.
      	(*movtf_internal): Likewise.
      	* config/i386/sse.md (mov<mode>_internal): Prefer TARGET_AVX over
      	TARGET_SSE_TYPELESS_STORES.  Remove "<MODE_SIZE> == 16" check
      	from TARGET_SSE_TYPELESS_STORES.
      
      gcc/testsuite/
      
      	PR target/91461
      	* gcc.target/i386/avx256-unaligned-store-2.c: Don't check
      	vmovups.
      	* gcc.target/i386/avx256-unaligned-store-3.c: Likewise.
      	* gcc.target/i386/pieces-memcpy-4.c: Likewise.
      	* gcc.target/i386/pieces-memcpy-5.c: Likewise.
      	* gcc.target/i386/pieces-memcpy-6.c: Likewise.
      	* gcc.target/i386/pieces-strcpy-2.c: Likewise.
      	* gcc.target/i386/pr90980-1.c: Likewise.
      	* gcc.target/i386/pr87317-4.c: Check "\tvmovd\t" instead of
      	"vmovd" to avoid matching "vmovdqu".
      	* gcc.target/i386/pr87317-5.c: Likewise.
      	* gcc.target/i386/pr87317-7.c: Likewise.
      	* gcc.target/i386/pr91461-1.c: New test.
      	* gcc.target/i386/pr91461-2.c: Likewise.
      	* gcc.target/i386/pr91461-3.c: Likewise.
      	* gcc.target/i386/pr91461-4.c: Likewise.
      	* gcc.target/i386/pr91461-5.c: Likewise.
      H.J. Lu committed
    • diagnostic_metadata: unbreak xgettext (v2) · 6c8e5844
      Changed in v2:
      - rename from warning_with_metadata_at to warning_meta
      - fix test plugins
      
      While C++ can have overloads, xgettext can't deal with overloads that have
      different argument positions, leading to two failures in "make gcc.pot":
      
      emit_diagnostic_valist used incompatibly as both
      --keyword=emit_diagnostic_valist:4
      --flag=emit_diagnostic_valist:4:gcc-internal-format and
      --keyword=emit_diagnostic_valist:5
      --flag=emit_diagnostic_valist:5:gcc-internal-format
      
      warning_at used incompatibly as both
      --keyword=warning_at:3 --flag=warning_at:3:gcc-internal-format and
      --keyword=warning_at:4 --flag=warning_at:4:gcc-internal-format
      
      The emit_diagnostic_valist overload isn't used anywhere (I think it's
      a leftover from an earlier iteration of the analyzer patch kit).
      
      The warning_at overload is used throughout the analyzer but nowhere else.
      
      Ideally I'd like to consolidate this argument with something
      constructable in various ways:
      - from a metadata and an int or
      - from an int (or, better an "enum opt_code"),
      so that the overload happens when implicitly choosing the ctor, but
      that feels like stage 1 material.
      
      In the meantime, fix xgettext by deleting the unused overload and
      renaming the used one.
      
      gcc/analyzer/ChangeLog:
      	* region-model.cc (poisoned_value_diagnostic::emit): Update for
      	renaming of warning_at overload to warning_meta.
      	* sm-file.cc (file_leak::emit): Likewise.
      	* sm-malloc.cc (double_free::emit): Likewise.
      	(possible_null_deref::emit): Likewise.
      	(possible_null_arg::emit): Likewise.
      	(null_deref::emit): Likewise.
      	(null_arg::emit): Likewise.
      	(use_after_free::emit): Likewise.
      	(malloc_leak::emit): Likewise.
      	(free_of_non_heap::emit): Likewise.
      	* sm-sensitive.cc (exposure_through_output_file::emit): Likewise.
      	* sm-signal.cc (signal_unsafe_call::emit): Likewise.
      	* sm-taint.cc (tainted_array_index::emit): Likewise.
      
      gcc/ChangeLog:
      	* diagnostic-core.h (warning_at): Rename overload to...
      	(warning_meta): ...this.
      	(emit_diagnostic_valist): Delete decl of overload taking
      	diagnostic_metadata.
      	* diagnostic.c (emit_diagnostic_valist): Likewise for defn.
      	(warning_at): Rename overload taking diagnostic_metadata to...
      	(warning_meta): ...this.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/diagnostic_plugin_test_metadata.c: Update for
      	renaming of warning_at overload to warning_meta.
      	* gcc.dg/plugin/diagnostic_plugin_test_paths.c: Likewise.
      David Malcolm committed
    • Increase GFC_MAX_MANGLED_SYMBOL_LEN to handle submodule names. · ad690d79
              PR fortran/93461
              * trans.h: Increase GFC_MAX_MANGLED_SYMBOL_LEN to
              GFC_MAX_SYMBOL_LEN*3+5 to allow for inclusion of submodule name,
              plus the "." between module and submodule names.
              * gfortran.dg/pr93461.f90: New test.
      Andrew Benson committed
    • Allow concatenated module+submodule names. · a83b5cc5
      Increase length of char variables "parent1" and "parent2" in
      set_syms_host_assoc() to allow them to hold concatenated module +
      submodule names.
      
              PR fortran/93473
              * parse.c: Increase length of char variables to allow them to hold
              a concatenated module + submodule name.
              * gfortran.dg/pr93473.f90: New test.
      Andrew Benson committed
    • preprocessor: Make __has_include a builtin macro [PR93452] · 3d056cbf
      The clever hack of '#define __has_include __has_include' breaks -dD
      and -fdirectives-only, because that emits definitions.  This turns
      __has_include into a proper builtin macro.  Thus it's never emitted
      via -dD, and because use outside of directive processing is undefined,
      we can just expand it anywhere.
      
      	PR preprocessor/93452
      	* internal.h (struct spec_nodes): Drop n__has_include{,_next}.
      	* directives.c (lex_macro_node): Don't check __has_include redef.
      	* expr.c (eval_token): Drop __has_include eval.
      	(parse_has_include): Move to ...
      	* macro.c (builtin_has_include): ... here.
      	(_cpp_builtin_macro_text): Eval __has_include{,_next}.
      	* include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
      	* init.c (builtin_array): Add them.
      	(cpp_init_builtins): Drop __has_include{,_next} init here ...
      	* pch.c (cpp_read_state): ... and here.
      	* traditional.c (enum ls): Drop has_include states ...
      	(_cpp_scan_out_logical_line): ... and here.
      Nathan Sidwell committed
    • libstdc++: Fix order of changelog entries · a5d81aaa
      Rebasing my last two commits put the changelog entries at the wrong
      place in the file. Fixed by this change.
      Jonathan Wakely committed
    • c++: Function declared with typedef with eh-specification. · 0968f7da
      We just need to handle the exception specification like other properties of
      a function typedef.
      
      	PR c++/90731
      	* decl.c (grokdeclarator): Propagate eh spec from typedef.
      Jason Merrill committed
    • Check array contiguity for OpenACC/Fortran · a5ed4958
      	PR fortran/93025
      
      	gcc/fortran/
      	* openmp.c (resolve_omp_clauses): Check array references for contiguity.
      
      	gcc/testsuite/
      	* gfortran.dg/goacc/mapping-tests-2.f90: New test.
      	* gfortran.dg/goacc/subarrays.f95: Expect rejection of non-contiguous
      	array.
      Julian Brown committed
    • Don't allow mixed component and non-component accesses for OpenACC/Fortran · 278c3214
      	gcc/fortran/
      	* gfortran.h (gfc_symbol): Add comp_mark bitfield.
      	* openmp.c (resolve_omp_clauses): Disallow mixed component and
      	full-derived-type accesses to the same variable within a single
      	directive.
      
      	libgomp/
      	* testsuite/libgomp.oacc-fortran/deep-copy-2.f90: Remove test from here.
      	* testsuite/libgomp.oacc-fortran/deep-copy-3.f90: Don't use mixed
      	component/non-component variable refs in a single directive.
      	* testsuite/libgomp.oacc-fortran/classtypes-1.f95: Likewise.
      
      	gcc/testsuite/
      	* gfortran.dg/goacc/deep-copy-2.f90: Move test here (from libgomp
      	testsuite). Make a compilation test, and expect rejection of mixed
      	component/non-component accesses.
      	* gfortran.dg/goacc/mapping-tests-1.f90: New test.
      Julian Brown committed
    • Add OpenACC test for sub-references being pointer or allocatable variables · 99b9f5b4
      	gcc/testsuite/
      	* gfortran.dg/goacc/strided-alloc-ptr.f90: New test.
      Julian Brown committed
    • libstdc++: Avoid using sizeof with function types (PR 93470) · 72a9fd20
      	PR libstdc++/93470
      	* include/bits/refwrap.h (reference_wrapper::operator()): Restrict
      	static assertion to object types.
      Jonathan Wakely committed
    • libstdc++: Replace glibc-specific check for clock_gettime (PR 93325) · 759812fd
      It's wrong to assume that clock_gettime is unavailable on any *-*-linux*
      target that doesn't have glibc 2.17 or later. Use a generic test instead
      of using __GLIBC_PREREQ. Only do that test when is_hosted=yes so that we
      don't get an error for cross targets without a working linker.
      
      This ensures that C library's clock_gettime will be used on non-glibc
      targets, instead of an incorrect syscall to SYS_clock_gettime.
      
      	PR libstdc++/93325
      	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
      	clock_gettime instead of explicit glibc version check.
      	* configure: Regenerate.
      Jonathan Wakely committed