]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
4 years agolibstdc++: Add missing P0896 changes to <iterator>
Patrick Palka [Fri, 2 Oct 2020 14:51:31 +0000 (10:51 -0400)] 
libstdc++: Add missing P0896 changes to <iterator>

I noticed that the following changes from this paper were not yet
implemented.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (reverse_iterator::iter_move):
Define for C++20 as per P0896.
(reverse_iterator::iter_swap): Likewise.
(move_iterator::operator*): Apply P0896 changes for C++20.
(move_iterator::operator[]): Likewise.
* testsuite/24_iterators/reverse_iterator/cust.cc: New test.

(cherry picked from commit 080a23bce12fa3f25860631f019777f728d2ef11)

4 years agoBackport fix for PR/tree-optimization/97236 - fix bad use of VMAT_CONTIGUOUS
Matthias Klose [Tue, 6 Oct 2020 11:41:37 +0000 (13:41 +0200)] 
Backport fix for PR/tree-optimization/97236 - fix bad use of VMAT_CONTIGUOUS

This avoids using VMAT_CONTIGUOUS with single-element interleaving
when using V1mode vectors.  Instead keep VMAT_ELEMENTWISE but
continue to avoid load-lanes and gathers.

2020-10-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97236
* tree-vect-stmts.c (get_group_load_store_type): Keep
VMAT_ELEMENTWISE for single-element vectors.

* gcc.dg/vect/pr97236.c: New testcase.

4 years agoconfigure: Fix in-tree building of GMP on BSD [PR97302]
Tobias Burnus [Tue, 6 Oct 2020 09:49:34 +0000 (11:49 +0200)] 
configure: Fix in-tree building of GMP on BSD [PR97302]

ChangeLog:
PR target/97302
* configure.ac: Only set with_gmp to /usr/local
if not building in tree.
* configure: Regenerate.
(cherry picked from commit c0d0a722da8583f74a0c192041be2f379cf487c1)

4 years agoIBM Z: Doc: Add z15/arch13 to the list of -march/-mtune options
Andreas Krebbel [Tue, 6 Oct 2020 05:56:51 +0000 (07:56 +0200)] 
IBM Z: Doc: Add z15/arch13 to the list of -march/-mtune options

gcc/ChangeLog:

* doc/invoke.texi: Add z15/arch13 to the list of documented
-march/-mtune options.

(cherry picked from commit d2364fb436ff64a4c5293b697f37d53fd58a9f54)

4 years agoIBM Z: Fix PR96456
Andreas Krebbel [Wed, 12 Aug 2020 06:02:34 +0000 (08:02 +0200)] 
IBM Z: Fix PR96456

The testcase failed because our backend refuses to generate vector
compare instructions for signaling operators with -fno-trapping-math
-fno-finite-math-only.

gcc/ChangeLog:

PR target/96456
* config/s390/s390.h (TARGET_NONSIGNALING_VECTOR_COMPARE_OK): New
macro.
* config/s390/vector.md (vcond_comparison_operator): Use new macro
for the check.

gcc/testsuite/ChangeLog:

PR target/96456
* gcc.target/s390/pr96456.c: New test.

(cherry picked from commit 1d17c38ac1d1d916abbce14e6b2e0d61517c6e9b)

4 years agoDaily bump.
GCC Administrator [Tue, 6 Oct 2020 00:17:01 +0000 (00:17 +0000)] 
Daily bump.

4 years agoarm: Add missing part number for Neoverse V1
Alex Coplan [Mon, 5 Oct 2020 12:47:51 +0000 (13:47 +0100)] 
arm: Add missing part number for Neoverse V1

This patch adds vendor and part numbers which were missing from the
initial entry for Neoverse V1 in AArch32 GCC.

gcc/ChangeLog:

* config/arm/arm-cpus.in (neoverse-v1): Add missing vendor and
part numbers.

4 years agoc++: Fix up default initialization with consteval default ctor [PR96994]
Jakub Jelinek [Thu, 1 Oct 2020 09:18:35 +0000 (11:18 +0200)] 
c++: Fix up default initialization with consteval default ctor [PR96994]

> > The following testcase is miscompiled (in particular the a and i
> > initialization).  The problem is that build_special_member_call due to
> > the immediate constructors (but not evaluated in constant expression mode)
> > doesn't create a CALL_EXPR, but returns a TARGET_EXPR with CONSTRUCTOR
> > as the initializer for it,
>
> That seems like the bug; at the end of build_over_call, after you
>
> >        call = cxx_constant_value (call, obj_arg);
>
> You need to build an INIT_EXPR if obj_arg isn't a dummy.

That works.  obj_arg is NULL if it is a dummy from the earlier code.

2020-10-01  Jakub Jelinek  <jakub@redhat.com>

PR c++/96994
* call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
setting obj_arg to call.

* g++.dg/cpp2a/consteval18.C: New test.

(cherry picked from commit 56da736cc6ced0f1c339744321a14ae569db8606)

4 years agoc++: Handle std::construct_at on automatic vars during constant evaluation [PR97195]
Jakub Jelinek [Thu, 1 Oct 2020 09:16:44 +0000 (11:16 +0200)] 
c++: Handle std::construct_at on automatic vars during constant evaluation [PR97195]

As mentioned in the PR, we only support due to a bug in constant expressions
std::construct_at on non-automatic variables, because we VERIFY_CONSTANT the
second argument of placement new, which fails verification if it is an
address of an automatic variable.
The following patch fixes it by not performing that verification, the
placement new evaluation later on will verify it after it is dereferenced.

2020-10-01  Jakub Jelinek  <jakub@redhat.com>

PR c++/97195
* constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
second argument.

* g++.dg/cpp2a/constexpr-new14.C: New test.

(cherry picked from commit 2805fcb32660bc0cdcd5ba54310f1f02651e039f)

4 years agopowerpc, libcpp: Fix gcc build with clang on power8 [PR97163]
Jakub Jelinek [Sat, 26 Sep 2020 08:07:41 +0000 (10:07 +0200)] 
powerpc, libcpp: Fix gcc build with clang on power8 [PR97163]

libcpp has two specialized altivec implementations of search_line_fast,
one for power8+ and the other one otherwise.
Both use __attribute__((altivec(vector))) and the GCC builtins rather than
altivec.h and the APIs from there, which is fine, but should be restricted
to when libcpp is built with GCC, so that it can be relied on.
The second elif is
and thus e.g. when built with clang it isn't picked, but the first one was
just guarded with
and so according to the bugreporter clang fails miserably on that.

The following patch fixes that by adding the same GCC_VERSION requirement
as the second version.  I don't know where the 4.5 in there comes from and
the exact version doesn't matter that much, as long as it is above 4.2 that
clang pretends to be and smaller or equal to 4.8 as the oldest gcc we
support as bootstrap compiler ATM.
Furthermore, the patch fixes the comment, the version it is talking about is
not pre-GCC 5, but actually the GCC 5+ one.

2020-09-26  Jakub Jelinek  <jakub@redhat.com>

PR bootstrap/97163
* lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
for GCC >= 4.5.

(cherry picked from commit d00b1b023ecfc3ddc3fe952c0063dab7529d5f7a)

4 years agoc++: Ignore __sanitizer_ptr_{sub,cmp} builtin calls during constant expression evalua...
Jakub Jelinek [Tue, 22 Sep 2020 19:06:32 +0000 (21:06 +0200)] 
c++: Ignore __sanitizer_ptr_{sub,cmp} builtin calls during constant expression evaluation [PR97145]

These two builtin calls are added already during parsing before pointer
subtractions or comparisons, normally they perform runtime verification
of whether the pointers point to the same object or different objects,
but during constant expressione valuation we don't really need those
builtins for anything.

2020-09-22  Jakub Jelinek  <jakub@redhat.com>

PR c++/97145
* constexpr.c (cxx_eval_builtin_function_call): Return void_node for
calls to __sanitize_ptr_{sub,cmp} builtins.

* g++.dg/asan/pr97145.C: New test.

(cherry picked from commit bc13106e0414b86af8f6878e7681e6a959921b9e)

4 years agoDaily bump.
GCC Administrator [Mon, 5 Oct 2020 00:16:53 +0000 (00:16 +0000)] 
Daily bump.

4 years agoDaily bump.
GCC Administrator [Sun, 4 Oct 2020 00:16:56 +0000 (00:16 +0000)] 
Daily bump.

4 years agoDaily bump.
GCC Administrator [Sat, 3 Oct 2020 00:17:01 +0000 (00:17 +0000)] 
Daily bump.

4 years agoarm: Add support for Neoverse N2 CPU
Alex Coplan [Fri, 2 Oct 2020 15:06:15 +0000 (16:06 +0100)] 
arm: Add support for Neoverse N2 CPU

This patch backports the AArch32 support for Arm's Neoverse N2 CPU to
GCC 10.

gcc/ChangeLog:

* config/arm/arm-cpus.in (neoverse-n2): New.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* doc/invoke.texi: Document support for Neoverse N2.

4 years agoAArch64: Add neoversev1_tunings struct
Kyrylo Tkachov [Fri, 2 Oct 2020 14:23:19 +0000 (15:23 +0100)] 
AArch64: Add neoversev1_tunings struct

This patch adds a Neoverse V1-specific tuning struct that currently is
just a deduplication of the N1 struct it was using before and specifying
the SVE width.
This will allow us to tweak Neoverse V1 things in the future as needed.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
* config/aarch64/aarch64.c (neoversev1_tunings): Define.
* config/aarch64/aarch64-cores.def (zeus): Use it.
(neoverse-v1): Likewise.

(cherry picked from commit c8c77ed747abb61a7f3cf34f71539bc87a5d6c3c)

4 years agogcov: fix TOPN streaming from shared libraries
Sergei Trofimovich [Sun, 6 Sep 2020 11:13:54 +0000 (12:13 +0100)] 
gcov: fix TOPN streaming from shared libraries

Before the change gcc did not stream correctly TOPN counters
if counters belonged to a non-local shared object.

As a result zero-section optimization generated TOPN sections
in a form not recognizable by '__gcov_merge_topn'.

The problem happens because in a case of multiple shared objects
'__gcov_merge_topn' function is present in address space multiple
times (once per each object).

The fix is to never rely on function address and predicate on TOPN
counter types.

libgcc/ChangeLog:

PR gcov-profile/96913
* libgcov-driver.c (write_one_data): Avoid function pointer
comparison in TOP streaming decision.

(cherry picked from commit 4ecf368f4b4223fb2df4f3887429dfbb48852e38)

4 years agoGCOV: do not mangle .gcno files.
Martin Liska [Fri, 25 Sep 2020 08:53:26 +0000 (10:53 +0200)] 
GCOV: do not mangle .gcno files.

gcc/ChangeLog:

PR gcov-profile/97193
* coverage.c (coverage_init): GCDA note files should not be
mangled and should end in output directory.

(cherry picked from commit f8dcbea5d2fb17dca3a7de97f15fc49997222365)

4 years agoDaily bump.
GCC Administrator [Fri, 2 Oct 2020 00:17:05 +0000 (00:17 +0000)] 
Daily bump.

4 years agocompiler: set varargs correctly for type of method expression
Ian Lance Taylor [Thu, 1 Oct 2020 22:11:22 +0000 (15:11 -0700)] 
compiler: set varargs correctly for type of method expression

Fixes golang/go#41737

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/258977

4 years agogcov: fix streaming of HIST_TYPE_IOR histogram type.
Martin Liska [Fri, 25 Sep 2020 14:21:34 +0000 (16:21 +0200)] 
gcov: fix streaming of HIST_TYPE_IOR histogram type.

gcc/ChangeLog:

PR gcov-profile/64636
* value-prof.c (stream_out_histogram_value): Allow negative
values for HIST_TYPE_IOR.

(cherry picked from commit 1921ebcaf6467996aede69e1bbe32400d8a20fe7)

4 years agoswitch conversion: make a rapid speed up
Martin Liska [Thu, 24 Sep 2020 11:34:13 +0000 (13:34 +0200)] 
switch conversion: make a rapid speed up

gcc/ChangeLog:

PR tree-optimization/96979
* tree-switch-conversion.c (jump_table_cluster::can_be_handled):
Make a fast bail out.
(bit_test_cluster::can_be_handled): Likewise here.
* tree-switch-conversion.h (get_range): Use wi::to_wide instead
of a folding.

gcc/testsuite/ChangeLog:

PR tree-optimization/96979
* g++.dg/tree-ssa/pr96979.C: New test.

(cherry picked from commit e46858e4eeee45d35ca4a7df1996186fe884879b)

4 years agogcov: fix streaming corruption
Martin Liska [Mon, 21 Sep 2020 14:26:10 +0000 (16:26 +0200)] 
gcov: fix streaming corruption

gcc/ChangeLog:

PR gcov-profile/97069
* profile.c (branch_prob): Line number must be at least 1.

gcc/testsuite/ChangeLog:

PR gcov-profile/97069
* g++.dg/gcov/pr97069.C: New test.

(cherry picked from commit 6b4e8bf88f1172ce8561f57b12fb81063b21a78f)

4 years agoconfig/i386/t-rtems: Change from mtune to march for multilibs
Michael Davidsaver [Thu, 1 Oct 2020 15:16:08 +0000 (10:16 -0500)] 
config/i386/t-rtems: Change from mtune to march for multilibs

* config/i386/t-rtems: Change from mtune to march when building
multilibs.  The mtune argument tunes or optimizes for a specific
CPU model but does not ensure the generated code is appropriate
for the CPU model. Prior to this patch, i386 compatible code
was always generated but tuned for later models.

4 years agoAdd a testcase for PR target/96827
H.J. Lu [Wed, 30 Sep 2020 15:13:21 +0000 (08:13 -0700)] 
Add a testcase for PR target/96827

Add a testcase for PR target/96827 which was fixed by r11-3559:

commit 97b798d80baf945ea28236eef3fa69f36626b579
Author: Joel Hutton <joel.hutton@arm.com>
Date:   Wed Sep 30 15:08:13 2020 +0100

    [SLP][VECT] Add check to fix 96837

PR target/96827
* gcc.target/i386/pr96827.c: New test.

(cherry picked from commit 373b99dc40949efa697326f378e5022a02e0328b)

4 years agoarm: Fix MVE intrinsics polymorphic variants wrongly generating __ARM_undef type...
Srinath Parvathaneni [Wed, 30 Sep 2020 14:19:17 +0000 (15:19 +0100)] 
arm: Fix MVE intrinsics polymorphic variants wrongly generating __ARM_undef type (pr96795).

This patch fixes (PR96795) MVE intrinsic polymorphic variants vaddq, vaddq_m, vaddq_x, vcmpeqq_m,
vcmpeqq, vcmpgeq_m, vcmpgeq, vcmpgtq_m, vcmpgtq, vcmpleq_m, vcmpleq, vcmpltq_m, vcmpltq,
vcmpneq_m, vcmpneq, vfmaq_m, vfmaq, vfmasq_m, vfmasq, vmaxnmavq, vmaxnmavq_p, vmaxnmvq,
vmaxnmvq_p, vminnmavq, vminnmavq_p, vminnmvq, vminnmvq_p, vmulq_m, vmulq, vmulq_x, vsetq_lane,
vsubq_m, vsubq and vsubq_x which are incorrectly generating __ARM_undef and mismatching the passed
floating point scalar arguments.

Bootstrapped on arm-none-linux-gnueabihf and regression tested on arm-none-eabi and found no regressions.

gcc/ChangeLog:

2020-09-30  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

PR target/96795
* config/arm/arm_mve.h (__ARM_mve_coerce2): Define.
(__arm_vaddq): Correct the scalar argument.
(__arm_vaddq_m): Likewise.
(__arm_vaddq_x): Likewise.
(__arm_vcmpeqq_m): Likewise.
(__arm_vcmpeqq): Likewise.
(__arm_vcmpgeq_m): Likewise.
(__arm_vcmpgeq): Likewise.
(__arm_vcmpgtq_m): Likewise.
(__arm_vcmpgtq): Likewise.
(__arm_vcmpleq_m): Likewise.
(__arm_vcmpleq): Likewise.
(__arm_vcmpltq_m): Likewise.
(__arm_vcmpltq): Likewise.
(__arm_vcmpneq_m): Likewise.
(__arm_vcmpneq): Likewise.
(__arm_vfmaq_m): Likewise.
(__arm_vfmaq): Likewise.
(__arm_vfmasq_m): Likewise.
(__arm_vfmasq): Likewise.
(__arm_vmaxnmavq): Likewise.
(__arm_vmaxnmavq_p): Likewise.
(__arm_vmaxnmvq): Likewise.
(__arm_vmaxnmvq_p): Likewise.
(__arm_vminnmavq): Likewise.
(__arm_vminnmavq_p): Likewise.
(__arm_vminnmvq): Likewise.
(__arm_vminnmvq_p): Likewise.
(__arm_vmulq_m): Likewise.
(__arm_vmulq): Likewise.
(__arm_vmulq_x): Likewise.
(__arm_vsetq_lane): Likewise.
(__arm_vsubq_m): Likewise.
(__arm_vsubq): Likewise.
(__arm_vsubq_x): Likewise.

gcc/testsuite/ChangeLog:

PR target/96795
* gcc.target/arm/mve/intrinsics/mve_fp_vaddq_n.c: New Test.
* gcc.target/arm/mve/intrinsics/mve_vaddq_n.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddq_x_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddq_x_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpeqq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpeqq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgeq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgeq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgtq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgtq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpleq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpleq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpltq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpltq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpneq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpneq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmaq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmaq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmaq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmaq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmasq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmasq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmasq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vfmasq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_x_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmulq_x_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsetq_lane_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsetq_lane_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_m_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_m_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_n_f32-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_x_n_f16-1.c: Likewise.
* gcc.target/arm/mve/intrinsics/vsubq_x_n_f32-1.c: Likewise.

(cherry picked from commit 6bd4ce64eb48a72eca300cb52773e6101d646004)

4 years agos390: Fix up s390_atomic_assign_expand_fenv
Jakub Jelinek [Thu, 1 Oct 2020 09:04:56 +0000 (11:04 +0200)] 
s390: Fix up s390_atomic_assign_expand_fenv

The following patch fixes
-FAIL: gcc.dg/pr94780.c (internal compiler error)
-FAIL: gcc.dg/pr94780.c (test for excess errors)
-FAIL: gcc.dg/pr94842.c (internal compiler error)
-FAIL: gcc.dg/pr94842.c (test for excess errors)
on s390x-linux.  The fix is essentially the same as has been applied to many
other targets (i386, aarch64, arm, rs6000, alpha, riscv).

2020-10-01  Jakub Jelinek  <jakub@redhat.com>

* config/s390/s390.c (s390_atomic_assign_expand_fenv): Use
TARGET_EXPR instead of MODIFY_EXPR for the first assignments to
fenv_var and old_fpc.  Formatting fixes.

(cherry picked from commit 85516b71730d8f9401c34407ac3fadf5f1ebfc4e)

4 years ago[SLP][VECT] Add check to fix 96827
Joel Hutton [Wed, 30 Sep 2020 15:20:55 +0000 (16:20 +0100)] 
[SLP][VECT] Add check to fix 96827

The following patch adds a simple check to prevent slp stmts from
vector constructors being rearranged. vect_attempt_slp_rearrange_stmts
tries to rearrange to avoid a load permutation.

This fixes PR target/96827
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96827

gcc/ChangeLog:

2020-09-29  Joel Hutton  <joel.hutton@arm.com>

PR target/96827
* tree-vect-slp.c (vect_analyze_slp): Do not call
vect_attempt_slp_rearrange_stmts for vector constructors.

gcc/testsuite/ChangeLog:

2020-09-29  Joel Hutton  <joel.hutton@arm.com>

PR target/96827
* gcc.dg/vect/bb-slp-49.c: New test.

(cherry picked from commit 97b798d80baf945ea28236eef3fa69f36626b579)

4 years agoDaily bump.
GCC Administrator [Thu, 1 Oct 2020 00:17:04 +0000 (00:17 +0000)] 
Daily bump.

4 years agoFix build failure with zstd versio9n 1.2.0 or older.
Jim Wilson [Wed, 30 Sep 2020 20:06:28 +0000 (13:06 -0700)] 
Fix build failure with zstd versio9n 1.2.0 or older.

Extends the configure check for zstd.h to also verify the zstd version,
since gcc requires features that only exist in 1.3.0 and newer.  Without
this patch we get a build error for lto-compress.c when using an old zstd
version.

Backported from master:
2020-09-29  Jim Wilson  <jimw@sifive.com>

gcc/
PR bootstrap/97183
* configure.ac (gcc_cv_header_zstd_h): Check ZSTD_VERISON_NUMBER.
* configure: Regenerated.

4 years agoAArch64: Add Linux cpuinfo string for rng feature
Kyrylo Tkachov [Fri, 25 Sep 2020 16:32:43 +0000 (17:32 +0100)] 
AArch64: Add Linux cpuinfo string for rng feature

The Linux kernel has defined the cpuinfo string for the +rng feature, so
this patch adds that to GCC so that -march=native can pick it up.
Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
* config/aarch64/aarch64-option-extensions.def (rng): Add
cpuinfo string.

(cherry picked from commit 0d8f3f612d662ea3007c184a11ea5eb7d58760e7)

4 years agox86: Use SET operation in MOVDIRI and MOVDIR64B
H.J. Lu [Wed, 23 Sep 2020 19:11:45 +0000 (12:11 -0700)] 
x86: Use SET operation in MOVDIRI and MOVDIR64B

Since MOVDIRI and MOVDIR64B write to memory, similar to UNSPEC_MOVNT,
use SET operation in MOVDIRI and MOVDIR64B patterns with UNSPEC instead
of UNSPECV.

gcc/

PR target/97184
* config/i386/i386.md (UNSPECV_MOVDIRI): Renamed to ...
(UNSPEC_MOVDIRI): This.
(UNSPECV_MOVDIR64B): Renamed to ...
(UNSPEC_MOVDIR64B): This.
(movdiri<mode>): Use SET operation.
(@movdir64b_<mode>): Likewise.

gcc/testsuite/

PR target/97184
* gcc.target/i386/movdir64b.c: New test.
* gcc.target/i386/movdiri32.c: Likewise.
* gcc.target/i386/movdiri64.c: Likewise.
* lib/target-supports.exp (check_effective_target_movdir): New.

(cherry picked from commit 5521e8a629f8bee3a7778d69521d857496556d1f)

4 years agoDaily bump.
GCC Administrator [Wed, 30 Sep 2020 00:17:04 +0000 (00:17 +0000)] 
Daily bump.

4 years agox86: Replace <enqcmdntrin.h> with <enqcmdintrin.h>
H.J. Lu [Tue, 29 Sep 2020 18:40:46 +0000 (11:40 -0700)] 
x86: Replace <enqcmdntrin.h> with <enqcmdintrin.h>

Fix 2 typos in config/i386/enqcmdintrin.h by replacing <enqcmdntrin.h>
with <enqcmdintrin.h>:

[hjl@gnu-cfl-2 x86-gcc]$ echo "#include <enqcmdintrin.h>" | gcc -S -o /dev/null -x c -
In file included from <stdin>:1:
/usr/lib/gcc/x86_64-redhat-linux/10/include/enqcmdintrin.h:25:3: error: #error "Never use <enqcmdntrin.h> directly; include <x86intrin.h> instead."
   25 | # error "Never use <enqcmdntrin.h> directly; include <x86intrin.h> instead."
      |   ^~~~~
[hjl@gnu-cfl-2 x86-gcc]$

and _ENQCMDINTRIN_H_INCLUDED with _ENQCMDINTRIN_H_INCLUDED.

gcc/

PR target/97247
* config/i386/enqcmdintrin.h: Replace <enqcmdntrin.h> with
<enqcmdintrin.h>.  Replace _ENQCMDNTRIN_H_INCLUDED with
_ENQCMDINTRIN_H_INCLUDED.

(cherry picked from commit dec881f85abbddc6e37630b6e61ce621cea6acd7)

4 years agoAdd missing FSF copyright notes for x86 intrinsic headers.
Hongyu Wang [Mon, 28 Sep 2020 22:22:28 +0000 (22:22 +0000)] 
Add missing FSF copyright notes for x86 intrinsic headers.

gcc/ChangeLog:

PR target/97231
* config/i386/avx512vp2intersectintrin.h: Add FSF copyright notes.
* config/i386/avx512vp2intersectvlintrin.h: Ditto.
* config/i386/pconfigintrin.h: Ditto.
* config/i386/wbnoinvdintrin.h: Ditto.

(cherry picked from commit d68f4d2ecb8ed6781e4e535d2abc498b1674d68a)

4 years agoaarch64: Add support for Neoverse N2 CPU
Alex Coplan [Tue, 29 Sep 2020 16:09:09 +0000 (17:09 +0100)] 
aarch64: Add support for Neoverse N2 CPU

This patch backports the AArch64 support for Arm's Neoverse N2 CPU to
GCC 10.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def: Add Neoverse N2.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi: Document AArch64 support for Neoverse N2.

4 years agoira: Fix elimination for global hard FPs [PR97054]
Richard Sandiford [Fri, 18 Sep 2020 15:55:45 +0000 (16:55 +0100)] 
ira: Fix elimination for global hard FPs [PR97054]

If the hard frame pointer is being used as a global register,
we should skip the usual handling for eliminations.  As the
comment says, the register cannot in that case be eliminated
(or eliminated to) and is already marked live where appropriate.

Doing this removes the duplicate error for gcc.target/i386/pr82673.c.
The “cannot be used in 'asm' here” message is meant to be for asm
statements rather than register asms, and the function that the
error is reported against doesn't use asm.

gcc/
2020-09-18  Richard Sandiford  <richard.sandiford@arm.com>

PR middle-end/97054
* ira.c (ira_setup_eliminable_regset): Skip the special elimination
handling of the hard frame pointer if the hard frame pointer is fixed.

gcc/testsuite/
2020-09-18  H.J. Lu  <hjl.tools@gmail.com>
    Richard Sandiford  <richard.sandiford@arm.com>

PR middle-end/97054
* g++.target/i386/pr97054.C: New test.
* gcc.target/i386/pr82673.c: Remove redundant extra message.

(cherry picked from commit 3c7c5f1d4a4b8328fb4c07483cdbfe4ea7762155)

4 years agoarm: Fix canary address calculation for non-PIC
Richard Sandiford [Tue, 29 Sep 2020 10:22:07 +0000 (11:22 +0100)] 
arm: Fix canary address calculation for non-PIC

For non-PIC, the stack protector patterns did:

  rtx mem = XEXP (force_const_mem (SImode, operands[1]), 0);
  emit_move_insn (operands[2], mem);

Here, operands[1] is the address of the canary (&__stack_chk_guard)
and operands[2] is the register that we want to move that address into.
However, the code above instead sets operands[2] to the address of a
constant pool entry that contains &__stack_chk_guard, rather than to
&__stack_chk_guard itself.  The sequence therefore does one less
pointer indirection than it should.

The net effect was to use &__stack_chk_guard for stack-smash detection,
instead of using __stack_chk_guard itself.

gcc/
* config/arm/arm.md (*stack_protect_combined_set_insn): For non-PIC,
load the address of the canary rather than the address of the
constant pool entry that points to it.
(*stack_protect_combined_test_insn): Likewise.

gcc/testsuite/
* gcc.target/arm/stack-protector-3.c: New test.
* gcc.target/arm/stack-protector-4.c: Likewise.

(cherry picked from commit e94797250b403d66cb3624a594e41faf0dd76617)

4 years agoaarch64: Prevent canary address being spilled to stack
Richard Sandiford [Tue, 29 Sep 2020 10:22:06 +0000 (11:22 +0100)] 
aarch64: Prevent canary address being spilled to stack

This patch fixes the equivalent of arm bug PR85434/CVE-2018-12886
for aarch64: under high register pressure, the -fstack-protector
code might spill the address of the canary onto the stack and
reload it at the test site, giving an attacker the opportunity
to change the expected canary value.

This would happen in two cases:

- when generating PIC for -mstack-protector-guard=global
  (tested by stack-protector-6.c).  This is a direct analogue
  of PR85434, which was also about PIC for the global case.

- when using -mstack-protector-guard=sysreg.

The two problems were really separate bugs and caused by separate code,
but it was more convenient to fix them together.

The post-patch code still spills _GLOBAL_OFFSET_TABLE_ for
stack-protector-6.c, which is a more general problem.  However,
it no longer spills the canary address itself.

The patch also fixes an ICE when using -mstack-protector-guard=sysreg
with ILP32: even if the register read is SImode, the address
calculation itself should still be DImode.

gcc/
* config/aarch64/aarch64-protos.h (aarch64_salt_type): New enum.
(aarch64_stack_protect_canary_mem): Declare.
* config/aarch64/aarch64.md (UNSPEC_SALT_ADDR): New unspec.
(stack_protect_set): Forward to stack_protect_combined_set.
(stack_protect_combined_set): New pattern.  Use
aarch64_stack_protect_canary_mem.
(reg_stack_protect_address_<mode>): Add a salt operand.
(stack_protect_test): Forward to stack_protect_combined_test.
(stack_protect_combined_test): New pattern.  Use
aarch64_stack_protect_canary_mem.
* config/aarch64/aarch64.c (strip_salt): New function.
(strip_offset_and_salt): Likewise.
(tls_symbolic_operand_type): Use strip_offset_and_salt.
(aarch64_stack_protect_canary_mem): New function.
(aarch64_cannot_force_const_mem): Use strip_offset_and_salt.
(aarch64_classify_address): Likewise.
(aarch64_symbolic_address_p): Likewise.
(aarch64_print_operand): Likewise.
(aarch64_output_addr_const_extra): New function.
(aarch64_tls_symbol_p): Use strip_salt.
(aarch64_classify_symbol): Likewise.
(aarch64_legitimate_pic_operand_p): Use strip_offset_and_salt.
(aarch64_legitimate_constant_p): Likewise.
(aarch64_mov_operand_p): Use strip_salt.
(TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Override.

gcc/testsuite/
* gcc.target/aarch64/stack-protector-5.c: New test.
* gcc.target/aarch64/stack-protector-6.c: Likewise.
* gcc.target/aarch64/stack-protector-7.c: Likewise.

(cherry picked from commit 74b27d8eedc7a4c0e8276345107790e6b3c023cb)

4 years agoaarch64: Update feature macro name
Richard Sandiford [Tue, 29 Sep 2020 10:22:05 +0000 (11:22 +0100)] 
aarch64: Update feature macro name

GCC used the name __ARM_FEATURE_SVE_VECTOR_OPERATIONS, but in the
final spec it was renamed to__ARM_FEATURE_SVE_VECTOR_OPERATORS.

gcc/
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Rename
__ARM_FEATURE_SVE_VECTOR_OPERATIONS to
__ARM_FEATURE_SVE_VECTOR_OPERATORS.

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/attributes_1.c: Rename
__ARM_FEATURE_SVE_VECTOR_OPERATIONS to
__ARM_FEATURE_SVE_VECTOR_OPERATORS.

(cherry picked from commit ef4af9eddea5a658eb7d6dc29fcb58aa54c9dd9f)

4 years agoaarch64: Tweaks to the handling of fixed-length SVE types
Richard Sandiford [Tue, 29 Sep 2020 10:22:04 +0000 (11:22 +0100)] 
aarch64: Tweaks to the handling of fixed-length SVE types

This patch is really four things rolled into one, since separating
them seemed artificial:

- Update the mangling of the fixed-length SVE ACLE types to match
  the upcoming spec.  The idea is to mangle:

    VLAT __attribute__((arm_sve_vector_bits(N)))

  as an instance __SVE_VLS<VLAT, N> of the template:

    __SVE_VLS<typename, unsigned>

- Give the fixed-length types their own TYPE_DECL.  This is needed
  to make the above mangling fix work, but should also be a minor
  QoI improvement for error reporting.  Unfortunately, the names are
  quite verbose, e.g.:

    svint8_t __attribute__((arm_sve_vector_bits(512)))

  but anything shorter would be ad-hoc syntax and so might be more
  confusing.

- Improve the error message reported when arm_sve_vector_bits is
  applied to tuples, such as:

    svint32x2_t __attribute__((arm_sve_vector_bits(N)))

  Previously we would complain that the type isn't an SVE type;
  now we complain that it isn't a vector type.

- Don't allow arm_sve_vector_bits(N) to be applied to existing
  fixed-length SVE types.

gcc/
* config/aarch64/aarch64-sve-builtins.cc (add_sve_type_attribute):
Take the ACLE name of the type as a parameter and add it as fourth
argument to the "SVE type" attribute.
(register_builtin_types): Update call accordingly.
(register_tuple_type): Likewise.  Construct the name of the type
earlier in order to do this.
(get_arm_sve_vector_bits_attributes): New function.
(handle_arm_sve_vector_bits_attribute): Report a more sensible
error message if the attribute is applied to an SVE tuple type.
Don't allow the attribute to be applied to an existing fixed-length
SVE type.  Mangle the new type as __SVE_VLS<type, vector-bits>.
Add a dummy TYPE_DECL to the new type.

gcc/testsuite/
* g++.target/aarch64/sve/acle/general-c++/attributes_2.C: New test.
* g++.target/aarch64/sve/acle/general-c++/mangle_6.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_7.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_8.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_9.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_10.C: Likewise.
* gcc.target/aarch64/sve/acle/general/attributes_7.c: Check the
error messages reported when arm_sve_vector_bits is applied to
SVE tuple types or to existing fixed-length SVE types.

(cherry picked from commit 9ded41a39c1bb29f356485a9ec3a573fb75ded12)

4 years agoaarch64: Update the mangling of single SVE vectors and predicates
Richard Sandiford [Tue, 29 Sep 2020 10:22:03 +0000 (11:22 +0100)] 
aarch64: Update the mangling of single SVE vectors and predicates

GCC was implementing an old mangling scheme for single SVE
vectors and predicates (based on the Advanced SIMD one).
The final definition instead put them in the vendor built-in
namespace via the "u" prefix.

gcc/
* config/aarch64/aarch64-sve-builtins.cc (DEF_SVE_TYPE): Add a
leading "u" to each mangled name.

gcc/testsuite/
* g++.target/aarch64/sve/acle/general-c++/mangle_1.C: Add a leading
"u" to the mangling of each SVE vector and predicate type.
* g++.target/aarch64/sve/acle/general-c++/mangle_2.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_3.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/mangle_5.C: Likewise.

(cherry picked from commit dcb043351307001a85fc1e7d56669f5adc9628f7)

4 years agoarm: Add support for Neoverse V1 CPU
Alex Coplan [Tue, 29 Sep 2020 09:06:42 +0000 (10:06 +0100)] 
arm: Add support for Neoverse V1 CPU

This patch backports the AArch32 support for Arm's Neoverse V1 CPU to
GCC 10.

gcc/ChangeLog:

* config/arm/arm-cpus.in (neoverse-v1): New.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* doc/invoke.texi: Document AArch32 support for Neoverse V1.

4 years agoDaily bump.
GCC Administrator [Tue, 29 Sep 2020 00:17:10 +0000 (00:17 +0000)] 
Daily bump.

4 years agotestsuite: [aarch64] Fix aarch64/advsimd-intrinsics/v{trn,uzp,zip}_half.c
Christophe Lyon [Fri, 25 Sep 2020 10:40:18 +0000 (10:40 +0000)] 
testsuite: [aarch64] Fix aarch64/advsimd-intrinsics/v{trn,uzp,zip}_half.c

Since r11-3402 (g:65c9878641cbe0ed898aa7047b7b994e9d4a5bb1), the
vtrn_half, vuzp_half and vzip_half started failing with

vtrn_half.c:76:17: error: redeclaration of 'vector_float64x2' with no linkage
vtrn_half.c:77:17: error: redeclaration of 'vector2_float64x2' with no linkage
vtrn_half.c:80:17: error: redeclaration of 'vector_res_float64x2' with no linkage

This is because r11-3402 now always declares float64x2 variables for
aarch64, leading to a duplicate declaration in these testcases.

The fix is simply to remove these now useless declarations.

These tests are skipped on arm*, so there is no impact on that target.

2020-09-25  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c: Remove
declarations of vector, vector2, vector_res for float64x2 type.
* gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vzip_half.c: Likewise.

(cherry picked from commit 8c775bf447e190024fa08c55e38db94dd013a393)

4 years agoAArch64: Implement missing p128<->f64 reinterpret intrinsics
Kyrylo Tkachov [Wed, 23 Sep 2020 16:37:58 +0000 (17:37 +0100)] 
AArch64: Implement missing p128<->f64 reinterpret intrinsics

This patch implements the missing reinterprets to and from poly128_t and
float64x2_t.
I've plugged in the appropriate testing in the advsimd-intrinsics.exp
too.

Bootstrapped and tested on aarch64-none-linux-gnu.
Tested advsimd-intrinsics.exp on arm-none-eabi too to make sure arm
testing isn't affected.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vreinterpretq_f64_p128,
vreinterpretq_p128_f64): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h
(clean_results): Add float64x2_t cleanup.
(DECL_VARIABLE_128BITS_VARIANTS): Add float64x2_t variable.
* gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c: Add
testing of vreinterpretq_f64_p128, vreinterpretq_p128_f64.

(cherry picked from commit 65c9878641cbe0ed898aa7047b7b994e9d4a5bb1)

4 years agoAArch64: Implement missing vrndns_f32 intrinsic
Kyrylo Tkachov [Wed, 23 Sep 2020 11:02:29 +0000 (12:02 +0100)] 
AArch64: Implement missing vrndns_f32 intrinsic

This patch implements the missing vrndns_f32 intrinsic. This operates on a scalar float32_t value.
It can be mapped down to a __builtin_aarch64_frintnsf builtin.

This patch does that.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/aarch64-simd-builtins.def (frintn): Use BUILTIN_VHSDF_HSDF
for modes.  Remove explicit hf instantiation.
* config/aarch64/arm_neon.h (vrndns_f32): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vrndns_f32_1.c: New test.

(cherry picked from commit 02b5377b3766804059b7824330d33d0e1cef2e5b)

4 years agoAArch64: Implement missing _p64 intrinsics for vector permutes
Kyrylo Tkachov [Wed, 23 Sep 2020 10:07:50 +0000 (11:07 +0100)] 
AArch64: Implement missing _p64 intrinsics for vector permutes

This patch implements some missing vector permute intrinsics operating on poly64x2_t types.
They are implemented identically to their uint64x2_t brethren.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vtrn1q_p64, vtrn2q_p64, vuzp1q_p64,
vuzp2q_p64, vzip1q_p64, vzip2q_p64): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/trn_zip_p64_1.c: New test.

(cherry picked from commit e8e818399d70c5a5a3d30a54d305c6e2b92e2c66)

4 years agoAArch64: Implement vldrq_p128 intrinsic
Kyrylo Tkachov [Wed, 23 Sep 2020 09:32:42 +0000 (10:32 +0100)] 
AArch64: Implement vldrq_p128 intrinsic

This patch implements the missing vldrq_p128 intrinsic that just loads from the appropriate pointer.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vldrq_p128): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vldrq_p128_1.c: New test.

(cherry picked from commit f2868e4bcff2c7b882d01231f039459c00e59d7b)

4 years agoAArch64: Implement vstrq_p128 intrinsic
Kyrylo Tkachov [Wed, 23 Sep 2020 09:29:17 +0000 (10:29 +0100)] 
AArch64: Implement vstrq_p128 intrinsic

This patch implements the missing vstrq_p128 intrinsic.
It just performs a store of the poly128_t argument to a memory location.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vstrq_p128): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vstrq_p128_1.c: New test.

(cherry picked from commit d23ea1e865301cd45f14ccbdb0bca49251fde9e1)

4 years agoAArch64: Implement missing vcls intrinsics on unsigned types
Kyrylo Tkachov [Tue, 22 Sep 2020 11:03:49 +0000 (12:03 +0100)] 
AArch64: Implement missing vcls intrinsics on unsigned types

This patch implements some missing intrinsics that perform a CLS on unsigned SIMD types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vcls_u8, vcls_u16, vcls_u32,
vclsq_u8, vclsq_u16, vclsq_u32): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vcls_unsigned_1.c: New test.

(cherry picked from commit 30957092db46d8798e632feefb5df634488dbb33)

4 years agoAArch64: Implement missing vceq*_p* intrinsics
Kyrylo Tkachov [Tue, 22 Sep 2020 11:00:38 +0000 (12:00 +0100)] 
AArch64: Implement missing vceq*_p* intrinsics

This patch implements some missing vceq* intrinsics on poly types.
The behaviour is to produce the appropriate CMEQ instruction as for the unsigned types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vceqq_p64, vceqz_p64, vceqzq_p64): Define.

gcc/testsuite/

PR target/71233
* gcc.target/aarch64/simd/vceq_poly_1.c: New test.

(cherry picked from commit d4703be185b422f637deebd3bb9222a41c8023d6)

4 years agoAArch64: Implement poly-type vadd intrinsics
Kyrylo Tkachov [Tue, 22 Sep 2020 10:58:36 +0000 (11:58 +0100)] 
AArch64: Implement poly-type vadd intrinsics

This implements the vadd[p]_p* intrinsics.
In terms of functionality they are aliases of veor operations on the relevant unsigned types.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vadd_p8, vadd_p16, vadd_p64, vaddq_p8,
vaddq_p16, vaddq_p64, vaddq_p128): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vadd_poly_1.c: New test.

(cherry picked from commit fa9ad35dae03dcb20c4ccb50ba1b351a8ab77970)

4 years agoRevert "Fortran : ICE in build_field PR95614"
Mark Eggleston [Mon, 28 Sep 2020 11:07:07 +0000 (12:07 +0100)] 
Revert "Fortran  :  ICE in build_field PR95614"

This reverts commit 4a67941a956003dcce8866604ba25f5a0bfd16cf.

4 years agoFix bogus alignment warning on address clause
Eric Botcazou [Mon, 28 Sep 2020 07:00:46 +0000 (09:00 +0200)] 
Fix bogus alignment warning on address clause

The compiler gives a bogus alignment warning on an address clause and
a discriminated record type with variable size.

gcc/ada/ChangeLog:
* gcc-interface/decl.c (maybe_saturate_size): Add ALIGN parameter
and round down the result to ALIGN.
(gnat_to_gnu_entity): Adjust calls to maybe_saturate_size.

gcc/testsuite/ChangeLog:
* gnat.dg/addr16.adb: New test.
* gnat.dg/addr16_pkg.ads: New helper.

4 years agoDaily bump.
GCC Administrator [Mon, 28 Sep 2020 00:16:55 +0000 (00:16 +0000)] 
Daily bump.

4 years agooptabs: Don't reuse target for multi-word expansions if it overlaps operand(s) [PR97073]
Jakub Jelinek [Sun, 27 Sep 2020 21:18:26 +0000 (23:18 +0200)] 
optabs: Don't reuse target for multi-word expansions if it overlaps operand(s) [PR97073]

The following testcase is miscompiled on i686-linux, because
we try to expand a double-word bitwise logic operation with op0
being a (mem:DI u) and target (mem:DI u+4), i.e. partial overlap, and
thus end up with:
movl 4(%esp), %eax
andl u, %eax
movl %eax, u+4
! movl u+4, %eax optimized out
andl 8(%esp), %eax
movl %eax, u+8
rather than with the desired:
movl 4(%esp), %edx
movl 8(%esp), %eax
andl u, %edx
andl u+4, %eax
movl %eax, u+8
movl %edx, u+4
because the store of the first word to target overwrites the second word of
the operand.
expand_binop for this (and several similar places) already check for target
== op0 or target == op1, this patch just adds reg_overlap_mentioned_p calls
next to it.
Pedantically, at least for some of these it might be sufficient to force
a different target if there is overlap but target is not rtx_equal_p to
the operand (e.g. in this bitwise logical case, but e.g. not in the shift
cases where there is reordering), though that would go against the
preexisting target == op? checks and the rationale that REG_EQUAL notes in
that case isn't correct.

2020-09-27  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/97073
* optabs.c (expand_binop, expand_absneg_bit, expand_unop,
expand_copysign_bit): Check reg_overlap_mentioned_p between target
and operand(s) and if it returns true, force a pseudo as target.

* gcc.c-torture/execute/pr97073.c: New test.

(cherry picked from commit a4b31d5807f2bc67c8999b3d53369cf2a5c6e1ec)

4 years agoFortran : ICE in build_field PR95614
Mark Eggleston [Thu, 11 Jun 2020 13:33:51 +0000 (14:33 +0100)] 
Fortran  :  ICE in build_field PR95614

Local identifiers can not be the same as a module name.  Original
patch by Steve Kargl resulted in name clashes between common block
names and local identifiers.  A local identifier can be the same as
a global identier if that identifier represents a common.  The patch
was modified to allow global identifiers that represent a common
block.

2020-09-27  Steven G. Kargl  <kargl@gcc.gnu.org>
    Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/fortran/

PR fortran/95614
* decl.c (gfc_get_common): Use gfc_match_common_name instead
of match_common_name.
* decl.c (gfc_bind_idents): Use gfc_match_common_name instead
of match_common_name.
* match.c : Rename match_common_name to gfc_match_common_name.
* match.c (gfc_match_common): Use gfc_match_common_name instead
of match_common_name.
* match.h : Rename match_common_name to gfc_match_common_name.
* resolve.c (resolve_common_vars): Check each symbol in a
common block has a global symbol.  If there is a global symbol
issue an error if the symbol type is known as is not a common
block name.

2020-09-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

PR fortran/95614
* gfortran.dg/pr95614_1.f90: New test.
* gfortran.dg/pr95614_2.f90: New test.

(cherry picked from commit e5a76af3a2f3324efc60b4b2778ffb29d5c377bc)

4 years agoDaily bump.
GCC Administrator [Sun, 27 Sep 2020 00:16:59 +0000 (00:16 +0000)] 
Daily bump.

4 years agoDaily bump.
GCC Administrator [Sat, 26 Sep 2020 00:17:01 +0000 (00:17 +0000)] 
Daily bump.

4 years agoAdd test for PR95464.c.
Vladimir N. Makarov [Thu, 4 Jun 2020 17:32:24 +0000 (13:32 -0400)] 
Add test for PR95464.c.

2020-06-04  Vladimir Makarov  <vmakarov@redhat.com>

PR middle-end/95464
* gcc.target/i386/pr95464.c: New.

(cherry picked from commit e7ef9a40cd0c688cd331bc26224d1fbe360c1fe6)

4 years agoAdd processing STRICT_LOW_PART for matched reloads.
Vladimir N. Makarov [Thu, 4 Jun 2020 16:04:48 +0000 (12:04 -0400)] 
Add processing STRICT_LOW_PART for matched reloads.

2020-06-04  Vladimir Makarov  <vmakarov@redhat.com>

PR middle-end/95464
* lra.c (lra_emit_move): Add processing STRICT_LOW_PART.
* lra-constraints.c (match_reload): Use STRICT_LOW_PART in output
reload if the original insn has it too.

(cherry picked from commit 5261cf8ce824bfc75eb6f12ad5e3716c085b6f9a)

4 years agoarm: Require MVE memory operand for destination of vst1q intrinsic
Joe Ramsay [Wed, 19 Aug 2020 12:34:06 +0000 (12:34 +0000)] 
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.

(cherry picked from commit 91d206adfe39ce063f6a5731b92a03c05e82e94a)

4 years agoDaily bump.
GCC Administrator [Fri, 25 Sep 2020 00:17:04 +0000 (00:17 +0000)] 
Daily bump.

4 years agortl_data: Add sp_is_clobbered_by_asm
H.J. Lu [Mon, 14 Sep 2020 15:52:27 +0000 (08:52 -0700)] 
rtl_data: Add sp_is_clobbered_by_asm

Add sp_is_clobbered_by_asm to rtl_data to inform backends that the stack
pointer is clobbered by asm statement.

gcc/

PR target/97032
* cfgexpand.c (asm_clobber_reg_kind): Set sp_is_clobbered_by_asm
to true if the stack pointer is clobbered by asm statement.
* emit-rtl.h (rtl_data): Add sp_is_clobbered_by_asm.
* config/i386/i386.c (ix86_get_drap_rtx): Set need_drap to true
if the stack pointer is clobbered by asm statement.

gcc/testsuite/

PR target/97032
* gcc.target/i386/pr97032.c: New test.

(cherry picked from commit 453a20c65722719b9e2d84339f215e7ec87692dc)

4 years ago[RS6000] Power10 libffi fixes
Alan Modra [Fri, 18 Sep 2020 13:51:05 +0000 (23:21 +0930)] 
[RS6000] Power10 libffi fixes

Power10 pc-relative code doesn't use or preserve r2 as a TOC pointer.
That means calling between pc-relative and TOC using code can't be
done without intervening linker stubs, and a call from TOC code to
pc-relative code must have a nop after the bl in order to restore r2.

Now the PowerPC libffi assembly code doesn't use r2 except for the
implicit use when making calls back to C, ffi_closure_helper_LINUX64
and ffi_prep_args64.  So changing the assembly to interoperate with
pc-relative code without stubs is easily done.

PR target/97166
* src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global
entry when __PCREL__.  Call using @notoc.  Add nops.
* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise.
(ffi_go_closure_linux64): Likewise.

(cherry picked from commit 08cd8d5929eac84b27788d8483fd75ab7ad13129)
(cherry picked from commit fff56af6421a1a3e357bcaad99f2ea084d72a7a8)

4 years ago[RS6000] Built-in __PCREL__ define
Alan Modra [Wed, 23 Sep 2020 10:45:39 +0000 (20:15 +0930)] 
[RS6000] Built-in __PCREL__ define

Useful in assembly to know details of power10 function calls.

PR target/97166
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros):
Conditionally define __PCREL__.

(cherry picked from commit 677b9150f54a0483d3de1182ac40717b7c4431a5)

4 years agoaarch64: Do not alter value on a force_reg returned rtx expanding __jcvt
Andrea Corallo [Thu, 17 Sep 2020 16:17:52 +0000 (17:17 +0100)] 
aarch64: Do not alter value on a force_reg returned rtx expanding __jcvt

2020-09-17  Andrea Corallo  <andrea.corallo@arm.com>

* config/aarch64/aarch64-builtins.c
(aarch64_general_expand_builtin): Use expand machinery not to
alter the value of an rtx returned by force_reg.

(cherry picked from commit 2c62952f8160bdc8d4111edb34a4bc75096c1e05)

4 years agoaarch64: Add support for Neoverse V1 CPU
Alex Coplan [Thu, 24 Sep 2020 09:17:48 +0000 (10:17 +0100)] 
aarch64: Add support for Neoverse V1 CPU

This patch backports the AArch64 support for Arm's Neoverse V1 CPU to
GCC 10.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def: Add Neoverse V1.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi: Document support for Neoverse V1.

4 years agoDaily bump.
GCC Administrator [Thu, 24 Sep 2020 00:17:04 +0000 (00:17 +0000)] 
Daily bump.

4 years agoDaily bump.
GCC Administrator [Wed, 23 Sep 2020 00:17:02 +0000 (00:17 +0000)] 
Daily bump.

4 years agolibstdc++: Fix out-of-bounds string_view access in filesystem::path [PR 97167]
Jonathan Wakely [Tue, 22 Sep 2020 19:02:58 +0000 (20:02 +0100)] 
libstdc++: Fix out-of-bounds string_view access in filesystem::path [PR 97167]

libstdc++-v3/ChangeLog:

PR libstdc++/97167
* src/c++17/fs_path.cc (path::_Parser::root_path()): Check
for empty string before inspecting the first character.
* testsuite/27_io/filesystem/path/append/source.cc: Append
empty string_view to path.

(cherry picked from commit 49ff88bd0d8a36a9e903f01ce05685cfe07dee5d)

4 years agobpf: use xBPF signed div, mod insns when available
David Faust [Tue, 22 Sep 2020 18:31:35 +0000 (20:31 +0200)] 
bpf: use xBPF signed div, mod insns when available

The 'mod' and 'div' operators in eBPF are unsigned, with no signed
counterpart. xBPF adds two new ALU operations, sdiv and smod, for
signed division and modulus, respectively. Update bpf.md with
'define_insn' blocks for signed div and mod to use them when targetting
xBPF, and add new tests to ensure they are used appropriately.

2020-09-17  David Faust  <david.faust@oracle.com>

gcc/
* config/bpf/bpf.md: Add defines for signed div and mod operators.

gcc/testsuite/
* gcc.target/bpf/diag-sdiv.c: New test.
* gcc.target/bpf/diag-smod.c: New test.
* gcc.target/bpf/xbpf-sdiv-1.c: New test.
* gcc.target/bpf/xbpf-smod-1.c: New test.

(cherry picked from commit 7c8ba5da80d5d95a8521010d6731d0d83036145d)

4 years agolibstdc++: Use correct argument type for __use_alloc, again [PR 96803]
Jonathan Wakely [Tue, 22 Sep 2020 07:42:18 +0000 (08:42 +0100)] 
libstdc++: Use correct argument type for __use_alloc, again [PR 96803]

While backporting 5494edae83ad33c769bd1ebc98f0c492453a6417 I noticed
that it's still not correct. I made the allocator-extended constructor
use the right type for the uses-allocator construction detection, but I
used an rvalue when it should be a const lvalue.

This should fix it properly this time.

libstdc++-v3/ChangeLog:

PR libstdc++/96803
* include/std/tuple
(_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl<U...>&)):
Use correct value category in __use_alloc call.
* testsuite/20_util/tuple/cons/96803.cc: Check with constructors
that require correct value category to be used.

(cherry picked from commit 7825399092d572ce8ea82c4aa8dfeb65076b0e52)

4 years agolibstdc++: Use correct argument type for __use_alloc [PR 96803]
Jonathan Wakely [Wed, 26 Aug 2020 18:32:30 +0000 (19:32 +0100)] 
libstdc++: Use correct argument type for __use_alloc [PR 96803]

The _Tuple_impl constructor for allocator-extended construction from a
different tuple type uses the _Tuple_impl's own _Head type in the
__use_alloc test. That is incorrect, because the argument tuple could
have a different type. Using the wrong type might select the
leading-allocator convention when it should use the trailing-allocator
convention, or vice versa.

libstdc++-v3/ChangeLog:

PR libstdc++/96803
* include/std/tuple
(_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl<U...>&)):
Replace parameter pack with a type parameter and a pack and pass
the first type to __use_alloc.
* testsuite/20_util/tuple/cons/96803.cc: New test.

(cherry picked from commit 5494edae83ad33c769bd1ebc98f0c492453a6417)

4 years agoDaily bump.
GCC Administrator [Tue, 22 Sep 2020 00:17:04 +0000 (00:17 +0000)] 
Daily bump.

4 years agolibstdc++: Fix build for targets without lstat [PR 94681]
Jonathan Wakely [Mon, 10 Aug 2020 17:58:14 +0000 (18:58 +0100)] 
libstdc++: Fix build for targets without lstat [PR 94681]

libstdc++-v3/ChangeLog:

PR libstdc++/94681
* src/c++17/fs_ops.cc (read_symlink): Use posix::lstat instead
of calling ::lstat directly.
* src/filesystem/ops.cc (read_symlink): Likewise.

(cherry picked from commit 5b065f0563262a0d6cd1fea8426913bfdd841301)

4 years agolibstdc++: Make C++17 ignore --disable-libstdcxx-filesystem-ts [PR 94681]
Jonathan Wakely [Mon, 10 Aug 2020 12:21:59 +0000 (13:21 +0100)] 
libstdc++: Make C++17 ignore --disable-libstdcxx-filesystem-ts [PR 94681]

The configure switch should only affect the optional Filesystem TS, not
the std::filesystem features of C++17.

libstdc++-v3/ChangeLog:

PR libstdc++/94681
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Do not depend on
$enable_libstdcxx_filesystem_ts.
* configure: Regenerate.

(cherry picked from commit 90f7636bf8df50940e0f749af60a6b374a8f09b4)

4 years agolibstdc++: Fix noexcept-specifier for std::bind_front [PR 97101]
Jonathan Wakely [Sun, 20 Sep 2020 23:17:02 +0000 (00:17 +0100)] 
libstdc++: Fix noexcept-specifier for std::bind_front [PR 97101]

libstdc++-v3/ChangeLog:

PR libstdc++/97101
* include/std/functional (bind_front): Fix order of parameters
in is_nothrow_constructible_v specialization.
* testsuite/20_util/function_objects/bind_front/97101.cc: New test.

(cherry picked from commit 3c755b428e188228d0bad90625c995fd25a02322)

4 years agolibgo: don't put golang.org packages in zstdpkglist.go
Ian Lance Taylor [Mon, 21 Sep 2020 19:45:43 +0000 (12:45 -0700)] 
libgo: don't put golang.org packages in zstdpkglist.go

This ensures that internal/goroot.IsStandardPackage does not treat
golang.org packages as being in the standard library.

For golang/go#41368
Fixes golang/go#41499

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256319

4 years agolibstdc++: handle small max_blocks_per_chunk in pool resources [PR 94160]
Jonathan Wakely [Thu, 10 Sep 2020 14:39:15 +0000 (15:39 +0100)] 
libstdc++: handle small max_blocks_per_chunk in pool resources [PR 94160]

When a pool resource is constructed with max_blocks_per_chunk=1 it ends
up creating a pool with blocks_per_chunk=0 which means it never
allocates anything. Instead it returns null pointers, which should be
impossible.

To avoid this problem, round the max_blocks_per_chunk value to a
multiple of four, so it's never smaller than four.

libstdc++-v3/ChangeLog:

PR libstdc++/94160
* src/c++17/memory_resource.cc (munge_options): Round
max_blocks_per_chunk to a multiple of four.
(__pool_resource::_M_alloc_pools()): Simplify slightly.
* testsuite/20_util/unsynchronized_pool_resource/allocate.cc:
Check that valid pointers are returned when small values are
used for max_blocks_per_chunk.

(cherry picked from commit 30b41cfbb2dade63e52465234a725d1d02fe70aa)

4 years agoDaily bump.
GCC Administrator [Mon, 21 Sep 2020 00:17:01 +0000 (00:17 +0000)] 
Daily bump.

4 years agoFix linkage with -nodefaultlibs option.
John David Anglin [Sun, 20 Sep 2020 19:39:42 +0000 (19:39 +0000)] 
Fix linkage with -nodefaultlibs option.

2020-09-20  John David Anglin  < danglin@gcc.gnu.org>

gcc/ChangeLog
* config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Delete.
* config/pa/pa64-hpux.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise.
(ENDFILE_SPEC): Link with libgcc_stub.a and mill.a.
* config/pa/pa32-linux.h (ENDFILE_SPEC): Link with libgcc.a.

4 years agoDaily bump.
GCC Administrator [Sun, 20 Sep 2020 00:16:56 +0000 (00:16 +0000)] 
Daily bump.

4 years agoDaily bump.
GCC Administrator [Sat, 19 Sep 2020 00:17:02 +0000 (00:17 +0000)] 
Daily bump.

4 years agoFortran: Avoid double-free with parse error (PR96041, PR93423)
Tobias Burnus [Thu, 17 Sep 2020 12:01:09 +0000 (14:01 +0200)] 
Fortran: Avoid double-free with parse error (PR96041, PR93423)

gcc/fortran/

PR fortran/96041
PR fortran/93423
* decl.c (gfc_match_submod_proc): Avoid later double-free
in the error case.

(cherry picked from commit c12facd22881517127ebbe213d7ecc7fc1fcea4e)

4 years agoPR fortran/93423 - ICE on invalid with argument list for module procedure
Harald Anlauf [Thu, 2 Jul 2020 18:48:16 +0000 (20:48 +0200)] 
PR fortran/93423 - ICE on invalid with argument list for module procedure

When recovering from an error, a NULL pointer dereference could occur.
Check for that situation and punt.

gcc/fortran/
PR fortran/93423
* resolve.c (resolve_symbol): Avoid NULL pointer dereference.

(cherry picked from commit b88744905a46be44ffa3c57d46080f601ae832b8)

4 years agoDaily bump.
GCC Administrator [Fri, 18 Sep 2020 00:16:57 +0000 (00:16 +0000)] 
Daily bump.

4 years agopreprocessor: Fix ICE with too long line in fmtwarn [PR96935]
Marek Polacek [Wed, 16 Sep 2020 13:27:29 +0000 (09:27 -0400)] 
preprocessor: Fix ICE with too long line in fmtwarn [PR96935]

Here we ICE in char_span::subspan because the offset it gets is -1.
It's -1 because get_substring_ranges_for_loc gets a location whose
column was 0.  That only happens in testcases like the attached where
we're dealing with extremely long lines (at least 4065 chars it seems).
This does happen in practice, though, so it's not just a theoretical
problem (e.g. when building the SU2 suite).

Fixed by checking that the column get_substring_ranges_for_loc gets is
sane, akin to other checks in that function.

gcc/ChangeLog:

PR preprocessor/96935
* input.c (get_substring_ranges_for_loc): Return if start.column
is less than 1.

gcc/testsuite/ChangeLog:

PR preprocessor/96935
* gcc.dg/format/pr96935.c: New test.

(cherry picked from commit 31dd5cd6344bfbbe122fb512993b128e11236d35)

4 years agoIf -mavx implies -mxsave, then -mno-xsave should imply -mno-avx.
liuhongt [Wed, 16 Sep 2020 05:56:30 +0000 (13:56 +0800)] 
If -mavx implies -mxsave, then -mno-xsave should imply -mno-avx.

Current status is -mno-avx implies -mno-xsave which should be wrong.

gcc/ChangeLog

* common/config/i386/i386-common.c
(OPTION_MASK_ISA_AVX_UNSET): Remove OPTION_MASK_ISA_XSAVE_UNSET.
(OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_AVX_UNSET.

gcc/testsuite/ChangeLog

* gcc.target/i386/xsave-avx-1.c: New test.

4 years agoDaily bump.
GCC Administrator [Thu, 17 Sep 2020 00:17:05 +0000 (00:17 +0000)] 
Daily bump.

4 years agostore-merging: Consider also overlapping stores earlier in the by bitpos sorting...
Jakub Jelinek [Wed, 16 Sep 2020 07:42:33 +0000 (09:42 +0200)] 
store-merging: Consider also overlapping stores earlier in the by bitpos sorting [PR97053]

As the testcases show, if we have something like:
  MEM <char[12]> [&b + 8B] = {};
  MEM[(short *) &b] = 5;
  _5 = *x_4(D);
  MEM <long long unsigned int> [&b + 2B] = _5;
  MEM[(char *)&b + 16B] = 88;
  MEM[(int *)&b + 20B] = 1;
then in sort_by_bitpos the stores are almost like in the given order,
except the first store is after the = _5; store.
We can't coalesce the = 5; store with = _5;, because the latter is MEM_REF,
while the former INTEGER_CST, and we can't coalesce the = _5 store with
the = {} store because the former is MEM_REF, the latter INTEGER_CST.
But we happily coalesce the remaining 3 stores, which is wrong, because the
= _5; store overlaps those and is in between them in the program order.
We already have code to deal with similar cases in check_no_overlap, but we
deal only with the following stores in sort_by_bitpos order, not the earlier
ones.

The following patch checks also the earlier ones.  In coalesce_immediate_stores
it computes the first one that needs to be checked (all the ones whose
bitpos + bitsize is smaller or equal to merged_store->start don't need to be
checked and don't need to be checked even for any following attempts because
of the sort_by_bitpos sorting) and the end of that (that is the first store
in the merged_store).

2020-09-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/97053
* gimple-ssa-store-merging.c (check_no_overlap): Add FIRST_ORDER,
START, FIRST_EARLIER and LAST_EARLIER arguments.  Return false if
any stores between FIRST_EARLIER inclusive and LAST_EARLIER exclusive
has order in between FIRST_ORDER and LAST_ORDER and overlaps the to
be merged store.
(imm_store_chain_info::try_coalesce_bswap): Add FIRST_EARLIER argument.
Adjust check_no_overlap caller.
(imm_store_chain_info::coalesce_immediate_stores): Add first_earlier
and last_earlier variables, adjust them during iterations.  Adjust
check_no_overlap callers, call check_no_overlap even when extending
overlapping stores by extra INTEGER_CST stores.

* gcc.dg/store_merging_31.c: New test.
* gcc.dg/store_merging_32.c: New test.

(cherry picked from commit bd909071ac04e94f4b6f0baab64d0687ec55681d)

4 years agoDaily bump.
GCC Administrator [Wed, 16 Sep 2020 00:17:12 +0000 (00:17 +0000)] 
Daily bump.

4 years ago[PATCH,rs6000] Testsuite fixup pr96139 tests
Will Schmidt [Wed, 9 Sep 2020 15:59:38 +0000 (10:59 -0500)] 
[PATCH,rs6000] Testsuite fixup pr96139 tests

Hi,
  As reported, the recently added pr96139 tests will fail on older targets
  because the tests are missing the appropriate -mvsx or -maltivec options.
  This adds the options and clarifies the dg-require statements.

  The pr96139-c.c test needs -maltivec to work, but does not actually use
  vectors, so does not require -mvsx like the others.

  Sniff-regtested OK when specifying older targets on a power7 host.
  --target_board=unix/'{-mcpu=power4,-mcpu=power5,-mcpu=power6,-mcpu=power7,
  -mcpu=power8,-mcpu=power9}''{-m64,-m32}'"

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr96139-a.c: Specify -mvsx option and update the
dg-require stanza to match.
* gcc.target/powerpc/pr96139-b.c: Same.
* gcc.target/powerpc/pr96139-c.c: Specify -maltivec option and update
the dg-require stanza to match.

(cherry picked from commit 2fda9e9badbd78d1033075a44a7d6c1b33de239c)

4 years ago[PATCH, rs6000] Fix vector long long subtype (PR96139)
Will Schmidt [Mon, 20 Jul 2020 15:51:37 +0000 (10:51 -0500)] 
[PATCH, rs6000] Fix vector long long subtype (PR96139)

Hi,
  This corrects an issue with the powerpc vector long long subtypes.
As reported by SjMunroe, when building some code with -Wall, and
attempting to print an element of a "long long vector" with a
long long printf format string, we will report an error because
the vector sub-type was improperly defined as int.

When defining a V2DI_type_node we use a TARGET_POWERPC64 ternary to
define the V2DI_type_node with "vector long" or "vector long long".
We also need to specify the proper sub-type when we define the type.

PR target/96139

2020-09-03  Will Schmidt  <will_schmidt@vnet.ibm.com>

gcc/ChangeLog:
* config/rs6000/rs6000-call.c (rs6000_init_builtin): Update V2DI_type_node
and unsigned_V2DI_type_node definitions.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr96139-a.c: New test.
* gcc.target/powerpc/pr96139-b.c: New test.
* gcc.target/powerpc/pr96139-c.c: New test.

(cherry picked from commit d8f3474ff81b07fd2e758337957711db17eb801e)

4 years agoi386: Fix up vector mul and div with broadcasts in -masm=intel mode
Jakub Jelinek [Tue, 15 Sep 2020 07:37:48 +0000 (09:37 +0200)] 
i386: Fix up vector mul and div with broadcasts in -masm=intel mode

These patterns printed bogus <>s around the {1to16} and similar strings.

2020-09-15  Jakub Jelinek  <jakub@redhat.com>

PR target/97028
* config/i386/sse.md (mul<mode>3<mask_name>_bcs,
<avx512>_div<mode>3<mask_name>_bcst): Use <avx512bcst> instead of
<<avx512bcst>>.

* gcc.target/i386/avx512f-pr97028.c: Untested fix.

(cherry picked from commit 0f079e104a8d1994b6b47169a6b45737615eb2d7)

4 years agodebug/96690 - mangle symbols eventually used by late dwarf output
Richard Biener [Mon, 24 Aug 2020 12:12:01 +0000 (14:12 +0200)] 
debug/96690 - mangle symbols eventually used by late dwarf output

The following makes sure to, at early debug generation time, mangle
symbols we eventually end up outputting during late finish.

2020-08-24  Richard Biener  <rguenther@suse.de>

PR debug/96690
* dwarf2out.c (reference_to_unused): Make FUNCTION_DECL
processing more consistent with respect to
symtab->global_info_ready.
(tree_add_const_value_attribute): Unconditionally call
rtl_for_decl_init to do all mangling early but throw
away the result if early_dwarf.

* g++.dg/lto/pr96690_0.C: New testcase.

(cherry picked from commit 7fe2cec41bb2ccb499b6b6c513e00da1a270370f)

4 years agoDaily bump.
GCC Administrator [Tue, 15 Sep 2020 00:17:14 +0000 (00:17 +0000)] 
Daily bump.

4 years agodoc: fix spelling of -fprofile-reproducibility
Sergei Trofimovich [Fri, 11 Sep 2020 14:31:35 +0000 (15:31 +0100)] 
doc: fix spelling of -fprofile-reproducibility

gcc/ChangeLog:

* doc/invoke.texi: fix '-fprofile-reproducibility' option
spelling in manual.

(cherry picked from commit 0620f4d79e270f1a455a7ec099504d44dc6180e6)

4 years agobpf: use the expected instruction for NOPs
Jose E. Marchesi [Mon, 14 Sep 2020 18:35:22 +0000 (20:35 +0200)] 
bpf: use the expected instruction for NOPs

The BPF ISA doesn't have a no-operation instruction, but in practice
the Linux kernel verifier performs some optimizations that rely on
these instructions to be encoded in a particular way.  As it turns
out, we were using the "wrong" instruction in GCC.

This patch makes GCC to generate the expected instruction for NOP (a
`ja 0') and also adds a test to make sure this is the case.

Tested in bpf-unknown-none targets.

2020-09-14  Jose E. Marchesi  <jose.marchesi@oracle.com>

gcc/

* config/bpf/bpf.md ("nop"): Re-define as `ja 0'.

gcc/testsuite/

* gcc.target/bpf/nop-1.c: New test.

(cherry picked from commit 5bcc0fa05ef713594f6c6d55d5c837e13a9c9803)