Commit Graph

179079 Commits

Author SHA1 Message Date
Ian Lance Taylor
74c176ca2f libbacktrace: add Mach-O 64-bit FAT support
libbacktrace/:
	* macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
	(MACH_O_MH_CIGAM_FAT_64): Define.
	(struct macho_fat_arch_64): Define.
	(macho_add_fat): Add and use is_64 parameter.
	(macho_add): Recognize 64-bit fat files.
2020-08-24 13:10:26 -07:00
Gerald Pfeifer
0d166f4a87 doc: Switch valgrind.com to https
gcc/ChangeLog:
	* doc/install.texi (Configuration): Switch valgrind.com to https.
2020-08-24 19:07:25 +02:00
Jonathan Wakely
ef275d1f20 libstdc++: Add deduction guide for std::ranges::join_view [LWG 3474]
This implements the proposed resolution for LWG 3474.

libstdc++-v3/ChangeLog:

	* include/std/ranges (join_view): Add deduction guide (LWG 3474).
	* testsuite/std/ranges/adaptors/join_lwg3474.cc: New test.
2020-08-24 16:18:32 +01:00
Jonathan Wakely
186aa63045 libstdc++: Fix std::indirectly_readable ambiguity [LWG 3446]
This implements the proposed resolution of LWG 3446. I'm also adding
another new constrained specialization which isn't proposed by 3446, to
resolve the ambiguity when a type has both value_type and element_type
but denoting different types.

libstdc++-v3/ChangeLog:

	* include/bits/iterator_concepts.h (indirectly_readable): Add
	partial specializations to resolve ambiguities (LWG 3446).
	* testsuite/24_iterators/associated_types/readable.traits.cc:
	Check types with both value_type and element_type.
2020-08-24 16:18:31 +01:00
Jonathan Wakely
a0e6f05d26 libstdc++: Fix iota_view::size() to avoid overflow
This avoids the overflow that occurs when negating the most negative
value of an integral type.

Also prevent returning signed int when the values have lower rank and
promote to int.

libstdc++-v3/ChangeLog:

	* include/std/ranges (ranges::iota_view::size()): Perform all
	calculations in the right unsigned types.
	* testsuite/std/ranges/iota/size.cc: New test.
2020-08-24 16:17:04 +01:00
Jonathan Wakely
074436cf8c libstdc++: Make variant_npos conversions explicit [PR 96766]
libstdc++-v3/ChangeLog:

	PR libstdc++/96766
	* include/std/variant (_Variant_storage): Replace implicit
	conversions from size_t to __index_type with explicit casts.
2020-08-24 16:10:07 +01:00
Jonathan Wakely
ac4e9090fc libstdc++: Fix 30_threads/packaged_task/cons/alloc.cc regression
libstdc++-v3/ChangeLog:

	* testsuite/30_threads/packaged_task/cons/alloc.cc: Run for
	C++11 and skip for C++17 or later.
2020-08-24 16:07:12 +01:00
Nathan Sidwell
311281441c c++: overload dumper
I frequently need to look at overload sets, and debug_node spews more
information than is useful, most of the time.  Here's a dumper for
overloads, that just tells you their full name and where they came from.

	gcc/cp
	* ptree.c (debug_overload): New.
2020-08-24 06:28:37 -07:00
Mark Eggleston
de09e7ebc9 Fortran : get_environment_variable runtime error PR96486
Runtime error occurs when the type of the value argument is
character(0):  "Zero-length string passed as value...".
The status argument, intent(out), will contain -1 if the value
of the environment is too large to fit in the value argument, this
is the case if the type is character(0) so there is no reason to
produce a runtime error if the value argument is zero length.

2020-08-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

libgfortran/

	PR fortran/96486
	* intrinsics/env.c: If value_len is > 0 blank the string.
	Copy the result only if its length is > 0.

2020-08-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/96486
	* gfortran.dg/pr96486.f90: New test.
2020-08-24 11:13:11 +01:00
Christophe Lyon
259d072067 arm: Fix -mpure-code support/-mslow-flash-data for armv8-m.base [PR94538]
armv8-m.base (cortex-m23) has the movt instruction, so we need to
disable the define_split to generate a constant in this case,
otherwise we get incorrect insn constraints as described in PR94538.

We also need to fix the pure-code alternative for thumb1_movsi_insn
because the assembler complains with instructions like
movs r0, #:upper8_15:1234
(Internal error in md_apply_fix)
We now generate movs r0, 4 instead.

2020-08-24  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/94538
	gcc/
	* config/arm/thumb1.md: Disable set-constant splitter when
	TARGET_HAVE_MOVT.
	(thumb1_movsi_insn): Fix -mpure-code
	alternative.

	PR target/94538
	gcc/testsuite/
	* gcc.target/arm/pure-code/pr94538-1.c: New test.
	* gcc.target/arm/pure-code/pr94538-2.c: New test.
2020-08-24 09:08:30 +00:00
Martin Liska
cdb2e365fc SLP: support entire BB.
gcc/ChangeLog:

	* tree-vect-data-refs.c (dr_group_sort_cmp): Work on
	data_ref_pair.
	(vect_analyze_data_ref_accesses): Work on groups.
	(vect_find_stmt_data_reference): Add group_id argument and fill
	up dataref_groups vector.
	* tree-vect-loop.c (vect_get_datarefs_in_loop): Pass new
	arguments.
	(vect_analyze_loop_2): Likewise.
	* tree-vect-slp.c (vect_slp_analyze_bb_1): Pass argument.
	(vect_slp_bb_region): Likewise.
	(vect_slp_region): Likewise.
	(vect_slp_bb):Work on the entire BB.
	* tree-vectorizer.h (vect_analyze_data_ref_accesses): Add new
	argument.
	(vect_find_stmt_data_reference): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/bb-slp-38.c: Adjust pattern as now we only process
	a single vectorization and now 2 partial.
	* gcc.dg/vect/bb-slp-45.c: New test.
2020-08-24 10:21:09 +02:00
Martin Liska
adc646b10c Add missing vn_reference_t::punned initialization
gcc/ChangeLog:

	PR tree-optimization/96597
	* tree-ssa-sccvn.c (vn_reference_lookup_call): Add missing
	initialization of ::punned.
	(vn_reference_insert): Use consistently false instead of 0.
	(vn_reference_insert_pieces): Likewise.
2020-08-24 09:30:33 +02:00
Corentin Gay
1e42d2f4cf Fix libstdc++ testsuite to handle VxWorks gthreads implementation
When implementing the support for gthreads in VxWorks, we stumbled on
a problem in the testsuite. In the libstdc++ testsuite, we
indiscriminately add the `-pthread` switch to the tests that require
linking against the pthread library. In certain cases, such as
VxWorks, the gthread interface relies on the system native threads
lilbrary and the `-pthread` switch does not exist.

This patch adds a condition for the use of the `-pthread` switch. It
adds it only if the target supports it. The patch also adds
`dg-require-gthreads` in tests that were lacking it.


for libstdc++-v3/ChangeLog

	* testsuite/20_util/shared_ptr/atomic/3.cc: Do not require POSIX
	threads and add -pthread only on targets supporting them.
	* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc:
	Likewise.
	* testsuite/30_threads/async/42819.cc: Likewise.
	* testsuite/30_threads/async/49668.cc: Likewise.
	* testsuite/30_threads/async/54297.cc: Likewise.
	* testsuite/30_threads/async/any.cc: Likewise.
	* testsuite/30_threads/async/async.cc: Likewise.
	* testsuite/30_threads/async/except.cc: Likewise.
	* testsuite/30_threads/async/launch.cc: Likewise.
	* testsuite/30_threads/async/lwg2021.cc: Likewise.
	* testsuite/30_threads/async/sync.cc: Likewise. : Likewise.
	* testsuite/30_threads/call_once/39909.cc: Likewise.
	* testsuite/30_threads/call_once/49668.cc: Likewise.
	* testsuite/30_threads/call_once/60497.cc: Likewise.
	* testsuite/30_threads/call_once/call_once1.cc: Likewise.
	* testsuite/30_threads/call_once/dr2442.cc: Likewise.
	* testsuite/30_threads/condition_variable/54185.cc: Likewise.
	* testsuite/30_threads/condition_variable/cons/1.cc: Likewise.
	* testsuite/30_threads/condition_variable/members/1.cc: Likewise.
	* testsuite/30_threads/condition_variable/members/2.cc: Likewise.
	* testsuite/30_threads/condition_variable/members/3.cc: Likewise.
	* testsuite/30_threads/condition_variable/members/53841.cc: Likewise.
	* testsuite/30_threads/condition_variable/members/68519.cc: Likewise.
	* testsuite/30_threads/condition_variable/native_handle/typesizes.cc:
	Likewise.
	* testsuite/30_threads/condition_variable_any/50862.cc: Likewise.
	* testsuite/30_threads/condition_variable_any/53830.cc: Likewise.
	* testsuite/30_threads/condition_variable_any/cond.cc: Likewise.
	* testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise.
	* testsuite/30_threads/condition_variable_any/members/1.cc: Likewise.
	* testsuite/30_threads/condition_variable_any/members/2.cc: Likewise.
	* testsuite/30_threads/future/cons/move.cc: Likewise.
	* testsuite/30_threads/future/members/45133.cc: Likewise.
	* testsuite/30_threads/future/members/get.cc: Likewise.
	* testsuite/30_threads/future/members/get2.cc: Likewise.
	* testsuite/30_threads/future/members/share.cc: Likewise.
	* testsuite/30_threads/future/members/valid.cc: Likewise.
	* testsuite/30_threads/future/members/wait.cc: Likewise.
	* testsuite/30_threads/future/members/wait_for.cc: Likewise.
	* testsuite/30_threads/future/members/wait_until.cc: Likewise.
	* testsuite/30_threads/lock/1.cc: Likewise.
	* testsuite/30_threads/lock/2.cc: Likewise.
	* testsuite/30_threads/lock/3.cc: Likewise.
	* testsuite/30_threads/lock/4.cc: Likewise.
	* testsuite/30_threads/mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise.
	* testsuite/30_threads/mutex/lock/1.cc: Likewise.
	* testsuite/30_threads/mutex/native_handle/1.cc: Likewise.
	* testsuite/30_threads/mutex/native_handle/typesizes.cc: Likewise.
	* testsuite/30_threads/mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/mutex/unlock/2.cc: Likewise.
	* testsuite/30_threads/packaged_task/49668.cc: Likewise.
	* testsuite/30_threads/packaged_task/60564.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/1.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/2.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/3.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/56492.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/alloc.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/move.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/move_assign.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/at_thread_exit.cc:
	Likewise.
	* testsuite/30_threads/packaged_task/members/get_future.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/invoke.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/invoke2.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/invoke3.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/invoke4.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/invoke5.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/reset.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/reset2.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/swap.cc: Likewise.
	* testsuite/30_threads/packaged_task/members/valid.cc: Likewise.
	* testsuite/30_threads/promise/60966.cc: Likewise.
	* testsuite/30_threads/promise/cons/1.cc: Likewise.
	* testsuite/30_threads/promise/cons/alloc.cc: Likewise.
	* testsuite/30_threads/promise/cons/move.cc: Likewise.
	* testsuite/30_threads/promise/cons/move_assign.cc: Likewise.
	* testsuite/30_threads/promise/members/at_thread_exit.cc: Likewise.
	* testsuite/30_threads/promise/members/at_thread_exit2.cc: Likewise.
	* testsuite/30_threads/promise/members/get_future.cc: Likewise.
	* testsuite/30_threads/promise/members/get_future2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_exception.cc: Likewise.
	* testsuite/30_threads/promise/members/set_exception2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value2.cc: Likewise.
	* testsuite/30_threads/promise/members/set_value3.cc: Likewise.
	* testsuite/30_threads/promise/members/swap.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc:
	Likewise.
	* testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc:
	Likewise.
	* testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/recursive_mutex/unlock/2.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc:
	Likewise.
	* testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/recursive_timed_mutex/unlock/2.cc: Likewise.
	* testsuite/30_threads/shared_future/cons/move.cc: Likewise.
	* testsuite/30_threads/shared_future/members/45133.cc: Likewise.
	* testsuite/30_threads/shared_future/members/get.cc: Likewise.
	* testsuite/30_threads/shared_future/members/get2.cc: Likewise.
	* testsuite/30_threads/shared_future/members/valid.cc: Likewise.
	* testsuite/30_threads/shared_future/members/wait.cc: Likewise.
	* testsuite/30_threads/shared_future/members/wait_for.cc: Likewise.
	* testsuite/30_threads/shared_future/members/wait_until.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/2.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/3.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/4.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/5.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/2.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.
	* testsuite/30_threads/shared_lock/modifiers/1.cc: Likewise.
	* testsuite/30_threads/shared_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/shared_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/shared_mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/shared_mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/this_thread/1.cc: Likewise.
	* testsuite/30_threads/this_thread/sleep_for-mt.cc: Likewise.
	* testsuite/30_threads/this_thread/sleep_until-mt.cc: Likewise.
	* testsuite/30_threads/thread/cons/1.cc: Likewise.
	* testsuite/30_threads/thread/cons/2.cc: Likewise.
	* testsuite/30_threads/thread/cons/3.cc: Likewise.
	* testsuite/30_threads/thread/cons/4.cc: Likewise.
	* testsuite/30_threads/thread/cons/49668.cc: Likewise.
	* testsuite/30_threads/thread/cons/5.cc: Likewise.
	* testsuite/30_threads/thread/cons/6.cc: Likewise.
	* testsuite/30_threads/thread/cons/7.cc: Likewise.
	* testsuite/30_threads/thread/cons/8.cc: Likewise.
	* testsuite/30_threads/thread/cons/9.cc: Likewise.
	* testsuite/30_threads/thread/cons/moveable.cc: Likewise.
	* testsuite/30_threads/thread/cons/terminate.cc: Likewise.
	* testsuite/30_threads/thread/members/1.cc: Likewise.
	* testsuite/30_threads/thread/members/2.cc: Likewise.
	* testsuite/30_threads/thread/members/3.cc: Likewise.
	* testsuite/30_threads/thread/members/4.cc: Likewise.
	* testsuite/30_threads/thread/members/5.cc: Likewise.
	* testsuite/30_threads/thread/members/hardware_concurrency.cc:
	Likewise.
	* testsuite/30_threads/thread/native_handle/typesizes.cc: Likewise.
	* testsuite/30_threads/thread/swap/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/dest/destructor_locked.cc:
	Likewise.
	* testsuite/30_threads/timed_mutex/lock/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/native_handle/typesizes.cc:
	Likewise.
	* testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise.
	* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Likewise.
	* testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise.
	* testsuite/30_threads/timed_mutex/unlock/2.cc: Likewise.
	* testsuite/30_threads/try_lock/1.cc: Likewise.
	* testsuite/30_threads/try_lock/2.cc: Likewise.
	* testsuite/30_threads/try_lock/3.cc: Likewise.
	* testsuite/30_threads/try_lock/4.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/1.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/2.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/3.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/4.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/5.cc: Likewise.
	* testsuite/30_threads/unique_lock/cons/6.cc: Likewise.
	* testsuite/30_threads/unique_lock/locking/1.cc: Likewise.
	* testsuite/30_threads/unique_lock/locking/2.cc: Likewise.
	* testsuite/30_threads/unique_lock/locking/3.cc: Likewise.
	* testsuite/30_threads/unique_lock/locking/4.cc: Likewise.
	* testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise.
2020-08-23 23:18:48 -03:00
Hans-Peter Nilsson
0e6c51de8e reorg.c (fill_slots_from_thread): Improve for TARGET_FLAGS_REGNUM
This handles TARGET_FLAGS_REGNUM clobbering insns as delay-slot
fillers using a method similar to that in commit 33c2207d3f,
where care was taken for fill_simple_delay_slots to allow such
insns when scanning for delay-slot fillers *backwards* (before
the insn).

A TARGET_FLAGS_REGNUM target is typically a former cc0 target.
For cc0 targets, insns don't mention clobbering cc0, so the
clobbers are mentioned in the "resources" only as a special
entity and only for compare-insns and branches, where the cc0
value matters.

In contrast, with TARGET_FLAGS_REGNUM, most insns clobber it and
the register liveness detection in reorg.c / resource.c treats
that as a blocker (for other insns mentioning it, i.e. most)
when looking for delay-slot-filling candidates.  This means that
when comparing core and performance for a delay-slot cc0 target
before and after the de-cc0 conversion, the inability to fill a
delay slot after conversion manifests as a regression.  This was
one such case, for CRIS, with random_bitstring in
gcc.c-torture/execute/arith-rand-ll.c as well as the target
libgcc division function.

After this, all known performance regressions compared to cc0
are fixed.

gcc:
	PR target/93372
	* reorg.c (fill_slots_from_thread): Allow trial insns that clobber
	TARGET_FLAGS_REGNUM as delay-slot fillers.

gcc/testsuite:
	PR target/93372
	* gcc.target/cris/pr93372-47.c: New test.
2020-08-24 03:15:21 +02:00
GCC Administrator
baf917af01 Daily bump. 2020-08-24 00:16:20 +00:00
H.J. Lu
87c753ac24 x86: Add target("general-regs-only") function attribute
gcc/

	PR target/96744
	* config/i386/i386-options.c (IX86_ATTR_IX86_YES): New.
	(IX86_ATTR_IX86_NO): Likewise.
	(ix86_opt_type): Add ix86_opt_ix86_yes and ix86_opt_ix86_no.
	(ix86_valid_target_attribute_inner_p): Handle general-regs-only,
	ix86_opt_ix86_yes and ix86_opt_ix86_no.
	(ix86_option_override_internal): Check opts->x_ix86_target_flags
	instead of opts->x_ix86_target_flags.
	* doc/extend.texi: Document target("general-regs-only") function
	attribute.

gcc/testsuite/

	PR target/96744
	* gcc.target/i386/pr96744-1.c: New test.
	* gcc.target/i386/pr96744-2.c: Likewise.
	* gcc.target/i386/pr96744-3a.c: Likewise.
	* gcc.target/i386/pr96744-3b.c: Likewise.
	* gcc.target/i386/pr96744-4.c: Likewise.
	* gcc.target/i386/pr96744-5.c: Likewise.
	* gcc.target/i386/pr96744-6.c: Likewise.
	* gcc.target/i386/pr96744-7.c: Likewise.
	* gcc.target/i386/pr96744-8a.c: Likewise.
	* gcc.target/i386/pr96744-8b.c: Likewise.
	* gcc.target/i386/pr96744-9.c: Likewise.
2020-08-23 08:40:34 -07:00
Paul Thomas
dbc724d6d2 Changed to STOP 1 in unlimited_polymorphic_31.f03.
2020-08-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/testsuite/
	PR fortran/92785
	* gfortran.dg/unlimited_polymorphic_31.f03: Change to stop 1.
2020-08-23 15:48:36 +01:00
Paul Thomas
967454a212 Adding option -g to pr96737.f90.
2020-08-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/testsuite/
	PR fortran/96737
	* gfortran.dg/pr96737.f90: Add option -g.
2020-08-23 15:37:21 +01:00
Paul Thomas
c4565031c8 This patch fixes PR96737. See the explanatory comment in the testcase.
2020-08-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/96737
	* trans-types.c (gfc_get_derived_type): Derived types that are
	used in submodules are not compatible with TYPE_CANONICAL from
	any of the global namespaces.

gcc/testsuite/
	PR fortran/96737
	* gfortran.dg/pr96737.f90: New test.
2020-08-23 15:34:27 +01:00
GCC Administrator
e769f9707d Daily bump. 2020-08-23 00:16:25 +00:00
David Malcolm
df2b78d407 analyzer: fix NULL deref false positives [PR94851]
PR analyzer/94851 reports various false "NULL dereference" diagnostics.
The first case (comment #1) affects GCC 10.2 but no longer affects
trunk; I believe it was fixed by the state rewrite of
r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d.

The patch adds a regression test for this case.

The other cases (comment #3 and comment #4) still affect trunk.
In both cases, the && in a conditional is optimized to bitwise &
  _1 = p_4 != 0B;
  _2 = p_4 != q_6(D);
  _3 = _1 & _2;
and the analyzer fails to fold this for the case where one (or both) of
the conditionals is false, and thus erroneously considers the path where
"p" is non-NULL despite being passed a NULL value.

Fix this by implementing folding for this case.

gcc/analyzer/ChangeLog:
	PR analyzer/94851
	* region-model-manager.cc
	(region_model_manager::maybe_fold_binop): Fold bitwise "& 0" to 0.

gcc/testsuite/ChangeLog:
	PR analyzer/94851
	* gcc.dg/analyzer/pr94851-1.c: New test.
	* gcc.dg/analyzer/pr94851-3.c: New test.
	* gcc.dg/analyzer/pr94851-4.c: New test.
2020-08-22 11:08:46 -04:00
David Malcolm
c199723d7e analyzer: simplify store::eval_alias
I have followup patches that add new conditions to store::eval_alias.
Rather than duplicate all conditions for symmetry, split it up and
call it on both (A, B) and (B, A).

gcc/analyzer/ChangeLog:
	* store.cc (store::eval_alias): Make const.  Split out 2nd half
	into store::eval_alias_1 and call it twice for symmetry, avoiding
	test duplication.
	(store::eval_alias_1): New function, split out from the above.
	* store.h (store::eval_alias): Make const.
	(store::eval_alias_1): New decl.
2020-08-22 11:05:02 -04:00
David Malcolm
294b6da21b analyzer: simplify region_model::push_frame
region_model::push_frame was binding arguments for both the default SSA
name for each parameter, and the underlying parameter.

Simplify the generated states by only binding the default SSA name if
it exists, or the parameter if there is no default SSA name.

gcc/analyzer/ChangeLog:
	* region-model.cc (region_model::push_frame): Bind the default
	SSA name for each parm if it exists, falling back to the parm
	itself otherwise, rather than doing both.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/malloc-ipa-8-double-free.c: Drop
	-fanalyzer-verbose-state-changes.
2020-08-22 09:51:22 -04:00
Andrea Corallo
fc34d04b07 libgccjit: Update comments for gcc_jit_context_new_rvalue_from* functions
gcc/jit/ChangeLog

2020-08-06  Andrea Corallo  <andrea.corallo@arm.com>

	* libgccjit.c:
	(gcc_jit_context_new_rvalue_from_int)
	(gcc_jit_context_new_rvalue_from_long)
	(gcc_jit_context_new_rvalue_from_double)
	(gcc_jit_context_new_rvalue_from_ptr): Update function heading
	comments.
2020-08-22 09:46:21 +02:00
GCC Administrator
3eeede6de7 Daily bump. 2020-08-22 00:16:24 +00:00
Richard Sandiford
09698e44c7 Update links to Arm docs
gcc/
	* doc/extend.texi: Update links to Arm docs.
	* doc/invoke.texi: Likewise.
2020-08-21 18:32:06 +01:00
Jonathan Wakely
9b5d4f6e66 libstdc++: Do not check "cold" name on darwin [PR 96736]
libstdc++-v3/ChangeLog:

	PR libstdc++/96736
	* testsuite/17_intro/headers/c++1998/all_attributes.cc: Do not
	test "cold" on darwin.
	* testsuite/17_intro/headers/c++2011/all_attributes.cc:
	Likewise.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc:
	Likewise.
	* testsuite/17_intro/headers/c++2017/all_attributes.cc:
	Likewise.
	* testsuite/17_intro/headers/c++2020/all_attributes.cc:
	Likewise.
2020-08-21 18:24:40 +01:00
liuhongt
c44c2a3b05 Using gen_int_mode instead of GEN_INT to avoid ICE caused by type promotion.
2020-07-22  Hongtao Liu  <hongtao.liu@intel.com>

gcc/
	PR target/96262
	* config/i386/i386-expand.c
	(ix86_expand_vec_shift_qihi_constant): Refine.

gcc/testsuite/
	* gcc.target/i386/pr96262-1.c: New test.
2020-08-22 00:53:20 +08:00
Alex Coplan
b46584d783 driver: Fix several memory leaks [PR63854]
This patch fixes several memory leaks in the driver, all of which relate
to the handling of static specs. We introduce functions
set_static_spec_{shared,owned}() which are used to enforce proper memory
management when updating the strings in the static_specs table.

This is achieved by making use of the alloc_p field in the table
entries. Similarly to set_spec(), each time we update an entry, we check
whether alloc_p is set, and free the old value if so. We then set
alloc_p correctly based on whether we "own" this memory or whether we're
just taking a pointer to a shared string which we shouldn't free.

The following table shows the number of leaks found by AddressSanitizer
when running a minimal libgccjit program on AArch64. The test program
does the whole libgccjit compilation cycle in a loop (including acquiring
and releasing the context), and the table below shows the number of leaks
for different iterations of that loop.

+--------------+-----+-----+------+---------------+
| # of runs >  | 1   | 2   | 3    | Leaks per run |
+--------------+-----+-----+------+---------------+
| Before patch | 463 | 940 | 1417 | 477           |
+--------------+-----+-----+------+---------------+
| After patch  | 416 | 846 | 1276 | 430           |
+--------------+-----+-----+------+---------------+

gcc/ChangeLog:

	PR jit/63854
	* gcc.c (set_static_spec): New.
	(set_static_spec_owned): New.
	(set_static_spec_shared): New.
	(driver::maybe_putenv_COLLECT_LTO_WRAPPER): Use
	set_static_spec_owned() to take ownership of lto_wrapper_file
	such that it gets freed in driver::finalize.
	(driver::maybe_run_linker): Use set_static_spec_shared() to
	ensure that we don't try and free() the static string "ld",
	also ensuring that any previously-allocated string in
	linker_name_spec is freed. Likewise with argv0.
	(driver::finalize): Use set_static_spec_shared() when resetting
	specs that previously had allocated strings; remove if(0)
	around call to free().
2020-08-21 14:26:11 +01:00
Senthil Kumar Selvaraj
e7d55c6b81 Allow try_split to split RTX_FRAME_RELATED_P insns
Instead of rejecting RTX_FRAME_RELATED_P insns, allow try_split to split
such insns, provided the split is after reload, and the result of the split
is a single insn.

recog.c:peep2_attempt already splits an RTX_FRAME_RELATED_P insn splitting
to a single insn. This patch refactors existing code copying frame related
info to a separate function (copy_frame_info_to_split_insn) and calls it
from both peep2_attempt and try_split.

2020-08-21  Senthil Kumar Selvaraj  <saaadhu@gcc.gnu.org>

gcc/ChangeLog:

	* emit-rtl.c (try_split): Call copy_frame_info_to_split_insn
	to split certain RTX_FRAME_RELATED_P insns.
	* recog.c (copy_frame_info_to_split_insn): New function.
	(peep2_attempt): Split copying of frame related info of
	RTX_FRAME_RELATED_P insns into above function and call it.
	* recog.h (copy_frame_info_to_split_insn): Declare it.
2020-08-21 17:59:40 +05:30
Jonathan Wakely
988fb2f597 libstdc++: Skip PSTL tests when installed TBB is too old [PR 96718]
These tests do not actually require TBB, because they only inspect the
feature test macros present in the headers. However, if TBB is installed
then its headers will be included, and the version will be checked. If
the version is too old, compilation fails due to a #error directive.

This change disables the tests if TBB is not present, so that we skip
them instead of failing.

libstdc++-v3/ChangeLog:

	PR libstdc++/96718
	* testsuite/25_algorithms/pstl/feature_test-2.cc: Require
	tbb-backend effective target.
	* testsuite/25_algorithms/pstl/feature_test-3.cc: Likewise.
	* testsuite/25_algorithms/pstl/feature_test-5.cc: Likewise.
	* testsuite/25_algorithms/pstl/feature_test.cc: Likewise.
2020-08-21 12:01:05 +01:00
liuhongt
388cb292a9 Enable bitwise operation for type mask.
Enable operator or/xor/and/andn/not for mask register, kxnor is not
enabled since there's no corresponding instruction for general
registers.

gcc/
	PR target/88808
	* config/i386/i386.c (ix86_preferred_reload_class): Allow
	QImode data go into mask registers.
	* config/i386/i386.md: (*movhi_internal): Adjust constraints
	for mask registers.
	(*movqi_internal): Ditto.
	(*anddi_1): Support mask register operations
	(*and<mode>_1): Ditto.
	(*andqi_1): Ditto.
	(*andn<mode>_1): Ditto.
	(*<code><mode>_1): Ditto.
	(*<code>qi_1): Ditto.
	(*one_cmpl<mode>2_1): Ditto.
	(*one_cmplsi2_1_zext): Ditto.
	(*one_cmplqi2_1): Ditto.
	(define_peephole2): Move constant 0/-1 directly into mask
	registers.
	* config/i386/predicates.md (mask_reg_operand): New predicate.
	* config/i386/sse.md (define_split): Add post-reload splitters
	that would convert "generic" patterns to mask patterns.
	(*knotsi_1_zext): New define_insn.

gcc/testsuite/
	* gcc.target/i386/bitwise_mask_op-1.c: New test.
	* gcc.target/i386/bitwise_mask_op-2.c: New test.
	* gcc.target/i386/bitwise_mask_op-3.c: New test.
	* gcc.target/i386/avx512bw-pr88465.c: New testcase.
	* gcc.target/i386/avx512bw-kunpckwd-1.c: Adjust testcase.
	* gcc.target/i386/avx512bw-kunpckwd-3.c: Ditto.
	* gcc.target/i386/avx512dq-kmovb-5.c: Ditto.
	* gcc.target/i386/avx512f-kmovw-5.c: Ditto.
	* gcc.target/i386/pr55342.c: Ditto.
2020-08-21 12:48:41 +08:00
liuhongt
16516644d8 According to instruction_tables.pdf
1. Set cost of movement inside mask registers a bit higher than gpr's.
2. Set cost of movement between mask register and gpr much higher than movement
   inside gpr, but still less equal than load/store.
3. Set cost of mask register load/store a bit higher than gpr load/store.

gcc/
	* config/i386/x86-tune-costs.h (skylake_cost): Adjust cost
	model.
2020-08-21 12:48:36 +08:00
liuhongt
2d2bc36c44 Enable direct movement between gpr and mask registers in pass_reload.
Changelog
gcc/
	* config/i386/i386.c (inline_secondary_memory_needed):
	No memory is needed between mask regs and gpr.
	(ix86_hard_regno_mode_ok): Add condition TARGET_AVX512F for
	mask regno.
	* config/i386/i386.h (enum reg_class): Add INT_MASK_REGS.
	(REG_CLASS_NAMES): Ditto.
	(REG_CLASS_CONTENTS): Ditto.
	* config/i386/i386.md: Exclude mask register in
	define_peephole2 which is avaiable only for gpr.

gcc/testsuite/
	* gcc.target/i386/spill_to_mask-1.c: New tests.
	* gcc.target/i386/spill_to_mask-2.c: New tests.
	* gcc.target/i386/spill_to_mask-3.c: New tests.
	* gcc.target/i386/spill_to_mask-4.c: New tests.
2020-08-21 12:48:31 +08:00
H.J. Lu
00cb3494ca x86: Add cost model for operation of mask registers.
gcc/

	PR target/71453
	* config/i386/i386.h (struct processor_costs): Add member
	mask_to_integer, integer_to_mask, mask_load[3], mask_store[3],
	mask_move.
	* config/i386/x86-tune-costs.h (ix86_size_cost, i386_cost,
	i386_cost, pentium_cost, lakemont_cost, pentiumpro_cost,
	geode_cost, k6_cost, athlon_cost, k8_cost, amdfam10_cost,
	bdver_cost, znver1_cost, znver2_cost, skylake_cost,
	btver1_cost, btver2_cost, pentium4_cost, nocona_cost,
	atom_cost, slm_cost, intel_cost, generic_cost, core_cost):
	Initialize mask_load[3], mask_store[3], mask_move,
	integer_to_mask, mask_to_integer for all target costs.
	* config/i386/i386.c (ix86_register_move_cost): Using cost
	model of mask registers.
	(inline_memory_move_cost): Ditto.
	(ix86_register_move_cost): Ditto.
2020-08-21 12:48:27 +08:00
David Malcolm
6b31b6b526 analyzer: add regression tests [PR95152]
PR analyzer/95152 reports various ICEs in
region_model::get_or_create_mem_ref.

I removed this function as part of the state rewrite in
r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d.
I've verified that these two test cases reproduce the issue with 10.2
and don't ICE with trunk; adding them as regression tests.

gcc/testsuite/ChangeLog:
	PR analyzer/95152
	* gcc.dg/analyzer/pr95152-4.c: New test.
	* gcc.dg/analyzer/pr95152-5.c: New test.
2020-08-20 21:15:05 -04:00
GCC Administrator
5b9a3d2a05 Daily bump. 2020-08-21 00:16:23 +00:00
Iain Buclaw
15717b4784 d: Merge upstream dmd 1b5a53d01.
Fixes an ICE in setValue at dmd/dinterpret.c:7046

This was originally seen when running the testsuite for a 16-bit target,
however, it could be reproduced on 32-bit using long[] as well.

Reviewed-on: https://github.com/dlang/dmd/pull/11547

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 1b5a53d01.
2020-08-21 01:08:08 +02:00
David Malcolm
00cb0f5840 analyzer: fix infinite recursion ICE on unions [PR96723]
Attempts to store sm-state into a union in C++ triggered an infinite
recursion when trying to generate a representative tree, due to
erroneously trying to use the dtor of the union as a field.

Fix it by filtering out non-FIELD_DECLs when walking TYPE_FIELDs
in region::get_subregions_for_binding.

gcc/analyzer/ChangeLog:
	PR analyzer/96723
	* region-model-manager.cc
	(region_model_manager::get_field_region): Assert that field is a
	FIELD_DECL.
	* region.cc (region::get_subregions_for_binding): In
	union-handling, filter the TYPE_FIELDS traversal to just FIELD_DECLs.

gcc/testsuite/ChangeLog:
	PR analyzer/96723
	* g++.dg/analyzer/pr96723.C: New test.
2020-08-20 17:01:38 -04:00
Jonathan Wakely
1531d8df6e libstdc++: Fix typo in ChangeLog 2020-08-20 21:56:43 +01:00
Tobias Burnus
7ffcf5d611 configure: Also check C++11 (flags) for ${build} compiler not only for ${host}
config/ChangeLog:

	PR bootstrap/96612
	* ax_cxx_compile_stdcxx.m4: Add fourth argument to check also
	the CXX_FOR_BUILD compiler.

ChangeLog:

	PR bootstrap/96612
	* configure.ac: Run AX_CXX_COMPILE_STDCXX also for ${build} compiler,
	if not the same as ${host}.
	* configure: Regenerate.
2020-08-20 21:59:00 +02:00
Jonathan Wakely
5e9ad288eb libstdc++: Make incrementable<__int128> satisfied in strict mode
This adds specializations of std::incrementable_traits so that 128-bit
integers are always considered incrementable (and therefore usable with
std::ranges::iota_view) even when they don't satisfy std::integral.

libstdc++-v3/ChangeLog:

	* include/bits/iterator_concepts.h [__STRICT_ANSI__]
	(incrementable_traits<__int128>): Define specialization.
	(incrementable_traits<unsigned __int128>): Likewise.
	* testsuite/std/ranges/iota/96042.cc: Test iota_view with
	__int128.
2020-08-20 19:42:02 +01:00
Paul Thomas
300ef2fcc1 This patch fixes PRs 96100 and 96101.
2020-08-20  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/96100
	PR fortran/96101
	* trans-array.c (get_array_charlen): Tidy up the evaluation of
	the string length for array constructors. Avoid trailing array
	references. Ensure string lengths of deferred length components
	are set. For parentheses operator apply string  length to both
	the primary expression and the enclosed expression.

gcc/testsuite/
	PR fortran/96100
	PR fortran/96101
	* gfortran.dg/char_length_23.f90: New test.
2020-08-20 18:17:59 +01:00
Iain Buclaw
d241134695 vxworks: Fix GCC selftests for *-wrs-vxworks7-* targets
Currently when building a cross-compiler targeting arm-wrs-vxworks7, the
self-tests fail unless the VSB_DIR environment variable is set.

This prevents attempts at designating the location of runtime header
files, libraries or startfiles, which would fail on unset environment
variables and aren't needed for such tests.

gcc/ChangeLog:

	* config/vxworks.h (VXWORKS_ADDITIONAL_CPP_SPEC): Don't include
	VxWorks header files if -fself-test is used.
	(STARTFILE_PREFIX_SPEC): Avoid using VSB_DIR if -fself-test is used.
2020-08-20 18:07:43 +02:00
Andre Vehreschild
05814dde70 Fix obvious typo were errmsg_len was assigned to errmsg.
gcc/fortran/ChangeLog:

2020-08-20  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/94958
	* trans-array.c (gfc_bcast_alloc_comp): Use the correct variable.
2020-08-20 17:50:39 +02:00
Joe Ramsay
91d206adfe arm: Require MVE memory operand for destination of vst1q intrinsic
Previously, the machine description patterns for vst1q accepted a generic memory
operand for the destination, which could lead to an unrecognised builtin when
expanding vst1q* intrinsics. This change fixes the pattern to only accept MVE
memory operands.

gcc/ChangeLog:

	PR target/96683
	* config/arm/mve.md (mve_vst1q_f<mode>): Require MVE memory operand for
	destination.
	(mve_vst1q_<supf><mode>): Likewise.

gcc/testsuite/ChangeLog:

	PR target/96683
	* gcc.target/arm/mve/intrinsics/vst1q_f16.c: New test.
	* gcc.target/arm/mve/intrinsics/vst1q_s16.c: New test.
	* gcc.target/arm/mve/intrinsics/vst1q_s8.c: New test.
	* gcc.target/arm/mve/intrinsics/vst1q_u16.c: New test.
	* gcc.target/arm/mve/intrinsics/vst1q_u8.c: New test.
2020-08-20 15:27:09 +00:00
Chung-Lin Tang
f9b9832837 libgomp: adjust nvptx_free callback context checking
Change test for CUDA callback context in nvptx_free() from using
GOMP_PLUGIN_acc_thread () into checking for CUDA_ERROR_NOT_PERMITTED,
for the former only works for OpenACC, but not OpenMP offloading.

2020-08-20  Chung-Lin Tang  <cltang@codesourcery.com>

	libgomp/
	* plugin/plugin-nvptx.c (nvptx_free):
	Change "GOMP_PLUGIN_acc_thread () == NULL" test into check of
	CUDA_ERROR_NOT_PERMITTED status for cuMemGetAddressRange. Adjust
	comments.
2020-08-20 07:18:51 -07:00
Tobias Burnus
656218ab98 Fortran: Fix OpenMP's 'if(simd:' etc. conditions
gcc/fortran/ChangeLog:

	* openmp.c (gfc_match_omp_clauses): Re-order 'if' clause pasing
	to avoid creating spurious symbols.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/lastprivate-conditional-10.f90: New test.
2020-08-20 13:33:40 +02:00
Christophe Lyon
1763ec9b20 testsuite: Remove test for arm32 in arm_soft_ok
There is no reason to check for arm32 when checking for
-mfloat=abi-soft support. Instead this implies skipping some tests
when targetting a thumb-1 cpu, while they pass.

This patch removes the arm32 check, and uses the same skeleton as
arm_softfp_ok and arm_hard_ok.

2020-08-20  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* lib/target-supports.exp (arm_soft_ok): Remove arm32 check.
2020-08-20 09:12:58 +00:00
Christophe Lyon
3f678b4c20 testsuite: Skip arm/pure-code tests for arm*-*-uclinuxfdpiceabi
FDPIC it uses PIC code, which is incompatible with -mpure-code, so we
want to skip these tests for arm*-*-uclinuxfdpiceabi.

This patch also fixes a typo where the final closing bracket was
commented out.

2020-08-20  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/pure-code/pure-code.exp: Skip for
	arm*-*-uclinuxfdpiceabi. Fix missing closing bracket.
2020-08-20 08:56:57 +00:00