Carl Love [Wed, 10 Jun 2020 21:12:08 +0000 (16:12 -0500)]
pr94833, fix vec_first_match_index for nulls
Backported patch from mainline. Updated ChangeLog format
commit 24f68831d25bad739a6fe167a58b5b4c0c3cbf9a
Author: Carl Love <cel@us.ibm.com>
Date: Wed Apr 29 10:23:11 2020 -0500
Note the mainlin patch adds tests to the test case in mainline. The test
case does not exist in GCC 8. Only the functional change in
gcc/config/rs6000/vsx.md was backported.
Thomas Schwinge [Wed, 6 May 2020 08:05:49 +0000 (10:05 +0200)]
'libgomp.oacc-fortran/{error_,}stop-{1,2,3}.f': initialize before the checkpoint
If, for example, GCC is configured such that 'libgomp-plugin-nvptx.so.1'
dynamically links against 'libcuda.so.1', but testing is run on a system where
there is no 'libcuda.so.1', this produces output such as:
PASS: libgomp.oacc-fortran/error_stop-1.f -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O0 (test for excess errors)
PASS: libgomp.oacc-fortran/error_stop-1.f -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O0 execution test
FAIL: libgomp.oacc-fortran/error_stop-1.f -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O0 output pattern test, is CheCKpOInT
libgomp: while loading libgomp-plugin-nvptx.so.1: libcuda.so.1: cannot open shared object file: No such file or directory
ERROR STOP
Error termination. Backtrace: [...]
, should match CheCKpOInT(
|
|^M)+ERROR STOP (
|
|^M)+Error termination.*
..., where after 'CheCKpOInT' we got 'libgomp: while loading [...]' injected
before the expected 'ERROR STOP'.
This fixes PR94591. The problem was the function
aarch64_evpc_rev_local() matching vector permutations that were not
reversals. In particular, prior to this patch, this function matched the
identity permutation which led to generating bogus REV64 insns which
were rejected by the assembler.
gcc/
PR target/94591
* config/aarch64/aarch64.c (aarch64_evpc_rev_local): Don't match
identity permutation.
gcc/testsuite/
PR target/94591
* gcc.c-torture/execute/pr94591.c: New test.
Kyrylo Tkachov [Wed, 6 May 2020 15:20:38 +0000 (16:20 +0100)]
[AArch64] Use __getauxval instead of getauxval in LSE detection code in libgcc
This version of the fix uses __getauxval instead of getauxval.
The whole thing is guarded simply on __gnu_linux__.
__getauxval was introduced in 2.16 but the aarch64 port was added in 2.17 so in practice I expect all aarch64 glibcs to support __getauxval.
Bootstrapped and tested on aarch64-none-linux-gnu.
Also tested on aarch64-none-elf.
Martin Liska [Fri, 29 May 2020 09:29:25 +0000 (11:29 +0200)]
Fix various limitations of git-backport.py.
I've just tested the script and I'm going to install the patch
to all active branches.
contrib/ChangeLog:
* git-backport.py: The script did 'git co HEAD~' when
there was no modified ChangeLog file in a successful
git cherry pick.
Run cherry-pick --continue without editor.
Mark Eggleston [Thu, 7 May 2020 07:15:26 +0000 (08:15 +0100)]
Fortran : ICE in gfc_trans_label_assign PR50392
A function may contain an assigned goto. If the the return variable
is an integer a statement can be assigned to it. Prior to this fix
this resulted in an ICE.
PR fortran/50392
* trans-decl.c (gfc_get_symbol_decl): Remove unnecessary block
delimiters. Add auxiliary variables if a label is assigned to
a return variable. (gfc_gat_fake_result): If the symbol has an
assign attribute set declaration from the symbol's backend
declaration.
2020-05-28 Mark Eggleston <markeggleston@gnu.gcc.org>
gcc/testsuite/
PR fortran/50392
* gfortran.dg/pr50392.f: New test.
Jason Merrill [Mon, 25 May 2020 22:38:09 +0000 (18:38 -0400)]
c++: Local class DMI using local static [PR90749]
For default member initializers in templates it's important to push into the
right context during get_nsdmi. But for a local class that's not possible,
and trying leaves the function context we need to be in, so don't try.
gcc/cp/ChangeLog
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/90749
* init.c (get_nsdmi): Don't push_to_top_level for a local class.
Jason Merrill [Mon, 25 May 2020 22:38:09 +0000 (18:38 -0400)]
c++: -fmerge-all-constants vs. destructors [PR91529]
cp_finish_decl avoids setting TREE_READONLY on TREE_STATIC variables that
have non-constant construction or destruction, but -fmerge-all-constants was
converting an automatic variable to static while leaving TREE_READONLY set.
Fixed by clearing the flag in cp_finish_decl in the presence of
-fmerge-all-constants.
gcc/cp/ChangeLog
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/91529
* decl.c (cp_finish_decl): Also clear TREE_READONLY if
-fmerge-all-constants.
Jason Merrill [Mon, 25 May 2020 22:38:09 +0000 (18:38 -0400)]
c++: generic lambda and -fsanitize=vla-bound [PR93822]
Within the generic lambda the VLA capture proxy VAR_DECL has DECL_VALUE_EXPR
which is a NOP_EXPR to the VLA type of the proxy. The problem here was that
when instantiating we were tsubsting that type twice, once for the type of
the DECL and once for the type of the NOP_EXPR, and getting two
different (though equivalent) types. Then gimplify_type_sizes fixed up the
type of the DECL, but that didn't affect the type of the NOP_EXPR, leading
to sadness.
Fixed by directly reusing the type from the DECL.
gcc/cp/ChangeLog
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/93822
* pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
the same type as the variable.
Mark Eggleston [Thu, 7 May 2020 07:02:02 +0000 (08:02 +0100)]
Fortran : ProcPtr function results: 'ppr@' in error message PR39695
The value 'ppr@' is set in the name of result symbol, the actual
name of the symbol is in the procedure name symbol pointed
to by the result symbol's namespace (ns). When reporting errors for
symbols that have the proc_pointer attribute check whether the
result attribute is set and set the name accordingly.
Backport from master.
2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/fortran/
PR fortran/39695
* resolve.c (resolve_fl_procedure): Set name depending on
whether the result attribute is set. For PROCEDURE/RESULT
conflict use the name in sym->ns->proc_name->name.
* symbol.c (gfc_add_type): Add check for function and result
attributes use sym->ns->proc_name->name if both are set.
Where the symbol cannot have a type use the name in
sym->ns->proc_name->name.
2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/testsuite/
PR fortran/39695
* gfortran.dg/pr39695_1.f90: New test.
* gfortran.dg/pr39695_2.f90: New test.
* gfortran.dg/pr39695_3.f90: New test.
* gfortran.dg/pr39695_4.f90: New test.
Douglas Rupp [Mon, 18 May 2020 18:43:48 +0000 (11:43 -0700)]
Require powerpc_vsx_ok in gcc.target/powerpc/pr71763.c
We're getting an error when running this test on PowerPC VxWorks 7,
due to an unexpected warning:
| Excess errors:
| cc1: warning: '-mvsx' and '-mno-altivec' are incompatible
The warning comes from a combination of factors:
- The test itself uses -mvsx explicitly via the following directive:
// { dg-options "-O1 -mvsx" }
- Our toolchain was configured so as to make -mno-altivec
the default;
- These two options are mutually exclusive.
This commit adds a powerpc_vsx_ok dg-require-effective-target directive
to that test, and thus making it UNSUPPORTED instead.
Tested on PowerPC VxWorks 7. Also tested on PowerPC ELF as well,
a platform where we do not make -mno-altivec the default, to verify
that the test continues to run as usual in that case.
Szabolcs Nagy [Mon, 27 Apr 2020 08:07:15 +0000 (09:07 +0100)]
aarch64: Fix .cfi_window_save with pac-ret [PR94515]
On aarch64 -mbranch-protection=pac-ret reuses the dwarf
opcode for window_save to mean "toggle the return address
mangle state", but in the dwarf2cfi internal logic the
state was not updated when an opcode was emitted, the
currently present update logic is only valid for the
original sparc use of window_save so a separate bool is
used on aarch64 to track the state.
This bug can cause the unwinder not to authenticate return
addresses that were signed (or vice versa) which means a
runtime crash on a pauth enabled system.
Currently only aarch64 pac-ret uses REG_CFA_TOGGLE_RA_MANGLE.
This should be backported to gcc-9 and gcc-8 branches.
Changed branch-protection=pac-ret to sign-return-address=all etc
in the tests for the backport and adjusted the dwarf2cfi.c
changes because the sparc change was missing.
gcc/ChangeLog:
Backport from mainline.
2020-04-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/94515
* dwarf2cfi.c (struct GTY): Add ra_mangled.
(cfi_row_equal_p): Check ra_mangled.
(dwarf2out_frame_debug_cfa_window_save): Remove the argument,
this only handles the sparc logic now.
(dwarf2out_frame_debug_cfa_toggle_ra_mangle): New function for
the aarch64 specific logic.
(dwarf2out_frame_debug): Update to use the new subroutines.
(change_cfi_row): Check ra_mangled.
gcc/testsuite/ChangeLog:
Backport from mainline.
2020-04-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/94515
* g++.target/aarch64/pr94515-1.C: New test.
* g++.target/aarch64/pr94515-2.C: New test.
Szabolcs Nagy [Fri, 3 Apr 2020 09:35:41 +0000 (09:35 +0000)]
aarch64, libgcc: Fix unwinding from pac-ret to normal frames [PR94514]
With -mbranch-protection=pac-ret the debug info toggles the
signedness state of the return address so the unwinder knows when
the return address needs pointer authentication.
The unwind context flags were not updated according to the dwarf
frame info.
This causes unwinding across frames that were built without pac-ret
to incorrectly authenticate the return address wich corrupts the
return address on a system where PAuth is enabled.
Note: This even affects systems where all code use pac-ret because
unwinding across a signal frame the return address is not signed.
Changed branch-protection=pac-ret to sign-return-address=all etc
in the tests for the backport.
gcc/testsuite/ChangeLog:
Backport from mainline.
2020-04-23 Szabolcs Nagy <szabolcs.nagy@arm.com>
David Edelsohn [Tue, 12 May 2020 21:09:36 +0000 (17:09 -0400)]
rs6000: AIX long double builtins for 64 bit long double.
When long doubles are 64 bit, the AIX C library overrides the definitions
but GCC builtins point to 128 bit names. This patch overrides the
builtins for fmodl, frexpl, ldexpl and modfl to refer to the 64 bit symbols.
Backport from mainline
2020-05-04 Clement Chigot <clement.chigot@atos.net>
David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/rs6000-call.c (rs6000_init_builtins): Override expli
cit
for fmodl, frexpl, ldexpl and modfl builtins.
Mark Eggleston [Mon, 11 May 2020 11:38:14 +0000 (12:38 +0100)]
Fortran : Spurious warning message with -Wsurprising PR59107
This change is from a patch developed for gcc-5. The code
has moved on since then requiring a change to interface.c
2020-05-11 Mark Eggleston <markeggleston@gcc.gnu.org>
Backported from mainline
2020-05-11 Janus Weil <janus@gcc.gnu.org>
Dominique d'Humieres <dominiq@lps.ens.fr>
gcc/fortran/
PR fortran/59107
* gfortran.h: Rename field resolved as resolve_symbol_called
and assign two 2 bits instead of 1.
* interface.c (gfc_find_typebound_dtio_proc): Use new field name.
* resolve.c (gfc_resolve_intrinsic): Replace check of the formal
field with resolve_symbol_called is at least 2, if it is not
set the field to 2. (resolve_symbol): Use new field name and
check whether it is at least 1, if it is not set the field to 1.
Backported from mainline
2020-05-11 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/testsuite/
PR fortran/59107
* gfortran.dg/pr59107.f90: New test.
Uros Bizjak [Thu, 7 May 2020 15:26:37 +0000 (17:26 +0200)]
alpha: Implement the PR94780 fix for alpha.
Essentially the same fix as for x86.
2020-05-07 Uroš Bizjak <ubizjak@gmail.com>
gcc/
* config/alpha/alpha.c (alpha_atomic_assign_expand_fenv): Use
TARGET_EXPR instead of MODIFY_EXPR for the first assignments to
fenv_var and new_fenv_var.
Jonathan Wakely [Mon, 4 May 2020 21:54:25 +0000 (22:54 +0100)]
libstdc++: Fix broken link to SGI STL FAQ
The previous URL to an entry in the wayback machine now redirects to a
page saying "SGI.com Tech Archive Resources now retired" so use an older
entry from the archive.
* doc/xml/faq.xml: Use working link for SGI STL FAQ.
* doc/html/*: Regenerate.
Bin Cheng [Mon, 4 May 2020 08:56:34 +0000 (16:56 +0800)]
Add unsigned type iv_cand for iv_use with non mode-precision type
Precisely, for iv_use if it's not integer/pointer type, or non-mode
precision type, add candidate for the corresponding scev in unsigned
type with the same precision, rather than its original type.
Backport from master.
2020-04-09 Bin Cheng <bin.cheng@linux.alibaba.com>
PR tree-optimization/93674
gcc/
* tree-ssa-loop-ivopts.c (langhooks.h): New include.
(add_iv_candidate_for_use): For iv_use of non integer or pointer type,
or non-mode precision type, add candidate in unsigned type with the
same precision.
Andreas Krebbel [Mon, 4 May 2020 08:43:02 +0000 (10:43 +0200)]
S/390: Fix PR94666
The vector popcount expanders use a hardcoded subreg. This might lead
to double subregs being generated which then fail to match. With this
patch simplify_gen_subreg is used instead to fold the subregs.
gcc/ChangeLog:
2020-05-04 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2020-04-20 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/vector.md ("popcountv8hi2_vx", "popcountv4si2_vx")
("popcountv2di2_vx"): Use simplify_gen_subreg.
gcc/testsuite/ChangeLog:
2020-05-04 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2020-04-20 Andreas Krebbel <krebbel@linux.ibm.com>
Andreas Krebbel [Mon, 4 May 2020 08:43:02 +0000 (10:43 +0200)]
PR94613: Fix vec_sel builtin for IBM Z
The vsel instruction is a bit-wise select instruction. Using an
IF_THEN_ELSE to express it in RTL is wrong and leads to wrong code being
generated in the combine pass.
With the patch the pattern is written using bit operations. However,
I've just noticed that the manual still demands a fixed point mode for
AND/IOR and friends although several targets emit bit ops on floating
point vectors (including i386, Power, and s390). So I assume this is a
safe thing to do?!
gcc/ChangeLog:
2020-05-04 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2020-04-20 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/94613
* config/s390/s390-builtin-types.def: Add 3 new function modes.
* config/s390/s390-builtins.def: Add mode dependent low-level
builtin and map the overloaded builtins to these.
* config/s390/vx-builtins.md ("vec_selV_HW"): Rename to ...
("vsel<V_HW"): ... this and rewrite the pattern with bitops.
gcc/testsuite/ChangeLog:
2020-05-04 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2020-04-20 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/94613
* gcc.target/s390/zvector/pr94613.c: New test.
* gcc.target/s390/zvector/vec_sel-1.c: New test.
Andre Vieira [Wed, 29 Apr 2020 14:42:27 +0000 (15:42 +0100)]
aarch64: Force TImode values into even registers
The LSE CASP instruction requires values to be placed in even
register pairs. A solution involving two additional register
classes was rejected in favor of the much simpler solution of
simply requiring all TImode values to be aligned.
gcc/ChangeLog:
2020-04-29 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline.
2018-10-31 Richard Henderson <richard.henderson@linaro.org>
* config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Force
16-byte modes held in GP registers to use an even regno.
Thomas König [Fri, 24 Apr 2020 07:26:48 +0000 (09:26 +0200)]
Fix PR 93956, wrong pointer when returned via function.
Backport from trunk.
This one took a bit of detective work. When array pointers point
to components of derived types, we currently set the span field
and then create an array temporary when we pass the array
pointer to a procedure as a non-pointer or non-target argument.
(This is inefficient, but that's for another release).
Now, the compiler detected this case when there was a direct assignment
like p => a%b, but not when p was returned either as a function result
or via an argument. This patch fixes that.
2020-04-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/93956
* expr.c (gfc_check_pointer_assign): Also set subref_array_pointer
when a function returns a pointer.
* interface.c (gfc_set_subref_array_pointer_arg): New function.
(gfc_procedure_use): Call it.
2020-04-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/93956
* gfortran.dg/pointer_assign_13.f90: New test.
Andre Vieira [Thu, 16 Apr 2020 09:16:18 +0000 (10:16 +0100)]
aarch64: Fix ICE due to aarch64_gen_compare_reg_maybe_ze [PR94435]
The following testcase ICEs, because aarch64_gen_compare_reg_maybe_ze emits
invalid RTL.
For y_mode [QH]Imode it expects y to be of that mode (or CONST_INT that fits
into that mode) and x being SImode; for non-CONST_INT y it zero extends y
into SImode and compares that against x, for CONST_INT y it zero extends y
into SImode. The problem is that when the zero extended constant isn't
usable directly, it forces it into a REG, but with y_mode mode, and then
compares against y. That is wrong, because it should force it into a SImode
REG and compare that way.
2020-04-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline
2020-04-02 Jakub Jelinek <jakub@redhat.com>
PR target/94435
* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): For
y_mode E_[QH]Imode and y being a CONST_INT, change y_mode to SImode.
Andre Vieira [Thu, 16 Apr 2020 09:16:18 +0000 (10:16 +0100)]
aarch64: Fix bootstrap with old binutils [PR93053]
As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build
when using older binutils which lack LSE support, because those instructions
are used in libgcc.
Thanks to Kyrylo's hint, the following patches (hopefully) allow it to build
even with older binutils by using .inst directive if LSE support isn't
available in the assembler.
2020-04-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline
2020-04-15 Jakub Jelinek <jakub@redhat.com>
PR target/93053
* configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking.
* config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE
is not defined, use just .arch armv8-a.
(B, M, N, OPN): Define.
(COMMENT): New .macro.
(CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not
defined. Otherwise, move the operands right after the glue? and
comment out operands where the macros are used.
* configure: Regenerated.
* config.in: Regenerated.
Andre Vieira [Thu, 16 Apr 2020 09:16:17 +0000 (10:16 +0100)]
aarch64: Fix up aarch64_compare_and_swaphi pattern [PR94368]
2020-04-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline
2020-03-31 Jakub Jelinek <jakub@redhat.com>
PR target/94368
* config/aarch64/constraints.md (Uph): New constraint.
* config/aarch64/atomics.md (cas_short_expected_imm): New mode attr.
(aarch64_compare_and_swap<mode>): Use it instead of n in operand 2's
constraint.