]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agoDarwin : Adjust handling of MACOSX_DEPLOYMENT_TARGET for macOS 11.
Iain Sandoe [Wed, 23 Dec 2020 17:16:08 +0000 (17:16 +0000)]
Darwin : Adjust handling of MACOSX_DEPLOYMENT_TARGET for macOS 11.

The shift to macOS version 11 also means that '11' without any
following '.x' is accepted as a valid version number.  This adjusts
the validation code to accept this and map it to 11.0.0 which
matches what the clang toolchain appears to do.

gcc/ChangeLog:

* config/darwin-driver.c (validate_macosx_version_min): Allow
MACOSX_DEPLOYMENT_TARGET=11.
(darwin_default_min_version): Adjust warning spelling to avoid
an apostrophe.

3 years agoDarwin : Update the kernel version to macOS version mapping.
Iain Sandoe [Sat, 19 Dec 2020 13:05:34 +0000 (13:05 +0000)]
Darwin : Update the kernel version to macOS version mapping.

With the change to macOS 11 and Darwin20, the algorithm for mapping
kernel version to macOS version has changed.

We now have darwin 20.X.Y => macOS 11.(X > 0 ? X - 1 : 0).??.
It currently unclear if the Y will be mapped to macOS patch version
and, if so, whether it will be one-based or 0-based.
Likewise, it's unknown if Darwin 21 will map to macOS 12, so these
entries are unchanged for the present.

gcc/ChangeLog:

* config/darwin-driver.c (darwin_find_version_from_kernel):
Compute the minor OS version from the minor kernel version.

3 years agoDarwin: Darwin 20 is to be macOS 11 (Big Sur).
Iain Sandoe [Fri, 31 Jul 2020 20:05:28 +0000 (21:05 +0100)]
Darwin: Darwin 20 is to be macOS 11 (Big Sur).

As per Nigel Tufnel's assertion "... this one goes to 11".

The various parts of the code that deal with mapping Darwin versions
to macOS (X) versions need updating to deal with  a major version of
11.

So now we have, for example:

Darwin  4 => macOS (X) 10.0

Darwin 14 => macOS (X) 10.10
...
Darwin 19 => macOS (X) 10.15

Darwin 20 => macOS  11.0

Because of the historical duplication of the "10" in macOSX 10.xx and
the number of tools that expect this, it is likely that system tools will
allow macos11.0 and/or macosx11.0 (despite that the latter makes little
sense).

Update the link test to cover Catalina (Darwin19/10.15) and
Big Sur (Darwin20/11.0).

gcc/ChangeLog:

* config/darwin-c.c: Allow for Darwin20 to correspond to macOS 11.
* config/darwin-driver.c: Likewise.

gcc/testsuite/ChangeLog:

* gcc.dg/darwin-minversion-link.c: Allow for Darwin19 (macOS 10.15)
and Darwin20 (macOS 11.0).

(cherry picked from commit 556ab5125912fa2233986eb19d6cd995cf7de1d2)

3 years agoDarwin: Adjust the PCH area to allow for 16384byte page size.
Iain Sandoe [Sat, 8 Aug 2020 11:15:09 +0000 (12:15 +0100)]
Darwin: Adjust the PCH area to allow for 16384byte page size.

Newer versions of Darwin report pagesize 20 which means that we
need to adjust the aligment of the PCH area.

gcc/ChangeLog:

* config/host-darwin.c: Align pch_address_space to 16384.

(cherry picked from commit 590febb5f6624f78b36402a7c9a9c318978f1efa)

3 years agoaarch64 : Remove the use of a C++11 brace-init-list.
Francois-Xavier Coudert [Mon, 21 Dec 2020 21:06:59 +0000 (21:06 +0000)]
aarch64 : Remove the use of a C++11 brace-init-list.

Instead of using a brace-init-list, set up the member values
manually.

gcc/

* config/aarch64/aarch64-builtins.c
(aarch64_init_memtag_builtins): Manually initialize instead
of using a C++11 brace-init-list.

3 years agoaarch64 : Fix a forward declaration signature to match the implementation.
Francois-Xavier Coudert [Mon, 21 Dec 2020 21:06:59 +0000 (22:06 +0100)]
aarch64 : Fix a forward declaration signature to match the implementation.

The argument types given in the forward declaration for
aarch64_get_extension_string_for_isa_flags do not match those given in the
prototype.  This leads to a build fail when 'unsigned long' is not a 64b
type.

gcc/
* config/aarch64/driver-aarch64.c
(aarch64_get_extension_string_for_isa_flags): Adjust signature.

3 years agoDaily bump.
GCC Administrator [Fri, 1 Jan 2021 00:17:02 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 31 Dec 2020 00:17:08 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 30 Dec 2020 00:17:12 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 29 Dec 2020 00:17:14 +0000 (00:17 +0000)]
Daily bump.

3 years agoi386: Fix __builtin_rint with FE_DOWNWARD rounding direction [PR96793]
Uros Bizjak [Mon, 28 Dec 2020 20:35:08 +0000 (21:35 +0100)]
i386: Fix __builtin_rint with FE_DOWNWARD rounding direction [PR96793]

x86_expand_rint expander uses x86_sse_copysign_to_positive, which
is unable to change the sign from - to +.  When FE_DOWNWARD rounding
direction is in effect, the expanded sequence that involves subtraction
can trigger x - x = -0.0 special rule.  x86_sse_copysign_to_positive
fails to change the sign of the intermediate value, assumed to always
be positive, back to positive.

The patch adds one extra fabs that strips the sign from the intermediate
value when flag_rounding_math is in effect.

2020-12-28  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/96793
* config/i386/i386-expand.c (ix86_expand_rint):
Remove the sign of the intermediate value for flag_rounding_math.

gcc/testsuite/
PR target/96793
* gcc.target/i386/pr96793-2.c: New test.

3 years agoThis patch fixes PRs 96100 and 96101.
Paul Thomas [Thu, 20 Aug 2020 17:17:59 +0000 (18:17 +0100)]
This patch fixes PRs 96100 and 96101.

2020-08-20  Paul Thomas  <pault@gcc.gnu.org>

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

gcc/testsuite/
PR fortran/96100
PR fortran/96101
* gfortran.dg/char_length_23.f90: New test.

(cherry picked from commit 300ef2fcc10e98359d14654be23bbb84a5d141e1)

3 years agoThis patch fixes PR96320. See the explanatory comment in the testcase.
Paul Thomas [Sun, 2 Aug 2020 09:57:59 +0000 (10:57 +0100)]
This patch fixes PR96320. See the explanatory comment in the testcase.

2020-08-01  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR target/96320
* interface.c (gfc_check_dummy_characteristics): If a module
procedure arrives with assumed shape in the interface and
deferred shape in the procedure itself, update the latter and
copy the lower bounds.

gcc/testsuite/
PR target/96320
* gfortran.dg/module_procedure_4.f90 : New test.

(cherry picked from commit a5baf71b0a5bd79923c095cf81218b8194008f60)

3 years agors6000: Add support for powerpc64le-unknown-freebsd
Piotr Kubaj [Wed, 16 Dec 2020 22:26:18 +0000 (22:26 +0000)]
rs6000: Add support for powerpc64le-unknown-freebsd

This implements support for powerpc64le architecture on FreeBSD.  Since
we don't have powerpcle (32-bit), I did not add support for powerpcle
here. This remains to be changed if there is powerpcle support in the
future.

2020-12-15  Piotr Kubaj  <pkubaj@FreeBSD.org>

gcc/
* config.gcc (powerpc*le-*-freebsd*): Add.
* configure.ac (powerpc*le-*-freebsd*): Ditto.
* configure: Regenerate.
* config/rs6000/freebsd64.h (ASM_SPEC_COMMON): Use ENDIAN_SELECT.
(DEFAULT_ASM_ENDIAN): Add little endian support.
(LINK_OS_FREEBSD_SPEC64): Ditto.

(cherry picked from commit 2a4183234a45ba28db5ce16cf3ccdd70cdef3b7c)

3 years agoDaily bump.
GCC Administrator [Mon, 28 Dec 2020 00:17:07 +0000 (00:17 +0000)]
Daily bump.

3 years agoPR fortran/93685 - ICE in gfc_constructor_append_expr, at fortran/constructor.c:135
Harald Anlauf [Fri, 25 Dec 2020 14:40:39 +0000 (15:40 +0100)]
PR fortran/93685 - ICE in gfc_constructor_append_expr, at fortran/constructor.c:135

Fix handling of F2018 enhancements to DATA statements that allows
initialization of pointer components to derived types, and adjust error
handling for the CHARACTER case.

gcc/fortran/ChangeLog:

* data.c (gfc_assign_data_value): Restrict use of
create_character_initializer to constant initializers.
* trans-expr.c (gfc_conv_initializer): Ensure that character
initializer is constant, otherwise fall through to get the same
error handling as for non-character cases.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr93685_1.f90: New test.
* gfortran.dg/pr93685_2.f90: New test.

(cherry picked from commit 6e36772ba6a8173318c173508bd3254e4140b726)

3 years agoDaily bump.
GCC Administrator [Sun, 27 Dec 2020 00:17:01 +0000 (00:17 +0000)]
Daily bump.

3 years agolibobjc, Darwin : Fix powerpc encoding regression.
Iain Sandoe [Sun, 11 Oct 2020 14:36:13 +0000 (15:36 +0100)]
libobjc, Darwin : Fix powerpc encoding regression.

This corrects a typo in the recipe for the special type alignment
rules that are used for 32bit powerpc Darwin platforms.

libobjc/ChangeLog:

* encoding.c (_darwin_rs6000_special_round_type_align):
Use DFMode in the emulation of the special round type.

(cherry picked from commit dcd9800fcd42489034c0774247eb898d79b1ea2d)

3 years agoDaily bump.
GCC Administrator [Sat, 26 Dec 2020 00:16:58 +0000 (00:16 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 25 Dec 2020 00:17:11 +0000 (00:17 +0000)]
Daily bump.

3 years agoDarwin, libgfortran : Do not use environ directly from the library.
Iain Sandoe [Sat, 21 Nov 2020 09:06:03 +0000 (09:06 +0000)]
Darwin, libgfortran : Do not use environ directly from the library.

On macOS / Darwin, the environ variable can be used directly in the
code of an executable, but cannot be used in the code of a shared
library (i.e. libgfortran.dylib), in this case.

In such cases, the  function _NSGetEnviron should be called to get
the address of 'environ'.

libgfortran/ChangeLog:

* intrinsics/execute_command_line.c (environ): Use
_NSGetEnviron to get the environment pointer on Darwin.

(cherry picked from commit a3454130760bf51b76495663c60ac6dffbe3d130)

3 years agomodulo-sched: Carefully process loop counter initialization [PR97421]
Roman Zhuykov [Thu, 24 Dec 2020 16:43:40 +0000 (19:43 +0300)]
modulo-sched: Carefully process loop counter initialization [PR97421]

Do not allow direct adjustment of pre-header initialization instruction for
count register if is read in some instruction below in that basic block.

gcc/ChangeLog:

PR rtl-optimization/97421
* modulo-sched.c (generate_prolog_epilog): Remove forward
declaration, adjust last argument name and type.
(const_iteration_count): Add bool pointer parameter to return
whether count register is read in pre-header after its
initialization.
(sms_schedule): Fix count register initialization adjustment
procedure according to what const_iteration_count said.

gcc/testsuite/ChangeLog:

PR rtl-optimization/97421
* gcc.c-torture/execute/pr97421-1.c: New test.
* gcc.c-torture/execute/pr97421-2.c: New test.
* gcc.c-torture/execute/pr97421-3.c: New test.

(cherry picked from commit 4eb8f93d026eaa1de9b4820337069f3ce3465cd0)

3 years agoDaily bump.
GCC Administrator [Thu, 24 Dec 2020 00:17:15 +0000 (00:17 +0000)]
Daily bump.

3 years agoc++: Fix constexpr array ICE [PR98332]
Jason Merrill [Tue, 22 Dec 2020 21:40:37 +0000 (16:40 -0500)]
c++: Fix constexpr array ICE [PR98332]

The element initializer was non-constant, so its CONSTRUCTOR element ended
up NULL, so unshare_constructor crashed trying to look at it.  This patch
fixes this in two places: First, by returning when we see a non-constant
initializer; second, by not crashing on NULL.

gcc/cp/ChangeLog:

PR c++/98332
* constexpr.c (unshare_constructor): Check for NULL.
(cxx_eval_vec_init_1): Always exit early if non-constant.

gcc/testsuite/ChangeLog:

PR c++/98332
* g++.dg/cpp0x/constexpr-overflow3.C: New test.

3 years agoc++: Copy elision and [[no_unique_address]]. [PR93711]
Jason Merrill [Wed, 12 Aug 2020 09:45:02 +0000 (05:45 -0400)]
c++: Copy elision and [[no_unique_address]]. [PR93711]

We don't elide a copy from a function returning a class by value into a base
because that can overwrite data laid out in the tail padding of the base
class; we need to handle [[no_unique_address]] fields the same way, or we
ICE when the middle-end wants to create a temporary object of a
TYPE_NEEDS_CONSTRUCTING type.

This means that we can't always express initialization of a field with
INIT_EXPR from a TARGET_EXPR the way we usually do, so I needed
to change several places that were assuming that was sufficient.

This also fixes 90254, the same problem with C++17 aggregate initialization
of a base.

gcc/cp/ChangeLog:

PR c++/90254
PR c++/93711
* cp-tree.h (unsafe_return_slot_p): Declare.
* call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
(build_over_call): Check unsafe_return_slot_p.
(build_special_member_call): Likewise.
* init.c (expand_default_init): Likewise.
* typeck2.c (split_nonconstant_init_1): Likewise.

gcc/testsuite/ChangeLog:

PR c++/90254
PR c++/93711
* g++.dg/cpp1z/aggr-base10.C: New test.
* g++.dg/cpp2a/no_unique_address7.C: New test.
* g++.dg/cpp2a/no_unique_address7a.C: New test.

3 years agors6000: Update the processor defaults for FreeBSD
Gerald Pfeifer [Sun, 13 Dec 2020 00:00:36 +0000 (01:00 +0100)]
rs6000: Update the processor defaults for FreeBSD

gcc/ChangeLog:

2020-12-13  Piotr Kubaj  <pkubaj@FreeBSD.org>
    Gerald Pfeifer  <gerald@pfeifer.com>

* config/rs6000/freebsd64.h (PROCESSOR_DEFAULT): Update
to PROCESSOR_PPC7450.
(PROCESSOR_DEFAULT64): Update to PROCESSOR_POWER8.

3 years agoi386: Fix __builtin_trunc with FE_DOWNWARD rounding direction [PR96793]
Uros Bizjak [Wed, 23 Dec 2020 17:32:28 +0000 (18:32 +0100)]
i386: Fix __builtin_trunc with FE_DOWNWARD rounding direction [PR96793]

x86_expand_truncdf_32 expander uses x86_sse_copysign_to_positive, which
is unable to change the sign from - to +.  When FE_DOWNWARD rounding
direction is in effect, the expanded sequence that involves subtraction
can trigger x - x = -0.0 special rule.  x86_sse_copysign_to_positive
fails to change the sign of the intermediate value, assumed to always
be positive, back to positive.

The patch adds one extra fabs that strips the sign from the intermediate
value when flag_rounding_math is in effect.

2020-12-23  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/96793
* config/i386/i386-expand.c (ix86_expand_truncdf_32):
Remove the sign of the intermediate value for flag_rounding_math.

gcc/testsuite/
PR target/96793
* gcc.target/i386/pr96793-1.c: New test.

3 years agoDaily bump.
GCC Administrator [Wed, 23 Dec 2020 00:17:15 +0000 (00:17 +0000)]
Daily bump.

3 years agoi386: Fix __builtin_floor with FE_DOWNWARD rounding direction [PR96793]
Uros Bizjak [Tue, 22 Dec 2020 20:11:51 +0000 (21:11 +0100)]
i386: Fix __builtin_floor with FE_DOWNWARD rounding direction [PR96793]

x86_expand_floorceil expander uses x86_sse_copysign_to_positive, which
is unable to change the sign from - to +.  When FE_DOWNWARD rounding
direction is in effect, the expanded sequence that involves subtraction
can trigger x - x = -0.0 special rule.  x86_sse_copysign_to_positive
fails to change the sign of the intermediate value, assumed to always
be positive, back to positive.

The patch adds one extra fabs that strips the sign from the intermediate
value when flag_rounding_math is in effect.

2020-12-22  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/96793
* config/i386/i386-expand.c (ix86_expand_floorceil):
Remove the sign of the intermediate value for flag_rounding_math.
(ix86_expand_floorceildf_32): Ditto.

gcc/testsuite/
PR target/96793
* gcc.target/i386/pr96793.c: New test.

3 years agoDaily bump.
GCC Administrator [Tue, 22 Dec 2020 00:17:12 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 21 Dec 2020 00:17:07 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 20 Dec 2020 00:17:06 +0000 (00:17 +0000)]
Daily bump.

3 years agoPR fortran/98307 - Dependency check fails when using "allocatable"
Harald Anlauf [Thu, 17 Dec 2020 09:31:55 +0000 (10:31 +0100)]
PR fortran/98307 - Dependency check fails when using "allocatable"

The dependency check for FORALL constructs already handled pointer
components to derived types, but missed allocatables.  Fix that.

gcc/fortran/ChangeLog:

PR fortran/98307
* trans-stmt.c (check_forall_dependencies): Extend dependency
check to allocatable components of derived types.

gcc/testsuite/ChangeLog:

PR fortran/98307
* gfortran.dg/forall_19.f90: New test.

(cherry picked from commit c09deceb534b82ce144af3a345dcb06ab5e49ba4)

3 years agoDaily bump.
GCC Administrator [Sat, 19 Dec 2020 00:17:09 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 18 Dec 2020 00:17:07 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 17 Dec 2020 00:17:13 +0000 (00:17 +0000)]
Daily bump.

3 years agoc++: Fix template parm ICE [PR 98297]
Nathan Sidwell [Wed, 16 Dec 2020 19:49:41 +0000 (11:49 -0800)]
c++: Fix template parm ICE [PR 98297]

I think this is nonsense code, we seem to be naming an instantiation
of a template template parm.  But this fixes the ICE.  Perhaps we
should diagnose the issue earlier?

gcc/cp/
* parser.c (cp_parser_elaborated_type_specifier): Test
BOUND_TEMPLATE_TEMPLATE_PARM before checking for instantiation.
gcc/testsuite/
* g++.dg/template/pr98297.C: New.

3 years agoDaily bump.
GCC Administrator [Wed, 16 Dec 2020 00:17:07 +0000 (00:17 +0000)]
Daily bump.

3 years agod: Fix ICE in gimplify_expr, at gimplify.c (PR98277)
Iain Buclaw [Tue, 15 Dec 2020 09:36:00 +0000 (10:36 +0100)]
d: Fix ICE in gimplify_expr, at gimplify.c (PR98277)

The DMD front-end shouldn't, but can sometimes leak manifest constants
in the AST passed to the code generator.  To prevent this being an
issue, the setting of DECL_INITIAL has been moved to the point where the
CONST_DECL is used, rather than in the declaration handler.

gcc/d/ChangeLog:

PR d/98277
* decl.cc (DeclVisitor::visit (VarDeclaration *)): Move setting of
DECL_INITIAL for manifest constants to ...
(get_symbol_decl): ... here.

gcc/testsuite/ChangeLog:

PR d/98277
* gdc.dg/pr98277.d: New test.

(cherry picked from commit 36c9a3fe3f3c200ad3937d00d339b7269cf07adb)

3 years agoira.c: Fix ICE in ira-color [PR97092]
Andrea Corallo [Wed, 9 Dec 2020 16:59:12 +0000 (17:59 +0100)]
ira.c: Fix ICE in ira-color [PR97092]

2020-12-10  Andrea Corallo  <andrea.corallo@arm.com>

gcc/ChangeLog

2020-12-10  Andrea Corallo  <andrea.corallo@arm.com>

PR rtl-optimization/97092
* ira-color.c (update_costs_from_allocno): Do not carry over mode
between subsequent iterations.

gcc/testsuite/ChangeLog

2020-12-10  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/aarch64/sve/pr97092.c: New test.

3 years agoDaily bump.
GCC Administrator [Tue, 15 Dec 2020 00:17:16 +0000 (00:17 +0000)]
Daily bump.

3 years agoAArch64: Add support for --with-tune
Wilco Dijkstra [Thu, 3 Dec 2020 18:40:34 +0000 (18:40 +0000)]
AArch64: Add support for --with-tune

Add support for --with-tune. Like --with-cpu and --with-arch, the argument is
validated and transformed into a -mtune option to be processed like any other
command-line option.  --with-tune has no effect if a -mcpu or -mtune option
is used. The validating code didn't allow --with-cpu=native, so explicitly
allow that.

Co-authored-by: Delia Burduv <delia.burduv@arm.com>
Bootstrap OK, regress pass, OK to commit?

2020-09-03  Wilco Dijkstra  <wdijkstr@arm.com>

gcc/
* config.gcc (aarch64*-*-*): Add --with-tune. Support --with-cpu=native.
* config/aarch64/aarch64.h (OPTION_DEFAULT_SPECS): Add --with-tune.

gcc/testsuite/
* lib/target-supports.exp (check_effective_target_tune_cortex_a76): New
effective target test.
* gcc.target/aarch64/with-tune-config.c: New test.
* gcc.target/aarch64/with-tune-march.c: Likewise.
* gcc.target/aarch64/with-tune-mcpu.c: Likewise.
* gcc.target/aarch64/with-tune-mtune.c: Likewise.

3 years agodisable --with-{cpu,arch,tune}-32
Sebastian Pop [Thu, 3 Dec 2020 17:35:18 +0000 (17:35 +0000)]
disable --with-{cpu,arch,tune}-32

gcc/
* config.gcc (aarch64*-*-*): Remove --with-{cpu,arch,tune}-32 flags.

3 years agoDaily bump.
GCC Administrator [Mon, 14 Dec 2020 09:02:33 +0000 (09:02 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 13 Dec 2020 00:16:57 +0000 (00:16 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 12 Dec 2020 00:17:10 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 11 Dec 2020 18:23:32 +0000 (18:23 +0000)]
Daily bump.

3 years agoaarch64: intrinsics to extract half of bf16 vector
Dennis Zhang [Fri, 11 Dec 2020 16:18:05 +0000 (16:18 +0000)]
aarch64: intrinsics to extract half of bf16 vector

This patch implements ACLE intrinsics vget_low_bf16 and vget_high_bf16
to extract lower or higher half from a bfloat16x8 vector. The
vget_high_bf16 is done by 'dup' instruction. The vget_low_bf16 is just
to return the lower half of a vector register. Tests include both big-
and little-endian cases.

gcc/ChangeLog:

* config/aarch64/aarch64-simd-builtins.def (vget_lo_half): New entry.
(vget_hi_half): Likewise.
* config/aarch64/aarch64-simd.md (aarch64_vget_lo_halfv8bf): New entry.
(aarch64_vget_hi_halfv8bf): Likewise.
* config/aarch64/arm_neon.h (vget_low_bf16): New intrinsic.
(vget_high_bf16): Likewise.

gcc/testsuite/ChangeLog

* gcc.target/aarch64/advsimd-intrinsics/bf16_get.c: New test.

(cherry picked from commit 3553c658533e430b232997bdfd97faf6606fb102)

3 years agoaarch64: intrinsics to convert BFloat16 to Float32
Dennis Zhang [Fri, 11 Dec 2020 15:10:58 +0000 (15:10 +0000)]
aarch64: intrinsics to convert BFloat16 to Float32

gcc/ChangeLog:

* config/aarch64/aarch64-simd-builtins.def(vbfcvt): New entry.
(vbfcvt_high, bfcvt): Likewise.
* config/aarch64/aarch64-simd.md(aarch64_vbfcvt<mode>): New entry.
(aarch64_vbfcvt_highv8bf, aarch64_bfcvtsf): Likewise.
* config/aarch64/arm_bf16.h (vcvtah_f32_bf16): New intrinsic.
* config/aarch64/arm_neon.h (vcvt_f32_bf16): Likewise.
(vcvtq_low_f32_bf16, vcvtq_high_f32_bf16): Likewise.

gcc/testsuite/ChangeLog

* gcc.target/aarch64/advsimd-intrinsics/bfcvt-compile.c
(test_vcvt_f32_bf16, test_vcvtq_low_f32_bf16): New tests.
(test_vcvtq_high_f32_bf16, test_vcvth_f32_bf16): Likewise.

(cherry picked from commit f7d6961126a7f06c8089d8a58bd21be43bc16806)

3 years agoarm: Add vstN_lane_bf16 + vstNq_lane_bf16 intrisics
Andrea Corallo [Thu, 29 Oct 2020 10:20:23 +0000 (11:20 +0100)]
arm: Add vstN_lane_bf16 + vstNq_lane_bf16 intrisics

gcc/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm_neon.h (vst2_lane_bf16, vst2q_lane_bf16)
(vst3_lane_bf16, vst3q_lane_bf16, vst4_lane_bf16)
(vst4q_lane_bf16): New intrinsics.
* config/arm/arm_neon_builtins.def: Touch it for:
__builtin_neon_vst2_lanev4bf, __builtin_neon_vst2_lanev8bf,
__builtin_neon_vst3_lanev4bf, __builtin_neon_vst3_lanev8bf,
__builtin_neon_vst4_lanev4bf,__builtin_neon_vst4_lanev8bf.

gcc/testsuite/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/aarch64/advsimd-intrinsics/vst2_lane_bf16_indices_1.c:
Run it also for arm-*-*.
* gcc.target/aarch64/advsimd-intrinsics/vst2q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vst3_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vst3q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vst4_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vst4q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/arm/simd/vstn_lane_bf16_1.c: New test.

3 years agoarm: Add vldN_lane_bf16 + vldNq_lane_bf16 intrisics
Andrea Corallo [Mon, 26 Oct 2020 17:31:19 +0000 (18:31 +0100)]
arm: Add vldN_lane_bf16 + vldNq_lane_bf16 intrisics

gcc/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm_neon.h (vld2_lane_bf16, vld2q_lane_bf16)
(vld3_lane_bf16, vld3q_lane_bf16, vld4_lane_bf16)
(vld4q_lane_bf16): Add intrinsics.
* config/arm/arm_neon_builtins.def: Touch for:
__builtin_neon_vld2_lanev4bf, __builtin_neon_vld2_lanev8bf,
__builtin_neon_vld3_lanev4bf, __builtin_neon_vld3_lanev8bf,
__builtin_neon_vld4_lanev4bf, __builtin_neon_vld4_lanev8bf.
* config/arm/iterators.md (VQ_HS): Add V8BF to the iterator.

gcc/testsuite/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/aarch64/advsimd-intrinsics/vld2_lane_bf16_indices_1.c:
Run it also for the arm backend.
* gcc.target/aarch64/advsimd-intrinsics/vld2q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vld3_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vld3q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vld4_lane_bf16_indices_1.c:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vld4q_lane_bf16_indices_1.c:
Likewise.
* gcc.target/arm/simd/vldn_lane_bf16_1.c: New test.

3 years agoarm: Add vst1_bf16 + vst1q_bf16 intrinsics
Andrea Corallo [Thu, 29 Oct 2020 14:11:37 +0000 (15:11 +0100)]
arm: Add vst1_bf16 + vst1q_bf16 intrinsics

gcc/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm_neon.h (vst1_bf16, vst1q_bf16): Add intrinsics.
* config/arm/arm_neon_builtins.def : Touch for:
__builtin_neon_vst1v4bf, __builtin_neon_vst1v8bf.

gcc/testsuite/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/arm/simd/vst1_bf16_1.c: New test.

3 years agoarm: Add vld1_bf16 + vld1q_bf16 intrinsics
Andrea Corallo [Thu, 29 Oct 2020 12:56:17 +0000 (13:56 +0100)]
arm: Add vld1_bf16 + vld1q_bf16 intrinsics

gcc/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm-builtins.c (VAR14): Define macro.
* config/arm/arm_neon_builtins.def: Touch for:
__builtin_neon_vld1v4bf, __builtin_neon_vld1v8bf.
* config/arm/arm_neon.h (vld1_bf16, vld1q_bf16): Add intrinsics.

gcc/testsuite/ChangeLog

2020-10-29  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/arm/simd/vld1_bf16_1.c: New test.

3 years agoarm: Add vst1_lane_bf16 + vstq_lane_bf16 intrinsics
Andrea Corallo [Fri, 23 Oct 2020 12:21:56 +0000 (14:21 +0200)]
arm: Add vst1_lane_bf16 + vstq_lane_bf16 intrinsics

gcc/ChangeLog

2020-10-23  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm_neon.h (vst1_lane_bf16, vst1q_lane_bf16): Add
intrinsics.
* config/arm/arm_neon_builtins.def (STORE1LANE): Add v4bf, v8bf.

gcc/testsuite/ChangeLog

2020-10-23  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/arm/simd/vst1_lane_bf16_1.c: New testcase.
* gcc.target/arm/simd/vstq1_lane_bf16_indices_1.c: Likewise.
* gcc.target/arm/simd/vst1_lane_bf16_indices_1.c: Likewise.

3 years agoarm: Add vld1_lane_bf16 + vldq_lane_bf16 intrinsics
Andrea Corallo [Wed, 21 Oct 2020 09:16:01 +0000 (11:16 +0200)]
arm: Add vld1_lane_bf16 + vldq_lane_bf16 intrinsics

gcc/ChangeLog

2020-10-21  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm_neon_builtins.def: Add to LOAD1LANE v4bf, v8bf.
* config/arm/arm_neon.h (vld1_lane_bf16, vld1q_lane_bf16): Add
intrinsics.

gcc/testsuite/ChangeLog

2020-10-21  Andrea Corallo  <andrea.corallo@arm.com>

* gcc.target/arm/simd/vld1_lane_bf16_1.c: New testcase.
* gcc.target/arm/simd/vld1_lane_bf16_indices_1.c: Likewise.
* gcc.target/arm/simd/vld1q_lane_bf16_indices_1.c: Likewise.

3 years agoFix PR ada/98230
Ed Schonberg [Thu, 10 Dec 2020 21:26:57 +0000 (22:26 +0100)]
Fix PR ada/98230

It's a rather curious malfunction of the 'Mod attribute applied to the
variable of a loop whose upper bound is dynamic.

gcc/ada/ChangeLog:
PR ada/98230
* exp_attr.adb (Expand_N_Attribute_Reference, case Mod): Use base
type of argument to obtain static bound and required size.

gcc/testsuite/ChangeLog:
* gnat.dg/modular6.adb: New test.

3 years agoc++: overload sets and placeholder return type [PR64194]
Patrick Palka [Thu, 30 Jul 2020 02:06:44 +0000 (22:06 -0400)]
c++: overload sets and placeholder return type [PR64194]

In the testcase below, template argument deduction for the call
g(id<int>) goes wrong because the functions in the overload set id<int>
each have a yet-undeduced auto return type, and this undeduced return
type makes try_one_overload fail to match up any of the overloads with
g's parameter type, leading to g's template argument going undeduced and
to the overload set going unresolved.

This patch fixes this issue by performing return type deduction via
instantiation before doing try_one_overload, in a manner similar to what
resolve_address_of_overloaded_function does.

gcc/cp/ChangeLog:

PR c++/64194
* pt.c (resolve_overloaded_unification): If the function
template specialization has a placeholder return type,
then instantiate it before attempting unification.

gcc/testsuite/ChangeLog:

PR c++/64194
* g++.dg/cpp1y/auto-fn60.C: New test.

(cherry picked from commit 2c58f5cadfac338a67723fd6e41c9097760c4a33)

3 years agoDaily bump.
GCC Administrator [Thu, 10 Dec 2020 00:17:24 +0000 (00:17 +0000)]
Daily bump.

3 years agooptions: Make --help= see overridden values
Kewen Lin [Wed, 19 Aug 2020 02:37:39 +0000 (21:37 -0500)]
options: Make --help= see overridden values

Options "-Q --help=params" don't show the final values after
target option overriding, instead it emits the default values
in params.opt (without any explicit param settings).

This patch makes it see overridden values.

gcc/ChangeLog:

* opts-global.c (decode_options): Call target_option_override_hook
before it prints for --help=*.

(cherry picked from commit a7bbb5b1b1eb09db8175130474e8da952f30404b)

3 years agoc++: Fix deduction from auto template parameter [PR93083]
Jason Merrill [Wed, 25 Nov 2020 22:05:24 +0000 (17:05 -0500)]
c++: Fix deduction from auto template parameter [PR93083]

The check in do_class_deduction to handle passing one class placeholder
template parm as an argument for itself needed to be extended to also handle
equivalent parms from other templates.

gcc/cp/ChangeLog:

PR c++/93083
* pt.c (convert_template_argument): Handle equivalent placeholders.
(do_class_deduction): Look through EXPR_PACK_EXPANSION, too.

gcc/testsuite/ChangeLog:

PR c++/93083
* g++.dg/cpp2a/nontype-class40.C: New test.

3 years agoDaily bump.
GCC Administrator [Wed, 9 Dec 2020 00:17:28 +0000 (00:17 +0000)]
Daily bump.

3 years agoarm: Fix unwanted fall-throughs in arm.c
Andrea Corallo [Wed, 27 May 2020 16:43:48 +0000 (17:43 +0100)]
arm: Fix unwanted fall-throughs in arm.c

gcc/ChangeLog

2020-05-28  Andrea Corallo  <andrea.corallo@arm.com>

* config/arm/arm.c (mve_vector_mem_operand): Fix unwanted
fall-throughs.

3 years agoFix PR target/96470
Eric Botcazou [Tue, 8 Dec 2020 08:19:36 +0000 (09:19 +0100)]
Fix PR target/96470

This forces the scalarization of the testcase on PowerPC.

gcc/testsuite/ChangeLog:
PR target/96470
* gnat.dg/opt39.adb: Add dg-additional-options for PowerPC.

3 years agoFix internal error on library-level type extended locally
Eric Botcazou [Mon, 7 Dec 2020 09:48:06 +0000 (10:48 +0100)]
Fix internal error on library-level type extended locally

The compiler aborts on the local extension of a tagged type declared
at library level, with a progenitor given by an interface type having
a primitive that is a homograph of a primitive of the tagged type.

gcc/ada/ChangeLog:
* gcc-interface/trans.c (maybe_make_gnu_thunk): Return false if the
target is local and thunk and target do not have the same context.

3 years agoDaily bump.
GCC Administrator [Tue, 8 Dec 2020 00:17:23 +0000 (00:17 +0000)]
Daily bump.

3 years agoFix assembler name collision
Eric Botcazou [Mon, 7 Dec 2020 09:40:23 +0000 (10:40 +0100)]
Fix assembler name collision

Gigi uses a dummy global variable to register global types for debug
info purposes and its name can now collide with user variables.

gcc/ada/ChangeLog:
* gcc-interface/utils.c (gnat_write_global_declarations): Use the
maximum index for the dummy object to avoid a name collision.

3 years agoDaily bump.
GCC Administrator [Mon, 7 Dec 2020 00:16:59 +0000 (00:16 +0000)]
Daily bump.

3 years agoPR fortran/98017 - Suspected regression using PACK
Harald Anlauf [Sun, 29 Nov 2020 22:23:16 +0000 (23:23 +0100)]
PR fortran/98017 - Suspected regression using PACK

When substituting a parameter variable of type character, the character
length was reset to 1.  Fix this by copying the length.

gcc/fortran/ChangeLog:

* expr.c (simplify_parameter_variable): Fix up character length
after copying an array-valued expression.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr98017.f90: New test.

(cherry picked from commit bb67ad5cff58a707aaae645d4f45a913d8511c86)

3 years agoDaily bump.
GCC Administrator [Sun, 6 Dec 2020 00:17:22 +0000 (00:17 +0000)]
Daily bump.

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

3 years agoPR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
Harald Anlauf [Thu, 3 Dec 2020 19:33:22 +0000 (20:33 +0100)]
PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913

Add checks for NULL pointers before dereferencing them.

gcc/fortran/ChangeLog:

PR fortran/95342
* decl.c (gfc_match_function_decl): Avoid NULL pointer dereference.
(gfc_match_subroutine): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/95342
* gfortran.dg/pr95342.f90: New test.

(cherry picked from commit 30b606bb9b9314010a446ea4bed3481632008f75)

3 years agodoc/implement-c.texi: About same-as-scalar-type volatile aggregate accesses, PR94600
Hans-Peter Nilsson [Fri, 4 Dec 2020 19:27:23 +0000 (20:27 +0100)]
doc/implement-c.texi: About same-as-scalar-type volatile aggregate accesses, PR94600

We say very little about reads and writes to aggregate /
compound objects, just scalar objects (i.e. assignments don't
cause reads).  Let's lets say something safe about aggregate
objects, but only for those that are the same size as a scalar
type.

There's an equal-sounding section (Volatiles) in extend.texi,
but this seems a more appropriate place, as specifying the
behavior of a standard qualifier.

gcc:

2020-12-04  Hans-Peter Nilsson  <hp@axis.com>
    Martin Sebor  <msebor@redhat.com>

PR middle-end/94600
* doc/implement-c.texi (Qualifiers implementation): Add blurb
about access to the whole of a volatile aggregate object, only for
same-size as a scalar object.

(cherry picked from commit eb79f4db49c5f5a807555e9d374524664eb537bf)

3 years agotree-optimization/96075 - adjust testcase
Richard Biener [Fri, 4 Dec 2020 10:39:44 +0000 (11:39 +0100)]
tree-optimization/96075 - adjust testcase

This adds an XFAIL when load-lanes can be used.

2020-12-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96075
* gcc.dg/vect/slp-46.c: Add XFAIL for load-lanes.

3 years agoFix checking failure in IPA-SRA
Eric Botcazou [Fri, 4 Dec 2020 09:04:56 +0000 (10:04 +0100)]
Fix checking failure in IPA-SRA

This is a regression present on the mainline and 10 branch: on the one
hand, IPA-SRA does *not* disqualify accesses with zero size but, on the
other hand, it checks that accesses present in the tree have a (strictly)
positive size, thus trivially yielding an ICE in some cases.

gcc/ChangeLog:
* ipa-sra.c (verify_access_tree_1): Relax assertion on the size.

gcc/testsuite/ChangeLog:
* gnat.dg/opt91.ads, gnat.dg/opt91.adb: New test.
* gnat.dg/opt91_pkg.ads, gnat.dg/opt91_pkg.adb: New helper.

3 years agoDaily bump.
GCC Administrator [Fri, 4 Dec 2020 00:17:14 +0000 (00:17 +0000)]
Daily bump.

3 years agolibstdc++: Update powerpc-linux baselines for GCC 10.1
Jonathan Wakely [Thu, 3 Dec 2020 17:18:28 +0000 (17:18 +0000)]
libstdc++: Update powerpc-linux baselines for GCC 10.1

This should have been done before the GCC 10.1 release.

libstdc++-v3/ChangeLog:

* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt:
Update.
* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt:
Update.

(cherry picked from commit 3843fa2d75a76ca64d3366950f0ac3d7d4729c4c)

3 years agoi386: Fix up ix86_md_asm_adjust for TImode [PR98086]
Uros Bizjak [Thu, 3 Dec 2020 16:49:42 +0000 (17:49 +0100)]
i386: Fix up ix86_md_asm_adjust for TImode [PR98086]

ix86_md_asm_adjust assumes that dest_mode can be only [QHSD]Imode
and nothing else.  The patch rewrites zero-extension part to use
convert_to_mode to handle TImode and hypothetically even wider modes.

2020-12-03  Uroš Bizjak  <ubizjak@gmail.com>
    Jakub Jelinek  <jakub@redhat.com>

gcc/
PR target/98086
* config/i386/i386.c (ix86_md_asm_adjustmd): Rewrite
zero-extension part to use convert_to_mode.

gcc/testsuite/
PR target/98086
* gcc.target/i386/pr98086.c: New test.

(cherry picked from commit 756f55e62f73eb32787497eb9e564d4b21a6e637)

3 years agoRTEMS: Add Cortex-R52 multilib
Sebastian Huber [Thu, 3 Dec 2020 08:30:56 +0000 (09:30 +0100)]
RTEMS: Add Cortex-R52 multilib

gcc/
* config/arm/t-rtems: Add "-mthumb -mcpu=cortex-r52
-mfloat-abi=hard" multilib.

(cherry picked from commit 2fb287056e6a709b8028cdf368c313ebe89877db)

3 years agoexpr: Fix REDUCE_BIT_FIELD for constants [PR95694, PR96151]
Richard Sandiford [Thu, 3 Dec 2020 10:23:25 +0000 (10:23 +0000)]
expr: Fix REDUCE_BIT_FIELD for constants [PR95694, PR96151]

This is yet another PR caused by constant integer rtxes not storing
a mode.  We were calling REDUCE_BIT_FIELD on a constant integer that
didn't fit in poly_int64, and then tripped the as_a<scalar_int_mode>
assert on VOIDmode.

AFAICT REDUCE_BIT_FIELD is always passed rtxes that have TYPE_MODE
(rather than some other mode) and it just fills in the redundant
sign bits of that TYPE_MODE value.  So it should be safe to get
the mode from the type instead of the rtx.  The patch does that
and asserts that the modes agree, where information is available.

That on its own is enough to fix the bug, but we might as well
extend the folding case to all constant integers, not just those
that fit poly_int64.

gcc/
PR middle-end/95694
* expr.c (expand_expr_real_2): Get the mode from the type rather
than the rtx, and assert that it is consistent with the mode of
the rtx (where known).  Optimize all constant integers, not just
those that can be represented in poly_int64.

gcc/testsuite/
PR middle-end/95694
* gcc.dg/pr95694.c: New test.

(cherry picked from commit 760df6d296b8fc59796f42dca5eb14012fbfa28b)

3 years agoDaily bump.
GCC Administrator [Thu, 3 Dec 2020 00:17:26 +0000 (00:17 +0000)]
Daily bump.

3 years agovalue-range: Give up on POLY_INT_CST ranges [PR97457]
Richard Sandiford [Wed, 2 Dec 2020 18:39:24 +0000 (18:39 +0000)]
value-range: Give up on POLY_INT_CST ranges [PR97457]

This PR shows another problem with calculating value ranges for
POLY_INT_CSTs.  We have:

  ivtmp_76 = ASSERT_EXPR <ivtmp_60, ivtmp_60 > POLY_INT_CST [9, 4294967294]>

where the VQ coefficient is unsigned but is effectively acting
as a negative number.  We wrongly give the POLY_INT_CST the range:

  [9, INT_MAX]

and things go downhill from there: later iterations of the unrolled
epilogue are wrongly removed as dead.

I guess this is the final nail in the coffin for doing VRP on
POLY_INT_CSTs.  For other similarly exotic testcases we could have
overflow for any coefficient, not just those that could be treated
as contextually negative.

Testing TYPE_OVERFLOW_UNDEFINED doesn't seem like an option because we
couldn't handle warn_strict_overflow properly.  At this stage we're
just recording a range that might or might not lead to strict-overflow
assumptions later.

It still feels like we should be able to do something here, but for
now removing the code seems safest.  It's also telling that there
are no testsuite failures on SVE from doing this.

gcc/
PR tree-optimization/97457
* value-range.cc (irange::set): Don't decay POLY_INT_CST ranges
to integer ranges.

gcc/testsuite/
PR tree-optimization/97457
* gcc.dg/vect/pr97457.c: New test.

(cherry picked from commit 54ef7701a9dec8c923a12d1983f8a051ba88a7b9)

3 years agoaarch64: Remove aarch64_sve_pred_dominates_p
Richard Sandiford [Wed, 2 Dec 2020 16:20:36 +0000 (16:20 +0000)]
aarch64: Remove aarch64_sve_pred_dominates_p

In r11-2922, Przemek fixed a post-RA instruction match failure
caused by the SVE FP subtraction patterns..  This patch applies
the same fix to the other patterns.

To recap, the issue is around the handling of predication.
We want to do two things:

- Optimise cases in which a predicate is known to be all-true.

- Differentiate cases in which the predicate on an _x ACLE function has
  to be kept as-is from cases in which we can make more lanes active.
  The former is true by default, the latter is true for certain
  combinations of flags in the -ffast-math group.

This is handled by a boolean flag in the unspecs to say whether the
predicate is “strict” or “relaxed”.  When combining multiple strict
operations, the predicates used in the operations generally need to
match.  When combining multiple relaxed operations, we can ignore the
predicates on nested operations and just use the predicate on the
“outermost” operation.

Originally I'd tried to reduce combinatorial explosion by using
aarch64_sve_pred_dominates_p.  This required matching predicates
for strict operations but allowed more combinations for relaxed
operations.

The problem (as I should have remembered) is that C conditions on
insn patterns can't reliably enforce matching operands.  If the
same register is used in two different input operands, the RA is
allowed to use different hard registers for those input operands
(and sometimes it has to).  So operands that match before RA
might not match afterwards.  The only sure way to force a match
is via match_dup.

This patch splits the cases into two.  I cry bitter tears at having
to do this, but I think it's the only backportable fix.  There might
be some way of using define_subst to generate the cond_* patterns from
the pred_* patterns, with some alternatives strategically disabled in
each case, but that's future work and might not be an improvement.

Since so many patterns now do this, I moved the comments from the
subtraction pattern to a new banner comment at the head of the file.

gcc/
* config/aarch64/aarch64-protos.h (aarch64_sve_pred_dominates_p):
Delete.
* config/aarch64/aarch64.c (aarch64_sve_pred_dominates_p): Likewise.
* config/aarch64/aarch64-sve.md: Add banner comment describing
how merging predicated FP operations are represented.
(*cond_<SVE_COND_FP_UNARY:optab><mode>_2): Split into...
(*cond_<SVE_COND_FP_UNARY:optab><mode>_2_relaxed): ...this and...
(*cond_<SVE_COND_FP_UNARY:optab><mode>_2_strict): ...this.
(*cond_<SVE_COND_FP_UNARY:optab><mode>_any): Split into...
(*cond_<SVE_COND_FP_UNARY:optab><mode>_any_relaxed): ...this and...
(*cond_<SVE_COND_FP_UNARY:optab><mode>_any_strict): ...this.
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_2): Split into...
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_2_relaxed): ...this and...
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_2_strict): ...this.
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_any): Split into...
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_any_relaxed): ...this
and...
(*cond_<SVE_COND_FP_BINARY_INT:optab><mode>_any_strict): ...this.
(*cond_<SVE_COND_FP_BINARY:optab><mode>_2): Split into...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_2_relaxed): ...this and...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_2_strict): ...this.
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_2_const): Split into...
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_2_const_relaxed): ...this
and...
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_2_const_strict): ...this.
(*cond_<SVE_COND_FP_BINARY:optab><mode>_3): Split into...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_3_relaxed): ...this and...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_3_strict): ...this.
(*cond_<SVE_COND_FP_BINARY:optab><mode>_any): Split into...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_any_relaxed): ...this and...
(*cond_<SVE_COND_FP_BINARY:optab><mode>_any_strict): ...this.
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_any_const): Split into...
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_any_const_relaxed): ...this
and...
(*cond_<SVE_COND_FP_BINARY_I1:optab><mode>_any_const_strict): ...this.
(*cond_add<mode>_2_const): Split into...
(*cond_add<mode>_2_const_relaxed): ...this and...
(*cond_add<mode>_2_const_strict): ...this.
(*cond_add<mode>_any_const): Split into...
(*cond_add<mode>_any_const_relaxed): ...this and...
(*cond_add<mode>_any_const_strict): ...this.
(*cond_<SVE_COND_FCADD:optab><mode>_2): Split into...
(*cond_<SVE_COND_FCADD:optab><mode>_2_relaxed): ...this and...
(*cond_<SVE_COND_FCADD:optab><mode>_2_strict): ...this.
(*cond_<SVE_COND_FCADD:optab><mode>_any): Split into...
(*cond_<SVE_COND_FCADD:optab><mode>_any_relaxed): ...this and...
(*cond_<SVE_COND_FCADD:optab><mode>_any_strict): ...this.
(*cond_sub<mode>_3_const): Split into...
(*cond_sub<mode>_3_const_relaxed): ...this and...
(*cond_sub<mode>_3_const_strict): ...this.
(*aarch64_pred_abd<mode>): Split into...
(*aarch64_pred_abd<mode>_relaxed): ...this and...
(*aarch64_pred_abd<mode>_strict): ...this.
(*aarch64_cond_abd<mode>_2): Split into...
(*aarch64_cond_abd<mode>_2_relaxed): ...this and...
(*aarch64_cond_abd<mode>_2_strict): ...this.
(*aarch64_cond_abd<mode>_3): Split into...
(*aarch64_cond_abd<mode>_3_relaxed): ...this and...
(*aarch64_cond_abd<mode>_3_strict): ...this.
(*aarch64_cond_abd<mode>_any): Split into...
(*aarch64_cond_abd<mode>_any_relaxed): ...this and...
(*aarch64_cond_abd<mode>_any_strict): ...this.
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_2): Split into...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_2_relaxed): ...this and...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_2_strict): ...this.
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_4): Split into...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_4_relaxed): ...this and...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_4_strict): ...this.
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_any): Split into...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_any_relaxed): ...this and...
(*cond_<SVE_COND_FP_TERNARY:optab><mode>_any_strict): ...this.
(*cond_<SVE_COND_FCMLA:optab><mode>_4): Split into...
(*cond_<SVE_COND_FCMLA:optab><mode>_4_relaxed): ...this and...
(*cond_<SVE_COND_FCMLA:optab><mode>_4_strict): ...this.
(*cond_<SVE_COND_FCMLA:optab><mode>_any): Split into...
(*cond_<SVE_COND_FCMLA:optab><mode>_any_relaxed): ...this and...
(*cond_<SVE_COND_FCMLA:optab><mode>_any_strict): ...this.
(*aarch64_pred_fac<cmp_op><mode>): Split into...
(*aarch64_pred_fac<cmp_op><mode>_relaxed): ...this and...
(*aarch64_pred_fac<cmp_op><mode>_strict): ...this.
(*cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>): Split
into...
(*cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>_relaxed):
...this and...
(*cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>_strict):
...this.
(*cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>): Split
into...
(*cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>_relaxed):
...this and...
(*cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>_strict):
...this.
* config/aarch64/aarch64-sve2.md
(*cond_<SVE2_COND_FP_UNARY_LONG:optab><mode>): Split into...
(*cond_<SVE2_COND_FP_UNARY_LONG:optab><mode>_relaxed): ...this and...
(*cond_<SVE2_COND_FP_UNARY_LONG:optab><mode>_strict): ...this.
(*cond_<SVE2_COND_FP_UNARY_NARROWB:optab><mode>_any): Split into...
(*cond_<SVE2_COND_FP_UNARY_NARROWB:optab><mode>_any_relaxed): ...this
and...
(*cond_<SVE2_COND_FP_UNARY_NARROWB:optab><mode>_any_strict): ...this.
(*cond_<SVE2_COND_INT_UNARY_FP:optab><mode>): Split into...
(*cond_<SVE2_COND_INT_UNARY_FP:optab><mode>_relaxed): ...this and...
(*cond_<SVE2_COND_INT_UNARY_FP:optab><mode>_strict): ...this.

(cherry picked from commit 0eb5e901f6e25a7b8a9790a7a8c209147fb649ec)

3 years agoc++: Add missing verify_type_context call [PR97904]
Richard Sandiford [Wed, 2 Dec 2020 16:20:36 +0000 (16:20 +0000)]
c++: Add missing verify_type_context call [PR97904]

When adding the verify_type_context target hook, I'd missed
a site that needs to check an array element type.

gcc/cp/
PR c++/97904
* pt.c (tsubst): Use verify_type_context to check the type
of an array element.

gcc/testsuite/
PR c++/97904
* g++.dg/ext/sve-sizeless-1.C: Add more template tests.
* g++.dg/ext/sve-sizeless-2.C: Likewise.

(cherry picked from commit d3585f5d0df47ffa453f5fe436fdf588301e5314)

3 years agoaarch64: Avoid false dependencies for SVE unary operations
Richard Sandiford [Wed, 2 Dec 2020 16:20:35 +0000 (16:20 +0000)]
aarch64: Avoid false dependencies for SVE unary operations

For calls like:

        z0 = svabs_s8_x (p0, z1)

we previously generated:

        abs     z0.b, p0/m, z1.b

However, this creates a false dependency on z0 (the merge input).
This can lead to strange results in some cases, e.g. serialising
the operation behind arbitrary earlier operations, or preventing
two iterations of a loop from being executed in parallel.

This patch therefore ties the input to the output, using a MOVPRFX
if necessary and possible.  (The SVE2 unary long instructions do
not support MOVPRFX.)

When testing the patch, I hit a bug in the big-endian SVE move
optimisation in aarch64_maybe_expand_sve_subreg_move.  I don't
have an indepenedent testcase for it, so I didn't split it out
into a separate patch.

gcc/
* config/aarch64/aarch64.c (aarch64_maybe_expand_sve_subreg_move):
Do not optimize LRA subregs.
* config/aarch64/aarch64-sve.md
(@aarch64_pred_<SVE_INT_UNARY:optab><mode>): Tie the input to the
output.
(@aarch64_sve_revbhw_<SVE_ALL:mode><PRED_HSD:mode>): Likewise.
(*<ANY_EXTEND:optab><SVE_PARTIAL_I:mode><SVE_HSDI:mode>2): Likewise.
(@aarch64_pred_sxt<SVE_FULL_HSDI:mode><SVE_PARTIAL_I:mode>): Likewise.
(*cnot<mode>): Likewise.
(@aarch64_pred_<SVE_COND_FP_UNARY:optab><mode>): Likewise.
(@aarch64_sve_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>):
Likewise.
(@aarch64_sve_<optab>_trunc<VNx2DF_ONLY:mode><VNx4SI_ONLY:mode>):
Likewise.
(@aarch64_sve_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>):
Likewise.
(@aarch64_sve_<optab>_extend<VNx4SI_ONLY:mode><VNx2DF_ONLY:mode>):
Likewise.
(@aarch64_sve_<optab>_trunc<SVE_FULL_SDF:mode><SVE_FULL_HSF:mode>):
Likewise.
(@aarch64_sve_<optab>_trunc<VNx4SF_ONLY:mode><VNx8BF_ONLY:mode>):
Likewise.
(@aarch64_sve_<optab>_nontrunc<SVE_FULL_HSF:mode><SVE_FULL_SDF:mode>):
Likewise.
* config/aarch64/aarch64-sve2.md
(@aarch64_pred_<SVE2_COND_FP_UNARY_LONG:sve_fp_op><mode>): Likewise.
(@aarch64_pred_<SVE2_COND_FP_UNARY_NARROWB:sve_fp_op><mode>): Likewise.
(@aarch64_pred_<SVE2_U32_UNARY:sve_int_op><mode>): Likewise.
(@aarch64_pred_<SVE2_COND_INT_UNARY_FP:sve_fp_op><mode>): Likewise.

gcc/testsuite/
* gcc.target/aarch64/sve/cond_cnot_1.c: XFAIL movprfx test.
* gcc.target/aarch64/sve/cond_unary_1.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/abs_f16.c (abs_f16_x_untied): Expect
a MOVPRFX instruction.
* gcc.target/aarch64/sve/acle/asm/abs_f32.c (abs_f32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/abs_f64.c (abs_f64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/abs_s16.c (abs_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/abs_s32.c (abs_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/abs_s64.c (abs_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/abs_s8.c (abs_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cls_s16.c (cls_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cls_s32.c (cls_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cls_s64.c (cls_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cls_s8.c (cls_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_s16.c (clz_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_s32.c (clz_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_s64.c (clz_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_s8.c (clz_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_u16.c (clz_u16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_u32.c (clz_u32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_u64.c (clz_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/clz_u8.c (clz_u8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_s16.c (cnot_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_s32.c (cnot_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_s64.c (cnot_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_s8.c (cnot_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_u16.c (cnot_u16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_u32.c (cnot_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_u64.c (cnot_u64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnot_u8.c (cnot_u8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_bf16.c (cnt_bf16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_f16.c (cnt_f16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_f32.c (cnt_f32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_f64.c (cnt_f64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_s16.c (cnt_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_s32.c (cnt_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_s64.c (cnt_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_s8.c (cnt_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_u16.c (cnt_u16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_u32.c (cnt_u32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_u64.c (cnt_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cnt_u8.c (cnt_u8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_bf16.c (cvt_bf16_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_f16.c (cvt_f16_f32_x_untied)
(cvt_f16_f64_x_untied, cvt_f16_s16_x_untied, cvt_f16_s32_x_untied)
(cvt_f16_s64_x_untied, cvt_f16_u16_x_untied, cvt_f16_u32_x_untied)
(cvt_f16_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_f32.c (cvt_f32_f16_x_untied)
(cvt_f32_f64_x_untied, cvt_f32_s16_x_untied, cvt_f32_s32_x_untied)
(cvt_f32_s64_x_untied, cvt_f32_u16_x_untied, cvt_f32_u32_x_untied)
(cvt_f32_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_f64.c (cvt_f64_f16_x_untied)
(cvt_f64_f32_x_untied, cvt_f64_s16_x_untied, cvt_f64_s32_x_untied)
(cvt_f64_s64_x_untied, cvt_f64_u16_x_untied, cvt_f64_u32_x_untied)
(cvt_f64_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_s16.c (cvt_s16_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_s32.c (cvt_s32_f16_x_untied)
(cvt_s32_f32_x_untied, cvt_s32_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_s64.c (cvt_s64_f16_x_untied)
(cvt_s64_f32_x_untied, cvt_s64_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_u16.c (cvt_u16_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_u32.c (cvt_u32_f16_x_untied)
(cvt_u32_f32_x_untied, cvt_u32_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/cvt_u64.c (cvt_u64_f16_x_untied)
(cvt_u64_f32_x_untied, cvt_u64_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/extb_s16.c (extb_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/extb_s32.c (extb_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/extb_s64.c (extb_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/exth_s32.c (exth_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/exth_s64.c (exth_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/extw_s64.c (extw_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_f16.c (neg_f16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_f32.c (neg_f32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_f64.c (neg_f64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_s16.c (neg_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_s32.c (neg_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_s64.c (neg_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/neg_s8.c (neg_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_s16.c (not_s16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_s32.c (not_s32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_s64.c (not_s64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_s8.c (not_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_u16.c (not_u16_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_u32.c (not_u32_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_u64.c (not_u64_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/not_u8.c (not_u8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_s16.c (rbit_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_s32.c (rbit_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_s64.c (rbit_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_s8.c (rbit_s8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_u16.c (rbit_u16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_u32.c (rbit_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_u64.c (rbit_u64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rbit_u8.c (rbit_u8_x_untied): Ditto.
* gcc.target/aarch64/sve/acle/asm/recpx_f16.c (recpx_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/recpx_f32.c (recpx_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/recpx_f64.c (recpx_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_s16.c (revb_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_s32.c (revb_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_s64.c (revb_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_u16.c (revb_u16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_u32.c (revb_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revb_u64.c (revb_u64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revh_s32.c (revh_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revh_s64.c (revh_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revh_u32.c (revh_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revh_u64.c (revh_u64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revw_s64.c (revw_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/revw_u64.c (revw_u64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinta_f16.c (rinta_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinta_f32.c (rinta_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinta_f64.c (rinta_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinti_f16.c (rinti_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinti_f32.c (rinti_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rinti_f64.c (rinti_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintm_f16.c (rintm_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintm_f32.c (rintm_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintm_f64.c (rintm_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintn_f16.c (rintn_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintn_f32.c (rintn_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintn_f64.c (rintn_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintp_f16.c (rintp_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintp_f32.c (rintp_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintp_f64.c (rintp_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintx_f16.c (rintx_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintx_f32.c (rintx_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintx_f64.c (rintx_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintz_f16.c (rintz_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintz_f32.c (rintz_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/rintz_f64.c (rintz_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/sqrt_f16.c (sqrt_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/sqrt_f32.c (sqrt_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve/acle/asm/sqrt_f64.c (sqrt_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/cvtx_f32.c (cvtx_f32_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/logb_f16.c (logb_f16_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/logb_f32.c (logb_f32_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/logb_f64.c (logb_f64_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qabs_s16.c (qabs_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qabs_s32.c (qabs_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qabs_s64.c (qabs_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qabs_s8.c (qabs_s8_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qneg_s16.c (qneg_s16_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qneg_s32.c (qneg_s32_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qneg_s64.c (qneg_s64_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/qneg_s8.c (qneg_s8_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/recpe_u32.c (recpe_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/rsqrte_u32.c (rsqrte_u32_x_untied):
Ditto.
* gcc.target/aarch64/sve2/acle/asm/cvtlt_f32.c
(cvtlt_f32_f16_x_untied): Expect a MOV instruction.
* gcc.target/aarch64/sve2/acle/asm/cvtlt_f64.c
(cvtlt_f64_f32_x_untied): Likewise.

(cherry picked from commit a4d9837ee4becaec43b77afa84ea2b91ee1b9e5c)

3 years agodse: Cope with bigger-than-integer modes [PR98037]
Richard Sandiford [Wed, 2 Dec 2020 16:20:34 +0000 (16:20 +0000)]
dse: Cope with bigger-than-integer modes [PR98037]

dse.c:find_shift_sequence tries to represent a store and load
back as a shift right followed by a truncation.  It therefore
needs to find an integer mode in which to do the shift right.
The loop it uses has the form:

  FOR_EACH_MODE_FROM (new_mode_iter,
      smallest_int_mode_for_size (GET_MODE_BITSIZE (read_mode)))

which implicitly assumes that read_mode has an equivalent integer mode.
As shown in the testcase, not all modes have such an integer mode.

This patch just makes the code start from the smallest integer mode and
skip modes that are too small.  The loop already breaks at the first
mode wider than word_mode.

gcc/
PR rtl-optimization/98037
* dse.c (find_shift_sequence): Iterate over all integers and
skip modes that are too small.

gcc/testsuite/
PR rtl-optimization/98037
* gcc.target/aarch64/sve/acle/general/pr98037.c: New test.

(cherry picked from commit f835e9f6562dda9c8a1384be2c9d4e45c112ed8e)

3 years agotree-optimization/96920 - another ICE when vectorizing nested cycles
Richard Biener [Fri, 4 Sep 2020 12:35:39 +0000 (14:35 +0200)]
tree-optimization/96920 - another ICE when vectorizing nested cycles

This refines the previous fix for PR96698 by re-doing how and where
we arrange for setting vectorized cycle PHI backedge values.

2020-09-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96698
PR tree-optimization/96920
* tree-vectorizer.h (loop_vec_info::reduc_latch_defs): Remove.
(loop_vec_info::reduc_latch_slp_defs): Likewise.
* tree-vect-stmts.c (vect_transform_stmt): Remove vectorized
cycle PHI latch code.
* tree-vect-loop.c (maybe_set_vectorized_backedge_value): New
helper to set vectorized cycle PHI latch values.
(vect_transform_loop): Walk over all PHIs again after
vectorizing them, calling maybe_set_vectorized_backedge_value.
Call maybe_set_vectorized_backedge_value for each vectorized
stmt.  Remove delayed update code.
* tree-vect-slp.c (vect_analyze_slp_instance): Initialize
SLP instance reduc_phis member.
(vect_schedule_slp): Set vectorized cycle PHI latch values.

* gfortran.dg/vect/pr96920.f90: New testcase.
* gcc.dg/vect/pr96920.c: Likewise.

(cherry picked from commit 46a58c779af3055a4b10b285a1f4be28abe4351c)

3 years agotree-optimization/96698 - fix ICE when vectorizing nested cycles
Richard Biener [Wed, 26 Aug 2020 13:12:17 +0000 (15:12 +0200)]
tree-optimization/96698 - fix ICE when vectorizing nested cycles

This fixes vectorized PHI latch edge updating and delay it until
all of the loop is code generated to deal with the case that the
latch def is a PHI in the same block.

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

PR tree-optimization/96698
* tree-vectorizer.h (loop_vec_info::reduc_latch_defs): New.
(loop_vec_info::reduc_latch_slp_defs): Likewise.
* tree-vect-stmts.c (vect_transform_stmt): Only record
stmts to update PHI latches from, perform the update ...
* tree-vect-loop.c (vect_transform_loop): ... here after
vectorizing those PHIs.
(info_for_reduction): Properly handle non-reduction PHIs.

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

(cherry picked from commit 2130efe6ac7beba72d289e3dd145daa10aeaed54)

3 years agoDaily bump.
GCC Administrator [Wed, 2 Dec 2020 00:17:18 +0000 (00:17 +0000)]
Daily bump.

3 years agolibstdc++: Apply proposed resolution for LWG 3449 [PR95322]
Patrick Palka [Mon, 12 Oct 2020 17:46:21 +0000 (13:46 -0400)]
libstdc++: Apply proposed resolution for LWG 3449 [PR95322]

Now that the frontend bug PR96805 is fixed, we can cleanly apply the
proposed resolution for this issue.

This slightly deviates from the proposed resolution by declaring _CI a
member of take_view instead of take_view::_Sentinel, since it doesn't
depend on anything within _Sentinel anymore.

libstdc++-v3/ChangeLog:

PR libstdc++/95322
* include/std/ranges (take_view::_CI): Define this alias
template as per LWG 3449 and remove ...
(take_view::_Sentinel::_CI): ... this type alias.
(take_view::_Sentinel::operator==): Adjust use of _CI
accordingly.  Define a second overload that accepts an iterator
of the opposite constness as per LWG 3449.
(take_while_view::_Sentinel::operator==): Likewise.
* testsuite/std/ranges/adaptors/95322.cc: Add tests for LWG 3449.

(cherry picked from commit e066821b6f6b7332c7a67981f7b33c9ba0ccaee7)

3 years agotree-optimization/97812 - fix range query in VRP assert discovery
Richard Biener [Fri, 13 Nov 2020 10:31:22 +0000 (11:31 +0100)]
tree-optimization/97812 - fix range query in VRP assert discovery

This makes sure to properly extend the input range before seeing
whether it fits the target.

2020-11-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97812
* tree-vrp.c (register_edge_assert_for_2): Extend the range
according to its sign before seeing whether it fits.

* gcc.dg/torture/pr97812.c: New testcase.

(cherry picked from commit dcfd302a79a5e2ea3bb16fc4fc45a5ee31cc0eab)

3 years agotree-optimization/97760 - reduction paths with unhandled live stmt
Richard Biener [Mon, 9 Nov 2020 14:19:56 +0000 (15:19 +0100)]
tree-optimization/97760 - reduction paths with unhandled live stmt

This makes sure we reject reduction paths with a live stmt that
is not the last one altering the value.  This is because we do not
handle this in the epilogue unless there's a scalar epilogue loop.

2020-11-09  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97760
* tree-vect-loop.c (check_reduction_path): Reject
reduction paths we do not handle in epilogue generation.

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

(cherry picked from commit 2686de5617bfb572343933be2883e8274c9735b5)

3 years agotree-optimization/97539 - reset out-of-loop debug uses before peeling
Richard Biener [Mon, 26 Oct 2020 09:08:38 +0000 (10:08 +0100)]
tree-optimization/97539 - reset out-of-loop debug uses before peeling

This makes sure to reset out-of-loop debug uses before vectorizer
loop peeling as we cannot make sure to retain the use-def dominance
relationship when there are no LC SSA nodes.

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

PR tree-optimization/97539
* tree-vect-loop-manip.c (vect_do_peeling): Reset out-of-loop
debug uses before peeling.

* gcc.dg/pr97539.c: New testcase.

(cherry picked from commit 27c14056f4805c9d8cfc655ef2c846be128b02c9)

3 years agomiddle-end/95171 - inlining of trapping compare into non-call EH fn
Richard Biener [Mon, 18 May 2020 06:51:23 +0000 (08:51 +0200)]
middle-end/95171 - inlining of trapping compare into non-call EH fn

This fixes always-inlining across -fnon-call-exception boundaries
for conditions which we do not allow to throw.

2020-05-18  Richard Biener  <rguenther@suse.de>

PR middle-end/95171
* tree-inline.c (remap_gimple_stmt): Split out trapping compares
when inlining into a non-call EH function.

* gcc.dg/pr95171.c: New testcase.

(cherry picked from commit fe168751c5c1c517c7c89c9a1e4e561d66b24663)

3 years agotestsuite/98002 - fix gcc.dg/strncmp-2.c
Richard Biener [Thu, 26 Nov 2020 09:07:06 +0000 (10:07 +0100)]
testsuite/98002 - fix gcc.dg/strncmp-2.c

This makes sure not to free() memory we have mprotected to PROT_NONE
by calling mprotect again with PROT_READ|PROT_WRITE.  This avoids
crashing the allocator when in debug mode.

2020-11-16  Richard Biener  <rguenther@suse.de>

PR testsuite/98002
* gcc.dg/strncmp-2.c: Call mprotect again before free.

(cherry picked from commit 5b3a8fad18324cd38c221bdb0ae2b690fc82ede0)

3 years agomiddle-end/97554 - avoid overflow in alloc size compute
Richard Biener [Mon, 26 Oct 2020 09:10:46 +0000 (10:10 +0100)]
middle-end/97554 - avoid overflow in alloc size compute

This avoids overflow in the allocation size computations in
sbitmap_vector_alloc when the result exceeds 2GB.

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

PR middle-end/97554
* sbitmap.c (sbitmap_vector_alloc): Use size_t for byte
quantities to avoid overflow.

(cherry picked from commit 50f9e1f4d458e36d306b2449c689e45492847f68)

3 years agoDaily bump.
GCC Administrator [Tue, 1 Dec 2020 00:17:13 +0000 (00:17 +0000)]
Daily bump.

3 years ago[Obvious] arm: Fix test from failing on some targets [PR91816]
Stam Markianos-Wright [Mon, 30 Nov 2020 10:42:18 +0000 (10:42 +0000)]
[Obvious] arm: Fix test from failing on some targets [PR91816]

This recently submitted test was found to fail on some Cortex-M
targets. This was because codegen on these CPUs would emit a ldr
instead of a movw/movt pair, resulting in an overall smaller test
(i.e. the branch wasn't as far) and the behaviour being tested
for not being triggered.

This commit doubles the size of the test to account for this.

gcc/testsuite/ChangeLog:

* gcc.target/arm/pr91816.c: Update test.

3 years agoDaily bump.
GCC Administrator [Mon, 30 Nov 2020 00:17:04 +0000 (00:17 +0000)]
Daily bump.

3 years agotestsuite/i386: Fix XOP and FMA4 checking functions [PR98036].
Uros Bizjak [Sun, 29 Nov 2020 21:22:02 +0000 (22:22 +0100)]
testsuite/i386: Fix XOP and FMA4 checking functions [PR98036].

Add missing returns and remove unnecessary postfix increments.

2020-11-27  Uroš Bizjak  <ubizjak@gmail.com>

PR testsuite/98036

gcc/testsuite/
* gcc.target/i386/fma4-256-maccXX.c (check_maccps):
Remove unnecessary postfix increment on a returned variable.
(check_maccpd): Ditto.
* gcc.target/i386/fma4-256-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
* gcc.target/i386/fma4-256-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
* gcc.target/i386/fma4-256-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
* gcc.target/i386/fma4-maccXX.c (check_maccps): Ditto.
(check_maccpd): Ditto.
(check_maccss): Ditto.
(check_maccsd): Ditto.
* gcc.target/i386/fma4-msubXX.c (check_msubps): Ditto.
(check_msubpd): Ditto.
(check_msubss): Ditto.
(check_msubsd): Ditto.
* gcc.target/i386/fma4-nmaccXX.c (check_nmaccps): Ditto.
(check_nmaccpd): Ditto.
(check_nmaccss): Ditto.
(check_nmaccsd): Ditto.
* gcc.target/i386/fma4-nmsubXX.c (check_nmsubps): Ditto.
(check_nmsubpd): Ditto.
(check_nmsubss): Ditto.
(check_nmsubsd): Ditto.
* gcc.target/i386/xop-haddX.c (check_sbyte2word): Add missing return.
(check_sbyte2dword):
Remove unnecessary postfix increment on a returned value.
(check_sbyte2qword): Ditto.
(check_sword2dword): Add missing return.
(check_sword2qword):
Remove unnecessary postfix increment on a returned value.
(check_dword2qword): Add missing return.
* gcc.target/i386/xop-hadduX.c (check_byte2word): Add missing return.
(check_byte2dword):
Remove unnecessary postfix increment on a returned value.
(check_byte2qword): Ditto.
(check_word2dword): Add missing return.
(check_word2qword):
Remove unnecessary postfix increment on a returned value.
(check_word2qword): Add missing return.
* gcc.target/i386/xop-hsubX.c (check_sbyte2word): Add missing return.
(check_sword2dword): Ditto.
(check_sword2qword): Ditto.

3 years agoDaily bump.
GCC Administrator [Sun, 29 Nov 2020 00:16:59 +0000 (00:16 +0000)]
Daily bump.

This page took 0.105625 seconds and 5 git commands to generate.