1. 03 Dec, 2019 17 commits
  2. 02 Dec, 2019 20 commits
    • re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array) · 3a0bd58f
      	PR c++/92695
      	* constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use
      	STRIP_NOPS before checking for ADDR_EXPR.
      
      	* g++.dg/cpp2a/constexpr-virtual15.C: New test.
      
      From-SVN: r278912
      Jakub Jelinek committed
    • Make rs6000_invalid_builtin static. · 871a8fab
      2019-12-02  Bill Schmidt  <wschmidt@linux.ibm.com>
      
      	* config/rs6000/rs6000-call.c (rs6000_invalid_builtin): Make
      	static.
      	* config/rs6000/rs6000-internal.h (rs6000_invalid_builtin): Remove
      	decl.
      
      From-SVN: r278911
      Bill Schmidt committed
    • Tighten check for vector types in fold_convertible_p (PR 92741) · fddcfa5b
      In this PR, IPA-CP was misled into using NOP_EXPR rather than
      VIEW_CONVERT_EXPR to reinterpret a vector of 4 shorts as a vector
      of 2 ints.  This tripped the tree-cfg.c assert I'd added in r278245.
      
      2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	PR middle-end/92741
      	* fold-const.c (fold_convertible_p): Check vector types more
      	thoroughly.
      
      gcc/testsuite/
      	PR middle-end/92741
      	* gcc.dg/pr92741.c: New test.
      
      From-SVN: r278910
      Richard Sandiford committed
    • [AArch64] Catch attempts to use SVE types when SVE is disabled · c0e0174b
      This patch reports an error if code tries to use variable-length
      SVE types when SVE is disabled.  We already report a similar error
      for definitions or uses of SVE functions when SVE is disabled.
      
      2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	* config/aarch64/aarch64.c (aarch64_report_sve_required): New function.
      	(aarch64_expand_mov_immediate): Use it when attempting to measure
      	the length of an SVE vector.
      	(aarch64_mov_operand_p): Only allow SVE CNT immediates when
      	SVE is enabled.
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/acle/general/nosve_4.c: New test.
      	* gcc.target/aarch64/sve/acle/general/nosve_5.c: Likewise.
      	* gcc.target/aarch64/sve/pcs/nosve_4.c: Expected a second error
      	for the copy.
      	* gcc.target/aarch64/sve/pcs/nosve_5.c: Likewise.
      	* gcc.target/aarch64/sve/pcs/nosve_6.c: Likewise.
      
      From-SVN: r278909
      Richard Sandiford committed
    • [AArch64] Run general SVE ACLE tests for C · 6da4c454
      Now that the C frontend can cope with POLY_INT_CST-length initialisers,
      we can make aarch64-sve-acle.exp run the full set of tests.  This will
      introduce new failures for -mabi=ilp32; I'll make the testsuite ILP32
      clean separately.
      
      2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/acle/aarch64-sve-acle.exp: Run the
      	general/* tests too.
      
      From-SVN: r278908
      Richard Sandiford committed
    • [AArch64] Add a couple of SVE ACLE comparison folds · 0435b10d
      When writing vector-length specific SVE code, it's useful to be able
      to store an svbool_t predicate in a GNU vector of unsigned chars.
      This patch makes sure that there is no overhead when converting
      to that form and then immediately reading it back again.
      
      2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	* config/aarch64/aarch64-sve-builtins.h
      	(gimple_folder::force_vector): Declare.
      	* config/aarch64/aarch64-sve-builtins.cc
      	(gimple_folder::force_vector): New function.
      	* config/aarch64/aarch64-sve-builtins-base.cc
      	(svcmp_impl::fold): Likewise.
      	(svdup_impl::fold): Handle svdup_z too.
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/acle/general/eqne_dup_1.c: New test.
      	* gcc.target/aarch64/sve/acle/asm/dup_f16.c (dup_0_f16_z): Expect
      	the call to be folded to zero.
      	* gcc.target/aarch64/sve/acle/asm/dup_f32.c (dup_0_f32_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_f64.c (dup_0_f64_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_s8.c (dup_0_s8_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_s16.c (dup_0_s16_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_s32.c (dup_0_s32_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_s64.c (dup_0_s64_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_u8.c (dup_0_u8_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_u16.c (dup_0_u16_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_u32.c (dup_0_u32_z): Likewise.
      	* gcc.target/aarch64/sve/acle/asm/dup_u64.c (dup_0_u64_z): Likewise.
      
      From-SVN: r278907
      Richard Sandiford committed
    • [Committed][Arm][testsuite] Fix failure for arm-fp16-ops-*.C · d6098f64
      Since r275022 which deprecates some uses of volatile, all arm-fp16-ops-*.C
      were failing with warnings of deprecated valatile uses on arm-none-eabi and
      arm-none-linux-gnueabihf. This patch removes the volatile declarations from
      the header. Since none of the tests are run with any high optimization levels,
      this should change should not prevent the real function of the tests.
      
      gcc/testsuite/ChangeLog:
      
      2019-12-02  Sudakshina Das  <sudi.das@arm.com>
      
      	* g++.dg/ext/arm-fp16/arm-fp16-ops.h: Remove volatile keyword.
      
      From-SVN: r278905
      Sudakshina Das committed
    • libstdc++: Fix try_lock_until and try_lock_shared_until on arbitrary clock · b789efea
      This is the equivalent to PR libstdc++/91906, but for shared_mutex.
      
      A non-standard clock may tick more slowly than std::chrono::steady_clock.
      This means that we risk returning false early when the specified timeout
      may not have expired. This can be avoided by looping until the timeout time
      as reported by the non-standard clock has been reached.
      
      Unfortunately, we have no way to tell whether the non-standard clock ticks
      more quickly that std::chrono::steady_clock. If it does then we risk
      returning later than would be expected, but that is unavoidable without
      waking up periodically to check, which would be rather too expensive.
      
      François Dumont pointed out[1] a flaw in an earlier version of this patch
      that revealed a hole in the test coverage, so I've added a new test that
      try_lock_until acts as try_lock if the timeout has already expired.
      
      [1] https://gcc.gnu.org/ml/libstdc++/2019-10/msg00021.html
      
      2019-12-02  Mike Crowe  <mac@mcrowe.com>
      
      	Fix try_lock_until and try_lock_shared_until on arbitrary clock
      	* include/std/shared_mutex (shared_timed_mutex::try_lock_until)
      	(shared_timed_mutex::try_lock_shared_until): Loop until the absolute
      	timeout time is reached as measured against the appropriate clock.
      	* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
      	file. Test try_lock_until and try_lock_shared_until timeouts against
      	various clocks.
      	* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
      	file. Test try_lock_until and try_lock_shared_until timeouts against
      	various clocks.
      
      From-SVN: r278904
      Mike Crowe committed
    • libstdc++: Add full steady_clock support to shared_timed_mutex · ab40695a
      The pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock functions
      were added to glibc in v2.30. They have also been added to Android
      Bionic. If these functions are available in the C library then they can
      be used to implement shared_timed_mutex::try_lock_until,
      shared_timed_mutex::try_lock_for,
      shared_timed_mutex::try_lock_shared_until and
      shared_timed_mutex::try_lock_shared_for so that they are no longer
      unaffected by the system clock being warped. (This is the shared_mutex
      equivalent of PR libstdc++/78237 for mutex.)
      
      If the new functions are available then steady_clock is deemed to be the
      "best" clock available which means that it is used for the relative
      try_lock_for calls and absolute try_lock_until calls using steady_clock
      and user-defined clocks. It's not possible to have
      _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK defined without
      _GLIBCXX_USE_PTHREAD_RWLOCK_T, so the requirement that the clock be the
      same as condition_variable is maintained. Calls explicitly using
      system_clock (aka high_resolution_clock) continue to use CLOCK_REALTIME
      via the old pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock
      functions.
      
      If the new functions are not available then system_clock is deemed to be
      the "best" clock available which means that the previous suboptimal
      behaviour remains.
      
      Additionally, the user-defined clock used with
      shared_timed_mutex::try_lock_for and shared_mutex::try_lock_shared_for
      may have higher precision than __clock_t. We may need to round the
      duration up to ensure that the timeout is long enough. (See
      __timed_mutex_impl::_M_try_lock_for)
      
      2019-12-02  Mike Crowe  <mac@mcrowe.com>
      
      	Add full steady_clock support to shared_timed_mutex
      	* acinclude.m4 (GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK): Define
      	to check for the presence of both pthread_rwlock_clockrdlock and
      	pthread_rwlock_clockwrlock.
      	* config.h.in: Regenerate.
      	* configure.ac: Call GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK.
      	* configure: Regenerate.
      	* include/std/shared_mutex (shared_timed_mutex): Define __clock_t as
      	the best clock to use for relative waits.
      	(shared_timed_mutex::try_lock_for) Round up wait duration if necessary.
      	(shared_timed_mutex::try_lock_shared_for): Likewise.
      	(shared_timed_mutex::try_lock_until): Use existing try_lock_until
      	implementation for system_clock (which matches __clock_t when
      	_GLIBCCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK is not defined). Add new
      	overload for steady_clock that uses pthread_rwlock_clockwrlock if it
      	is available. Simplify overload for non-standard clock to just call
      	try_lock_for with a relative timeout.
      	(shared_timed_mutex::try_lock_shared_until): Likewise.
      
      From-SVN: r278903
      Mike Crowe committed
    • libstdc++: Fix timed_mutex::try_lock_until on arbitrary clock (PR 91906) · a7334019
      A non-standard clock may tick more slowly than
      std::chrono::steady_clock.  This means that we risk returning false
      early when the specified timeout may not have expired. This can be
      avoided by looping until the timeout time as reported by the
      non-standard clock has been reached.
      
      Unfortunately, we have no way to tell whether the non-standard clock
      ticks more quickly that std::chrono::steady_clock. If it does then we
      risk returning later than would be expected, but that is unavoidable and
      permitted by the standard.
      
      2019-12-02  Mike Crowe  <mac@mcrowe.com>
      
      	PR libstdc++/91906 Fix timed_mutex::try_lock_until on arbitrary clock
      	* include/std/mutex (__timed_mutex_impl::_M_try_lock_until): Loop
      	until the absolute timeout time is reached as measured against the
      	appropriate clock.
      	* testsuite/util/slow_clock.h: New file. Move implementation of
      	slow_clock test class.
      	* testsuite/30_threads/condition_variable/members/2.cc: Include
      	slow_clock from header.
      	* testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: Convert
      	existing test to templated function so that it can be called with
      	both system_clock and steady_clock.
      	* testsuite/30_threads/timed_mutex/try_lock_until/3.cc: Also run test
      	using slow_clock to test above fix.
      	* testsuite/30_threads/recursive_timed_mutex/try_lock_until/3.cc:
      	Likewise.
      	* testsuite/30_threads/recursive_timed_mutex/try_lock_until/4.cc: Add
      	new test that try_lock_until behaves as try_lock if the timeout has
      	already expired or exactly matches the current time.
      
      From-SVN: r278902
      Mike Crowe committed
    • libstdc++: PR 78237 Add full steady_clock support to timed_mutex · 3b2fb543
      The pthread_mutex_clocklock function is available in glibc since the
      2.30 release. If this function is available in the C library it can be
      used to fix PR libstdc++/78237 by supporting steady_clock properly with
      timed_mutex.
      
      This means that code using timed_mutex::try_lock_for or
      timed_mutex::wait_until with steady_clock is no longer subject to timing
      out early or potentially waiting for much longer if the system clock is
      warped at an inopportune moment.
      
      If pthread_mutex_clocklock is available then steady_clock is deemed to
      be the "best" clock available which means that it is used for the
      relative try_lock_for calls and absolute try_lock_until calls using
      steady_clock and user-defined clocks. Calls explicitly using
      system_clock (aka high_resolution_clock) continue to use CLOCK_REALTIME
      via __gthread_cond_timedwait.
      
      If pthread_mutex_clocklock is not available then system_clock is deemed
      to be the "best" clock available which means that the previous
      suboptimal behaviour remains.
      
      2019-12-02  Mike Crowe  <mac@mcrowe.com>
      
      	PR libstdc++/78237 Add full steady_clock support to timed_mutex
      	* acinclude.m4 (GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK): Define to
      	detect presence of pthread_mutex_clocklock function.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Call GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK.
      	* include/std/mutex (__timed_mutex_impl): Remove unnecessary __clock_t.
      	(__timed_mutex_impl::_M_try_lock_for): Use best clock to turn relative
      	timeout into absolute timeout.
      	(__timed_mutex_impl::_M_try_lock_until): Keep existing implementation
      	for system_clock. Add new implementation for steady_clock that calls
      	_M_clocklock. Modify overload for user-defined clock to use a relative
      	wait so that it automatically uses the best clock.
      	[_GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK] (timed_mutex::_M_clocklock):
      	New member function.
      	(recursive_timed_mutex::_M_clocklock): Likewise.
      
      From-SVN: r278901
      Mike Crowe committed
    • libstdc++: Improve tests for try_lock_until members of mutex types · 49638674
      2019-12-02  Mike Crowe  <mac@mcrowe.com>
      
      	* testsuite/30_threads/recursive_timed_mutex/try_lock_until/3.cc:
      	New test. Ensure that timed_mutex::try_lock_until actually times out
      	after the specified time when using both system_clock and
      	steady_clock.
      	* testsuite/30_threads/timed_mutex/try_lock_until/3.cc: New test.
      	Likewise but for recursive_timed_mutex.
      	* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Template
      	test functions and use them to test both steady_clock and system_clock.
      	* testsuite/30_threads/unique_lock/locking/4.cc: Likewise. Wrap call
      	to timed_mutex::try_lock_until in VERIFY macro to check its return
      	value.
      
      From-SVN: r278900
      Mike Crowe committed
    • Refactor IPA devirt a bit. · 74fee042
      2019-12-02  Martin Liska  <mliska@suse.cz>
      
      	* ipa-devirt.c (warn_types_mismatch): Use get_odr_name_for_type
      	function.
      	(debug_tree_odr_name): New.
      	* ipa-utils.h (get_odr_name_for_type): New.
      2019-12-02  Martin Liska  <mliska@suse.cz>
      
      	* g++.dg/lto/odr-7_0.C: New test.
      	* g++.dg/lto/odr-7_1.C: New test.
      
      From-SVN: r278898
      Martin Liska committed
    • Fix dg failure · f87c2375
      	* g++.dg/lto/inline-crossmodule-1_0.C: fix template.
      
      From-SVN: r278897
      Jan Hubicka committed
    • re PR tree-optimization/92742 (ICE in info_for_reduction, at tree-vect-loop.c:4367) · 2679730b
      2019-12-02  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/92742
      	* tree-vect-loop.c (vect_fixup_reduc_chain): Do not
      	touch the def-type but verify it is consistent with the
      	original stmts.
      
      	* gcc.dg/torture/pr92742.c: New testcase.
      
      From-SVN: r278896
      Richard Biener committed
    • re PR tree-optimization/92712 (Performance regression with assumed values) · a213ab38
      	PR tree-optimization/92712
      	* match.pd ((A * B) +- A -> (B +- 1) * A,
      	A +- (A * B) -> (1 +- B) * A): Allow optimizing signed integers
      	even when we don't know anything about range of A, but do know
      	something about range of B and the simplification won't introduce
      	new UB.
      
      	* gcc.dg/tree-ssa/pr92712-1.c: New test.
      	* gcc.dg/tree-ssa/pr92712-2.c: New test.
      	* gcc.dg/tree-ssa/pr92712-3.c: New test.
      	* gfortran.dg/loop_versioning_1.f90: Adjust expected number of
      	likely to be innermost dimension messages.
      	* gfortran.dg/loop_versioning_10.f90: Likewise.
      	* gfortran.dg/loop_versioning_6.f90: Likewise.
      
      From-SVN: r278894
      Jakub Jelinek committed
    • Enable recursive function versioning · 9b14fc33
      2019-12-02  Feng Xue <fxue@os.amperecomputing.com>
      
              PR ipa/92133
              * doc/invoke.texi (ipa-cp-max-recursive-depth): Document new option.
              (ipa-cp-min-recursive-probability): Likewise.
              * params.opt (ipa-cp-max-recursive-depth): New.
              (ipa-cp-min-recursive-probability): Likewise.
              * ipa-cp.c (ipcp_lattice<valtype>::add_value): Add two new parameters
              val_p and unlimited.
              (self_recursively_generated_p): New function.
              (get_val_across_arith_op): Likewise.
              (propagate_vals_across_arith_jfunc): Add constant propagation for
              self-recursive function.
              (incorporate_penalties): Do not penalize pure self-recursive function.
              (good_cloning_opportunity_p): Dump node_is_self_scc flag.
              (propagate_constants_topo): Set node_is_self_scc flag for cgraph node.
              (get_info_about_necessary_edges): Relax hotness check for edge to
              self-recursive function.
              * ipa-prop.h (ipa_node_params): Add new field node_is_self_scc.
      
      2019-12-02  Feng Xue  <fxue@os.amperecomputing.com>
      
              PR ipa/92133
              * gcc.dg/ipa/ipa-clone-2.c: New test.
      
      From-SVN: r278893
      Feng Xue committed
    • Fix bugs relating to flexibly-sized objects in nios2 backend. · 4569f8b3
      2019-12-01  Sandra Loosemore  <sandra@codesourcery.com>
      
      	Fix bugs relating to flexibly-sized objects in nios2 backend.
      
      	PR target/92499
      
      	gcc/c/
      	* c-decl.c (flexible_array_type_p): Move to common code.
      
      	gcc/
      	* config/nios2/nios2.c (nios2_in_small_data_p): Do not consider
      	objects of flexible types to be small if they have internal linkage
      	or are declared extern.
      	* config/nios2/nios2.h (ASM_OUTPUT_ALIGNED_LOCAL): Replace with...
      	(ASM_OUTPUT_ALIGNED_DECL_LOCAL): ...this.  Use targetm.in_small_data_p
      	instead of the size of the object initializer.
      	* tree.c (flexible_array_type_p): Move from C front end, and
      	generalize to handle fields in non-C structures.
      	* tree.h (flexible_array_type_p): Declare.
      
      	gcc/testsuite/
      	* gcc.target/nios2/pr92499-1.c: New.
      	* gcc.target/nios2/pr92499-2.c: New.
      	* gcc.target/nios2/pr92499-3.c: New.
      
      From-SVN: r278891
      Sandra Loosemore committed
    • PR92398: Fix testcase failure of pr72804.c · e549dd44
      P9LE generated instruction is not worse than P8LE.
      mtvsrdd;xxlnot;stxv vs. not;not;std;std.
      It can have longer latency, but latency via memory is not so critical,
      and this does save decode and other resources.  It's hard to choose
      which is best.  Update the test case to fix failures.
      
      gcc/testsuite/ChangeLog:
      
      	2019-12-02  Luo Xiong Hu  <luoxhu@linux.ibm.com>
      
      	PR testsuite/92398
      	* gcc.target/powerpc/pr72804.c: Split the store function to...
      	* gcc.target/powerpc/pr92398.h: ... this one.  New.
      	* gcc.target/powerpc/pr92398.p9+.c: New.
      	* gcc.target/powerpc/pr92398.p9-.c: New.
      	* lib/target-supports.exp (check_effective_target_p8): New.
      	(check_effective_target_p9+): New.
      
      From-SVN: r278890
      Luo Xiong Hu committed
    • Daily bump. · aa2d5753
      From-SVN: r278889
      GCC Administrator committed
  3. 01 Dec, 2019 3 commits