Commit Graph

185203 Commits

Author SHA1 Message Date
Michael de Lang 80b4ce1a51 TSAN: add new test
gcc/testsuite/ChangeLog:

	* g++.dg/tsan/pthread_cond_clockwait.C: New test.
2021-05-14 12:09:58 +02:00
Martin Liska fe108dad32 download_prerequisites: update MPFR version to recommended
contrib/ChangeLog:

	* download_prerequisites: Use version 4.1.0.
2021-05-14 12:01:08 +02:00
Martin Liska 40a2f88838 opts: add Warning keyword for 2 options
gcc/c-family/ChangeLog:

	* c.opt: Add Warning keyword for 2 options.
2021-05-14 11:42:44 +02:00
Jakub Jelinek df18a1343d Closing of 8 branch.
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

contrib/
	* gcc-changelog/git_update_version.py: Remove releases/gcc-8 from
	active_refs.
maintainer-scripts/
	* crontab: Stop doing gcc-8 snapshots.
2021-05-14 11:25:30 +02:00
Kyrylo Tkachov 543c0cbca0 aarch64: Merge sqdmlal2 and sqdmlsl2 expanders
The various sqdmlal2 and sqdmlsl2 expanders perform almost identical functions and can be
merged using code iterators and attributes to reduce the code in the MD file.
No behavioural change is expected.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md (aarch64_sqdmlal2<mode>): Merge into...
	(aarch64_sqdml<SBINQOPS:as>l2<mode>): ... This.
	(aarch64_sqdmlsl2<mode>): Delete.
	(aarch64_sqdmlal2_lane<mode>): Merge this...
	(aarch64_sqdmlsl2_lane<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_lane<mode>): ... Into this.
	(aarch64_sqdmlal2_laneq<mode>): Merge this...
	(aarch64_sqdmlsl2_laneq<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_laneq<mode>): ... Into this.
	(aarch64_sqdmlal2_n<mode>): Merge this...
	(aarch64_sqdmlsl2_n<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_n<mode>): ... Into this.
2021-05-14 09:56:45 +01:00
Martin Liska 3489257a33 Port gnat-style to Sphinx.
gcc/ada/ChangeLog:

	* doc/Makefile: Add gnat-style target.
	* doc/share/conf.py: Likewise.
	* doc/gnat-style.rst: New file.
2021-05-14 10:51:02 +02:00
Martin Liska ae3e0b8bc2 gcc-changelog: detect Co-Authored-By before ChangeLog entries
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support Co-Authored-By before
	a first ChangeLog entry.
2021-05-14 10:44:33 +02:00
H.J. Lu f3b1516d9d libsanitizer: cherry-pick from upstream
cherry-pick:

72797dedb720 [sanitizer] Use size_t on g_tls_size to fix build on x32
2021-05-13 18:23:55 -07:00
Marek Polacek 149061188c c++: Check attributes on friend declarations [PR99032]
This patch implements [dcl.attr.grammar]/5: "If an attribute-specifier-seq
appertains to a friend declaration ([class.friend]), that declaration shall
be a definition."

This restriction applies to C++11-style attributes as well as GNU
attributes with the exception that we allow GNU attributes that require
a type, such as vector_size to continue accepting code as in attrib63.C.
There are various forms of friend declarations, we have friend
templates, C++11 extended friend declarations, and so on.  In some cases
we already ignore the attribute and warn that it was ignored.  But
certain cases weren't diagnosed, and with this patch we'll give a hard
error.  I tried hard not to emit both a warning and error and I think it
worked out.

Jason provided the cp_parser_decl_specifier_seq hunk to detect using
standard attributes in the middle of decl-specifiers, which is invalid.

Co-authored-by: Jason Merrill <jason@redhat.com>

gcc/cp/ChangeLog:

	PR c++/99032
	* cp-tree.h (any_non_type_attribute_p): Declare.
	* decl.c (grokdeclarator): Diagnose when an attribute appertains to
	a friend declaration that is not a definition.
	* decl2.c (any_non_type_attribute_p): New.
	* parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
	in the middle of decl-specifiers.
	(cp_parser_elaborated_type_specifier): Diagnose when an attribute
	appertains to a friend declaration that is not a definition.
	(cp_parser_member_declaration): Likewise.

gcc/testsuite/ChangeLog:

	PR c++/99032
	* g++.dg/cpp0x/friend7.C: New test.
	* g++.dg/cpp0x/gen-attrs-4.C: Add dg-error.
	* g++.dg/cpp0x/gen-attrs-39-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-74.C: New test.
	* g++.dg/ext/attrib63.C: New test.
2021-05-13 21:13:32 -04:00
GCC Administrator f9af11c7f1 Daily bump. 2021-05-14 00:16:30 +00:00
Martin Sebor 5380e3c137 PR middle-end/100574 - ICE in size_remaining, at builtins.c
gcc/ChangeLog:

	PR middle-end/100574
	* builtins.c (access_ref::get_ref): Improve detection of PHIs with
	all null arguments.
2021-05-13 16:20:45 -06:00
Martin Sebor 2efe245bb8 Avoid -Wuninitialized false negatives with sanitization and VLAs.
Resolves:
PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized
PR middle-end/98583 - missing -Wuninitialized reading from a second VLA in its own block

gcc/ChangeLog:

	PR tree-optimization/93100
	PR middle-end/98583
	* tree-ssa-uninit.c (check_defs): Exclude intrinsic functions that
	don't modify referenced objects.

gcc/testsuite/ChangeLog:

	PR tree-optimization/93100
	PR middle-end/98583
	* g++.dg/warn/uninit-pr93100.C: New test.
	* gcc.dg/uninit-pr93100.c: New test.
	* gcc.dg/uninit-pr98583.c: New test.
2021-05-13 16:06:51 -06:00
Martin Jambor ca9bb74a5f tree-sra: Avoid refreshing into const base decls (PR 100453)
When SRA transforms an assignment where the RHS is an aggregate decl
that it creates replacements for, the (least efficient) fallback
method of dealing with them is to store all the replacements back into
the original decl and then let the original assignment takes itc
sourse.

That of course should not need to be done for TREE_READONLY bases
which cannot change contents.  The SRA code handled this situation in
one of two necessary places but only for DECL_IN_CONSTANT_POOL const
decls, this patch modifies both to check TREE_READONLY.

gcc/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/100453
	* tree-sra.c (sra_modify_assign): All const base accesses do not
	need refreshing, not just those from decl_pool.
	(sra_modify_assign): Do not refresh into a const base decl.

gcc/testsuite/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/100453
	* gcc.dg/tree-ssa/pr100453.c: New test.
2021-05-13 23:26:32 +02:00
Iain Sandoe 1f6fc2826d libsanitizer : Update LOCAL_PATCHES.
This adds the local patch to handle missing __builtin_os_log_format
on Darwin.

libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Add Darwin patch for __builtin_os_log_format.
2021-05-13 21:19:19 +01:00
Iain Sandoe adab7b2bf4 libsanitizer, Darwin : Handle missing __builtin_os_log_format.
GCC does not, currently, define __builtin_os_log_format, which
is needed by os/log.h.  Do not include that header unless the
builtin is defined (since the header errors out on the same
condition).  Provide a work-around solution to the missing API
provided via the header.

libsanitizer/ChangeLog:

	* sanitizer_common/sanitizer_mac.cpp : Check for the
	availability of __builtin_os_log_format before trying to
	include a header depending on it.
	(OS_LOG_DEFAULT): New.
	(os_log_error): Define to a fall-back using an older API.
2021-05-13 21:18:18 +01:00
Dimitar Dimitrov 8aa8a2af8f libgcc: pru: Place mpyll into its own section
This should help LD's --gc-sections feature to reduce final ELF size.

libgcc/ChangeLog:

	* config/pru/mpyll.S (__pruabi_mpyll): Place into own section.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-05-13 23:11:01 +03:00
Martin Sebor e554887df0 Fix compilation error in ILP32.
gcc/testsuite/ChangeLog:
	* g++.dg/pr100574.C: Use size_t as operator new argument type.
2021-05-13 11:35:03 -06:00
Martin Liska 9feb5822b7 attributes: target_clone expects a string argument
PR middle-end/100504

gcc/c-family/ChangeLog:

	* c-attribs.c (handle_target_clones_attribute): Expect a string
	argument to target_clone argument.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr100504.c: New test.
2021-05-13 19:30:18 +02:00
Iain Buclaw b7b413152e libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD
The function declarations were updated to use `const scope', but the
static asserts were not.

Reviewed-on: https://github.com/dlang/druntime/pull/3470

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 98c6ff0c.
2021-05-13 19:24:31 +02:00
Martin Liska 1f152f2996 Remove unused variable.
Addresses the following clang warning:
gcc/tree-ssa-dom.c:652:33: warning: private field 'm_simplifier' is not used [-Wunused-private-field]

gcc/ChangeLog:

	* tree-ssa-dom.c: Remove m_simplifier.
2021-05-13 19:17:11 +02:00
Martin Sebor 957c437363 PR c/100550 - ICE: in fold_convert_loc with function call VLA argument
gcc/c/ChangeLog:

	PR c/100550
	* c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds.

gcc/testsuite/ChangeLog:

	PR c/100550
	* gcc.dg/Wvla-parameter-9.c: New test.
2021-05-13 10:38:09 -06:00
Jakub Jelinek d80aeff0bf openmp: Add testcases to verify OpenMP 5.0 2.14 and OpenMP 5.1 2.17 rules [PR99928]
In preparation of PR99928 patch review, I've prepared testcases with clauses
that need more interesting handling on combined/composite constructs,
in particular firstprivate, lastprivate, firstprivate+lastprivate, linear
(explicit on non-iv, explicit on simd iv, implicit on simd iv, implicit on
simd iv declared in the construct), reduction (scalars, array sections of
array variables, array sections with pointer bases) and in_reduction.

OpenMP 5.0 had the wording broken for reduction, the intended rule to use
map(tofrom:) on target when combined with it was bound only on inscan modifier
presence which makes no sense, as then inscan may not be used, this has
been fixed in 5.1 and I'm just assuming 5.1 wording for that.

There are various cases where e.g. from historical or optimization reasons
GCC slightly deviates from the rules, but in most cases it is something
that shouldn't be really observable, e.g. whether
  #pragma omp parallel for firstprivate(x)
is handled as
  #pragma omp parallel shared(x)
  #pragma omp for firstprivate(x)
or
  #pragma omp parallel firstprivate(x)
  #pragma omp for
shouldn't be possible to distinguish in user code.  I've added FIXMEs
in the testcases about that, but maybe we just should keep it as is
(alternative would be to do it in standard compliant way and transform
into whatever we like after gimplification (e.g. early during omplower)).
Some cases we for historical reasons implement even with clauses on
constructs which in the standard don't accept them that way and then
handling those magically in omp lowering/expansion, in particular e.g.
  #pragma omp parallel for firstprivate(x) lastprivate(x)
we treat as
  #pragma omp parallel firstprivate(x) lastprivate(x)
  #pragma omp for
even when lastprivate is not valid on parallel.  Maybe one day we
could change that if we make sure we don't regress generated code quality.

I've also found a bug in OpenMP 5.0/5.1,
  #pragma omp parallel sections firstprivate(x) lastprivate(x)
incorrectly says that it should be handled as
  #pragma omp parallel firstprivate(x)
  #pragma omp sections lastprivate(x)
which when written that way results in error; filed as
https://github.com/OpenMP/spec/issues/2758
to be fixed in OpenMP 5.2.  GCC handles it the way it used to do
and users expect, so nothing to fix on the GCC side.

Also, we don't support yet in_reduction clause on target construct,
which means the -11.c testcase can't include any tests about in_reduction
handling on all the composite constructs that include target.

The work found two kinds of bugs on the GCC side, one is the known thing
that we implement still the 4.5 behavior and don't mark for
lastprivate/linear/reduction the list item as map(tofrom:) as mentioned
in PR99928.  These cases are xfailed in the tests.

And another one is with r21 and r28 in -{8,9,10}.c tests - we don't add
reduction clause on teams for
  #pragma omp {target ,}teams distribute simd reduction(+:r)
even when the spec says that teams shouldn't receive reduction only
when combined with loop construct.

In
make check-gcc check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} gomp.exp=pr99928*'
testing this shows:

  # of expected passes		5648
  # of expected failures	872

and with Tobias' patch applied:

  # of expected passes		5648
  # of unexpected successes	384
  # of expected failures	488

2021-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* c-c++-common/gomp/pr99928-1.c: New test.
	* c-c++-common/gomp/pr99928-2.c: New test.
	* c-c++-common/gomp/pr99928-3.c: New test.
	* c-c++-common/gomp/pr99928-4.c: New test.
	* c-c++-common/gomp/pr99928-5.c: New test.
	* c-c++-common/gomp/pr99928-6.c: New test.
	* c-c++-common/gomp/pr99928-7.c: New test.
	* c-c++-common/gomp/pr99928-8.c: New test.
	* c-c++-common/gomp/pr99928-9.c: New test.
	* c-c++-common/gomp/pr99928-10.c: New test.
	* c-c++-common/gomp/pr99928-11.c: New test.
2021-05-13 16:53:48 +02:00
Richard Earnshaw efd471a980 testsuite: suppress cast warnings in pr100563.c [PR100563]
Fix a warning when building on machines that don't have 32-bit pointers

gcc/testsuite:

	PR target/100563
	* gcc.dg/pr100563.c (dg-options): Add -wno-pointer-to-int-cast.
2021-05-13 15:02:46 +01:00
Martin Liska fef084dc83 mklog: Put detected PR entries before ChangeLogs
contrib/ChangeLog:

	* mklog.py: Put PR entries before all ChangeLog entries
	(will be added to all ChangeLog locations by Daily bump script).
	* test_mklog.py: Test the new behavior.
2021-05-13 15:13:31 +02:00
Richard Earnshaw a451598b2c arm: correctly handle inequality comparisons against max constants [PR100563]
Normally we expect the gimple optimizers to fold away comparisons that
are always true, but at some lower optimization levels this is not
always the case, so the back-end has to be able to generate correct
code in these cases.

In this example, we have a comparison of the form

  (unsigned long long) op <= ~0ULL

which, of course is always true.

Normally, in the arm back-end we handle these expansions where the
immediate cannot be handled directly by adding 1 to the constant and
then adjusting the comparison operator:

  (unsigned long long) op < CONST + 1

but we cannot do that when the constant is already the largest value.

Fortunately, we observe that the comparisons we need to handle this
way are either always true or always false, so instead of forming a
comparison against the maximum value, we can replace it with a
comparison against the minimum value (which just happens to also be a
constant we can handle.  So

  op1 <= ~0ULL -> op1 >= 0U
  op1 > ~0ULL -> op1 < 0U

  op1 <= LONG_LONG_INT_MAX -> op1 >= (-LONG_LONG_INT_MAX - 1)
  op1 > LONG_LONG_INT_MAX -> op1 < (-LONG_LONG_INT_MAX - 1)

gcc:
	PR target/100563
	* config/arm/arm.c (arm_canonicalize_comparison): Correctly
	canonicalize DImode inequality comparisons against the
	maximum integral value.

gcc/testsuite:
	* gcc.dg/pr100563.c: New test.
2021-05-13 11:44:45 +01:00
Jakub Jelinek 829c4bea06 ix86: Support V{2, 4}DImode arithmetic right shifts for SSE2+ [PR98856]
As mentioned in the PR, we don't support arithmetic right V2DImode or
V4DImode on x86 without -mavx512vl or -mxop.  The ISAs indeed don't have
{,v}psraq instructions until AVX512VL, but we actually can emulate it quite
easily.
One case is arithmetic >> 63, we can just emit {,v}pxor; {,v}pcmpgt for
that for SSE4.2+, or for SSE2 psrad $31; pshufd $0xf5.
Then arithmetic >> by constant > 32, that can be done with {,v}psrad $31
and {,v}psrad $(cst-32) and two operand permutation,
arithmetic >> 32 can be done as {,v}psrad $31 and permutation of that
and the original operand.  Arithmetic >> by constant < 32 can be done
as {,v}psrad $cst and {,v}psrlq $cst and two operand permutation.
And arithmetic >> by variable scalar amount can be done as
arithmetic >> 63, logical >> by the amount, << by (64 - amount of the
>> 63 result; note that the vector << 64 result in 0) and oring together.

I had to improve the permutation generation so that it actually handles
the needed permutations (or handles them better).

2021-05-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/98856
	* config/i386/i386.c (ix86_shift_rotate_cost): Add CODE argument.
	Expect V2DI and V4DI arithmetic right shifts to be emulated.
	(ix86_rtx_costs, ix86_add_stmt_cost): Adjust ix86_shift_rotate_cost
	caller.
	* config/i386/i386-expand.c (expand_vec_perm_2perm_interleave,
	expand_vec_perm_2perm_pblendv): New functions.
	(ix86_expand_vec_perm_const_1): Use them.
	* config/i386/sse.md (ashr<mode>3<mask_name>): Rename to ...
	(<mask_codefor>ashr<mode>3<mask_name>): ... this.
	(ashr<mode>3): New define_expand with VI248_AVX512BW iterator.
	(ashrv4di3): New define_expand.
	(ashrv2di3): Change condition to TARGET_SSE2, handle !TARGET_XOP
	and !TARGET_AVX512VL expansion.

	* gcc.target/i386/sse2-psraq-1.c: New test.
	* gcc.target/i386/sse4_2-psraq-1.c: New test.
	* gcc.target/i386/avx-psraq-1.c: New test.
	* gcc.target/i386/avx2-psraq-1.c: New test.
	* gcc.target/i386/avx-pr82370.c: Adjust expected number of vpsrad
	instructions.
	* gcc.target/i386/avx2-pr82370.c: Likewise.
	* gcc.target/i386/avx512f-pr82370.c: Likewise.
	* gcc.target/i386/avx512bw-pr82370.c: Likewise.
	* gcc.dg/torture/vshuf-4.inc: Add two further permutations.
	* gcc.dg/torture/vshuf-8.inc: Likewise.
2021-05-13 12:16:48 +02:00
Uros Bizjak f1693741cb i386: Fix up V2SFmode vcond* with -mxop [PR100581]
ix86_expand_sse_movcc has special TARGET_XOP handling and the recent
addition of support of v*cond* patterns for V2SFmode results in
ICEs because the expected pattern doesn't exist.  We can handle it
using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in
other TARGET_MMX_WITH_SSE support).

2021-05-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/100581
	* config/i386/i386-expand.c (ix86_expand_sse_movcc): Force mode
	sizes < 16 to a register when constructing vpcmov pattern.
	* config/i386/mmx.md (*xop_pcmov_<mode>): Use MMXMODE124 mode.

gcc/testsuite/

	PR target/100581
	* g++.target/i386/pr100581.C: New test.
2021-05-13 11:10:50 +02:00
marxin 23eb66d1d4 gcov: Use system IO buffering
gcc/ChangeLog:

	* gcov-io.c (gcov_write_block): Remove.
	(gcov_write_words): Likewise.
	(gcov_read_words): Re-implement using gcov_read_bytes.
	(gcov_allocate): Remove.
	(GCOV_BLOCK_SIZE): Likewise.
	(struct gcov_var): Remove most of the fields.
	(gcov_position): Implement with ftell.
	(gcov_rewrite): Remove setting of start and offset fields.
	(from_file): Re-format.
	(gcov_open): Remove setbuf call. It should not be needed.
	(gcov_close): Remove internal buffer handling.
	(gcov_magic): Use __builtin_bswap32.
	(gcov_write_counter): Use directly gcov_write_unsigned.
	(gcov_write_string): Use direct fwrite and do not round
	to 4 bytes.
	(gcov_seek): Use directly fseek.
	(gcov_write_tag): Use gcov_write_unsigned directly.
	(gcov_write_length): Likewise.
	(gcov_write_tag_length): Likewise.
	(gcov_read_bytes): Use directly fread.
	(gcov_read_unsigned): Use gcov_read_words.
	(gcov_read_counter): Likewise.
	(gcov_read_string): Use gcov_read_bytes.
	* gcov-io.h (GCOV_WORD_SIZE): Adjust to reflect
	that size is not in bytes, but words (4B).
	(GCOV_TAG_FUNCTION_LENGTH): Likewise.
	(GCOV_TAG_ARCS_LENGTH): Likewise.
	(GCOV_TAG_ARCS_NUM): Likewise.
	(GCOV_TAG_COUNTER_LENGTH): Likewise.
	(GCOV_TAG_COUNTER_NUM): Likewise.
	(GCOV_TAG_SUMMARY_LENGTH): Likewise.

libgcc/ChangeLog:

	* libgcov-driver.c: Fix GNU coding style.
2021-05-13 10:59:36 +02:00
Eric Botcazou c3e02c2e44 Prune another new LTO warning
gcc/testsuite/
	PR testsuite/100569
	* gnat.dg/lto21.adb: Prune new LTO warning.
2021-05-13 09:36:13 +02:00
Martin Liska 269338fe9d libsanitizer: update LOCAL_PATCHES.
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Update to the corresponding revision.
2021-05-13 09:30:05 +02:00
Martin Liska fb73b1ce36 libsanitizer: Apply local patches. 2021-05-13 09:29:50 +02:00
Martin Liska d0fee87e0c libsanitizer: merge from master
Merged revision: f58e0513dd95944b81ce7a6e7b49ba656de7d75f
2021-05-13 09:29:17 +02:00
Martin Liska 810afb0b5f testsuite: prune new LTO warning
libgomp/ChangeLog:

	PR testsuite/100569
	* testsuite/libgomp.c/omp-nested-3.c: Prune new LTO warning.
	* testsuite/libgomp.c/pr46032-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c: Likewise.

gcc/testsuite/ChangeLog:

	PR testsuite/100569
	* gcc.dg/atomic/c11-atomic-exec-2.c: Prune new LTO warning.
	* gcc.dg/torture/pr94947-1.c: Likewise.
2021-05-13 09:24:23 +02:00
liuhongt 0ffdbc85d9 Fix typo in testcase.
gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx-pr94680.c: Fix typo in testcase.
2021-05-13 13:44:30 +08:00
liuhongt 94de7e225c Optimize __builtin_shuffle when it's used to zero the upper bits of the dest. [PR target/94680]
If the second operand of __builtin_shuffle is const vector 0, and with
specific mask, it can be optimized to movq/vmovps.

.i.e.
foo128:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vmovlhps        %xmm1, %xmm0, %xmm0
+       vmovq   %xmm0, %xmm0

 foo256:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vshuff32x4      $0, %ymm1, %ymm0, %ymm0
+       vmovaps %xmm0, %xmm0

 foo512:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vshuff32x4      $68, %zmm1, %zmm0, %zmm0
+       vmovaps %ymm0, %ymm0

gcc/ChangeLog:

	PR target/94680
	* config/i386/sse.md (ssedoublevecmode): Add attribute for
	V64QI/V32HI/V16SI/V4DI.
	(ssehalfvecmode): Add attribute for V2DI/V2DF.
	(*vec_concatv4si_0): Extend to VI124_128.
	(*vec_concat<mode>_0): New pre-reload splitter.
	* config/i386/predicates.md (movq_parallel): New predicate.

gcc/testsuite/ChangeLog:

	PR target/94680
	* gcc.target/i386/avx-pr94680.c: New test.
	* gcc.target/i386/avx512f-pr94680.c: New test.
	* gcc.target/i386/sse2-pr94680.c: New test.
2021-05-13 08:41:36 +08:00
GCC Administrator 0ff3a0f2b9 Daily bump. 2021-05-13 00:16:29 +00:00
Alexandre Oliva 56b9b60464 retry zero-call-used-regs from zeroed regs
default_zero_call_used_regs currently requires all potentially zeroed
registers to offer a move opcode that accepts zero as an operand.

This is not the case e.g. for ARM's r12/ip in Thumb mode, and it was
not the case of FP registers on AArch64 as of GCC 10.

This patch introduces a fallback strategy to zero out registers,
copying from registers that have already been zeroed.  Adjacent
sources to make up wider modes are also supported.

This does not guarantee that there will be some zeroed-out register to
use as the source, but it expands the cases in which the default
implementation works out of the box.


for  gcc/ChangeLog

	* targhooks.c (default_zero_call_used_regs): Retry using
	successfully-zeroed registers as sources.
2021-05-12 21:05:26 -03:00
Tobias Burnus d21963ce7a OpenMP: detach - fix firstprivate handling
gcc/ChangeLog:

	* omp-low.c (finish_taskreg_scan): Use the proper detach decl.

libgomp/ChangeLog:

	* testsuite/libgomp.c-c++-common/task-detach-12.c: New test.
	* testsuite/libgomp.fortran/task-detach-12.f90: New test.
2021-05-13 00:14:34 +02:00
Martin Sebor db514f98a3 Add test for PR middle-end/100571.
gcc/testsuite:
	PR middle-end/100571
	* gcc.dg/Wstringop-overflow-67.c: New test.
2021-05-12 15:59:19 -06:00
Aldy Hernandez d902a1b576 Skip out on processing __builtin_clz when varying.
The previous changes to irange::constant_p return TRUE for
VARYING, since VARYING has numerical end points like any other
constant range.  The problem is that some users of constant_p
depended on constant_p excluding the full domain.  The
range handler for __builtin_clz, that is shared between ranger
and vr_values, is one such user.

This patch excludes varying_p(), to match the original behavior
for clz.

gcc/ChangeLog:

	PR c/100521
	* gimple-range.cc (range_of_builtin_call): Skip out on
	  processing __builtin_clz when varying.
2021-05-12 16:46:58 -04:00
Marcel Vollweiler 8982a5354d MAINTAINERS: Add myself for write after approval
ChangeLog:

2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>

	* MAINTAINERS (Write After Approval): Add myself.
2021-05-12 10:28:31 -07:00
Marek Polacek 3a2b12bc5a c++: Disable -Wint-in-bool-context in instantiations
This warning is of questionable value when it's emitted when
instantiating a template, as in the following testcase.  It could be
silenced by writing hb(i) << 1 instead of 2 * hb(i) but that's
unnecessary obfuscation.

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
	sentinel.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wint-in-bool-context-2.C: New test.
2021-05-12 13:06:28 -04:00
Marcel Vollweiler fa6894ec9c OpenMP: Add support for 'close' in map clause
gcc/c/ChangeLog:

	* c-parser.c (c_parser_omp_clause_map): Support map-type-modifier
	'close'.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_omp_clause_map): Support map-type-modifier
	'close'.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/map-6.c: New test.
	* c-c++-common/gomp/map-7.c: New test.
2021-05-12 09:57:55 -07:00
Tom de Vries 2a1586401a [nvptx] Add -mptx=3.1/6.3
Add nvptx option -mptx that sets the ptx ISA version.  This is currently
hardcoded to 3.1.

Tested libgomp on x86_64-linux with nvptx accelerator, both with default set to
3.1 and 6.3.

gcc/ChangeLog:

2021-05-12  Tom de Vries  <tdevries@suse.de>

	PR target/96005
	* config/nvptx/nvptx-opts.h (enum ptx_version): New enum.
	* config/nvptx/nvptx.c (nvptx_file_start): Print .version according
	to ptx_version_option.
	* config/nvptx/nvptx.h (TARGET_PTX_6_3): Define.
	* config/nvptx/nvptx.md (define_insn "nvptx_shuffle<mode>")
	(define_insn "nvptx_vote_ballot"): Use sync variant for
	TARGET_PTX_6_3.
	* config/nvptx/nvptx.opt (ptx_version): Add enum.
	(mptx): Add option.
	* doc/invoke.texi (Nvidia PTX Options): Add mptx item.
2021-05-12 18:37:07 +02:00
Richard Biener 097fde5e75 tree-optimization/100566 - fix another predication issue in VN
This amends the fix for PR100053 where I failed to amend all edge
tests in dominated_by_p_w_unex.

2021-05-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/100566
	* tree-ssa-sccvn.c (dominated_by_p_w_unex): Properly handle
	allow_back for all edge queries.

	* gcc.dg/torture/pr100566.c: New testcase.
2021-05-12 17:01:32 +02:00
Jonathan Wakely d1adbe5c1b libstdc++: Fix some problems in PSTL tests
libstdc++-v3/ChangeLog:

	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc:
	Increase dg-timeout-factor to 4. Fix -Wunused-parameter
	warnings. Replace bitwise AND with logical AND in loop
	condition.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc:
	Replace bitwise AND with logical AND in loop condition.
	* testsuite/util/pstl/test_utils.h: Remove unused parameter
	names.
2021-05-12 14:51:15 +01:00
Jakub Jelinek c6b664e2c4 libcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline [PR100392]
If a header doesn't end with a new-line, with -fdirectives-only we right now
preprocess it as
int i = 1;# 2 "pr100392.c" 2
i.e. the line directive isn't on the next line, which means we fail to parse
it when compiling.

GCC 10 and earlier libcpp/directives-only.c had for this:
  if (!pfile->state.skipping && cur != base)
    {
      /* If the file was not newline terminated, add rlimit, which is
         guaranteed to point to a newline, to the end of our range.  */
      if (cur[-1] != '\n')
        {
          cur++;
          CPP_INCREMENT_LINE (pfile, 0);
          lines++;
        }

      cb->print_lines (lines, base, cur - base);
    }
and we have the assertion
      /* Files always end in a newline or carriage return.  We rely on this for
         character peeking safety.  */
      gcc_assert (buffer->rlimit[0] == '\n' || buffer->rlimit[0] == '\r');
So, this patch just does readd the more less same thing, so that we emit
a newline after the inline even when it wasn't there before.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/100392
	* lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
	add buffer->rlimit[0] character to the printed range and
	CPP_INCREMENT_LINE and increment line_count.

	* gcc.dg/cpp/pr100392.c: New test.
	* gcc.dg/cpp/pr100392.h: New file.
2021-05-12 15:14:35 +02:00
Martin Liska fc186594e3 lto-wrapper: silent warnings in tests
Silents the following warning:
lto-wrapper: warning: using serial compilation of 2 LTRANS jobs

gcc/testsuite/ChangeLog:

	* lib/lto.exp: When running tests without jobserver, one can see
	the following warning for tests that use 1to1 partitioning.
2021-05-12 14:18:04 +02:00
liuhongt 8da3b309d8 i386: Optimize vpblendvb on inverted mask register to vpblendvb on swapping the order of operand 1 and operand 2. [PR target/99908]
-       vpcmpeqd        %ymm3, %ymm3, %ymm3
-       vpandn  %ymm3, %ymm2, %ymm2
-       vpblendvb       %ymm2, %ymm1, %ymm0, %ymm0
+       vpblendvb       %ymm2, %ymm0, %ymm1, %ymm0

gcc/ChangeLog:

	PR target/99908
	* config/i386/sse.md (<sse4_1_avx2>_pblendvb): Add
	splitters for pblendvb of NOT mask register.

gcc/testsuite/ChangeLog:

	PR target/99908
	* gcc.target/i386/avx2-pr99908.c: New test.
	* gcc.target/i386/sse4_1-pr99908.c: New test.
2021-05-12 19:44:13 +08:00
Richard Biener cd36bbb228 tree-optimization/100519 - avoid reassociating asm goto defs
This splits can_associate_p into checks for SSA defs and checks
for the type so it can be called from is_reassociable_op to
catch cases not catched by the earlier fix.

2021-05-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/100519
	* tree-ssa-reassoc.c (can_associate_p): Split into...
	(can_associate_op_p): ... this
	(can_associate_type_p): ... and this.
	(is_reassociable_op): Call can_associate_op_p.
	(break_up_subtract_bb): Call the appropriate predicates.
	(reassociate_bb): Likewise.

	* gcc.dg/torture/pr100519.c: New testcase.
2021-05-12 13:12:46 +02:00