]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agodoc: Fix a typo in the documentation of the copy attribute
Zackery Spytz [Wed, 1 Apr 2020 17:06:16 +0000 (18:06 +0100)] 
doc: Fix a typo in the documentation of the copy attribute

2020-04-01  Zackery Spytz  <zspytz@gmail.com>

gcc/
* doc/extend.texi: Fix a typo in the documentation of the
copy function attribute.

5 years agoaarch64: Fix up aarch64_compare_and_swaphi pattern [PR94368]
Kyrylo Tkachov [Wed, 1 Apr 2020 12:53:05 +0000 (13:53 +0100)] 
aarch64: Fix up aarch64_compare_and_swaphi pattern [PR94368]

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@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.

* gcc.dg/pr94368.c: New test.

5 years agoaarch64: Configure for sys/auxv.h in libgcc for lse-init.c
Kyrylo Tkachov [Wed, 1 Apr 2020 11:13:39 +0000 (12:13 +0100)] 
aarch64: Configure for sys/auxv.h in libgcc for lse-init.c

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

PR target/91833
* config/aarch64/lse-init.c: Include auto-target.h.  Disable
initialization if !HAVE_SYS_AUXV_H.
* configure.ac (AC_CHECK_HEADERS): Add sys/auxv.h.
* config.in, configure: Rebuild.

5 years agoaarch64: Fix store-exclusive in load-operate LSE helpers
Kyrylo Tkachov [Wed, 1 Apr 2020 11:11:58 +0000 (12:11 +0100)] 
aarch64: Fix store-exclusive in load-operate LSE helpers

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

PR target/91834
* config/aarch64/lse.S (LDNM): Ensure STXR output does not
overlap the inputs.

5 years ago[AArch64] Fix shrinkwrapping interactions with atomics (PR92692)
Kyrylo Tkachov [Wed, 1 Apr 2020 11:09:09 +0000 (12:09 +0100)] 
[AArch64] Fix shrinkwrapping interactions with atomics (PR92692)

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2020-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

PR target/92692
* config/aarch64/atomics.md (aarch64_compare_and_swap<mode>)
Use epilogue_completed rather than reload_completed.

5 years agoaarch64: Implement -moutline-atomics
Kyrylo Tkachov [Wed, 1 Apr 2020 11:00:14 +0000 (12:00 +0100)] 
aarch64: Implement -moutline-atomics

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

* config/aarch64/aarch64.opt (-moutline-atomics): New.
* config/aarch64/aarch64.c (aarch64_atomic_ool_func): New.
(aarch64_ool_cas_names, aarch64_ool_swp_names): New.
(aarch64_ool_ldadd_names, aarch64_ool_ldset_names): New.
(aarch64_ool_ldclr_names, aarch64_ool_ldeor_names): New.
(aarch64_expand_compare_and_swap): Honor TARGET_OUTLINE_ATOMICS.
* config/aarch64/atomics.md (atomic_exchange<ALLI>): Likewise.
(atomic_<atomic_op><ALLI>): Likewise.
(atomic_fetch_<atomic_op><ALLI>): Likewise.
(atomic_<atomic_op>_fetch<ALLI>): Likewise.
* doc/invoke.texi: Document -moutline-atomics.

* gcc.target/aarch64/atomic-op-acq_rel.c: Use -mno-outline-atomics.
* gcc.target/aarch64/atomic-comp-swap-release-acquire.c: Likewise.
* gcc.target/aarch64/atomic-op-acquire.c: Likewise.
* gcc.target/aarch64/atomic-op-char.c: Likewise.
* gcc.target/aarch64/atomic-op-consume.c: Likewise.
* gcc.target/aarch64/atomic-op-imm.c: Likewise.
* gcc.target/aarch64/atomic-op-int.c: Likewise.
* gcc.target/aarch64/atomic-op-long.c: Likewise.
* gcc.target/aarch64/atomic-op-relaxed.c: Likewise.
* gcc.target/aarch64/atomic-op-release.c: Likewise.
* gcc.target/aarch64/atomic-op-seq_cst.c: Likewise.
* gcc.target/aarch64/atomic-op-short.c: Likewise.
* gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: Likewise.
* gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c: Likewise.
* gcc.target/aarch64/sync-comp-swap.c: Likewise.
* gcc.target/aarch64/sync-op-acquire.c: Likewise.
* gcc.target/aarch64/sync-op-full.c: Likewise.

5 years agoaarch64: Add out-of-line functions for LSE atomics
Kyrylo Tkachov [Wed, 1 Apr 2020 10:56:24 +0000 (11:56 +0100)] 
aarch64: Add out-of-line functions for LSE atomics

This is the libgcc part of the interface -- providing the functions.
Rationale is provided at the top of libgcc/config/aarch64/lse.S.

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

* config/aarch64/lse-init.c: New file.
* config/aarch64/lse.S: New file.
* config/aarch64/t-lse: New file.
* config.host: Add t-lse to all aarch64 tuples.

5 years agoaarch64: Tidy aarch64_split_compare_and_swap
Kyrylo Tkachov [Wed, 1 Apr 2020 10:54:14 +0000 (11:54 +0100)] 
aarch64: Tidy aarch64_split_compare_and_swap

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

* config/aarch64/aarch64 (aarch64_split_compare_and_swap): Disable
strong_zero_p for aarch64_track_speculation; unify some code paths;
use aarch64_gen_compare_reg instead of open-coding.

5 years agoaarch64: Implement TImode compare-and-swap
Kyrylo Tkachov [Wed, 1 Apr 2020 10:48:52 +0000 (11:48 +0100)] 
aarch64: Implement TImode compare-and-swap

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

Backport from mainline
2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

* config/aarch64/aarch64.c (aarch64_gen_compare_reg): Add support
for NE comparison of TImode values.
(aarch64_emit_load_exclusive): Add support for TImode.
(aarch64_emit_store_exclusive): Likewise.
(aarch64_split_compare_and_swap): Disable strong_zero_p for TImode.
* config/aarch64/atomics.md (@atomic_compare_and_swap<ALLI_TI>):
Change iterator from ALLI to ALLI_TI.
(@atomic_compare_and_swap<JUST_TI>): New.
(@atomic_compare_and_swap<JUST_TI>_lse): New.
(aarch64_load_exclusive_pair): New.
(aarch64_store_exclusive_pair): New.
* config/aarch64/iterators.md (JUST_TI): New.

5 years agoaarch64: Extend %R for integer registers
Kyrylo Tkachov [Wed, 1 Apr 2020 10:43:00 +0000 (11:43 +0100)] 
aarch64: Extend %R for integer registers

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

        Backport from mainline
        2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

        * config/aarch64/aarch64.c (aarch64_print_operand): Allow integer
        registers with %R.

5 years agoDaily bump.
GCC Administrator [Wed, 1 Apr 2020 00:17:49 +0000 (00:17 +0000)] 
Daily bump.

5 years agoc++: Fix comparison of fn() and ns::fn() [PR90711]
Jason Merrill [Mon, 30 Mar 2020 20:09:43 +0000 (16:09 -0400)] 
c++: Fix comparison of fn() and ns::fn() [PR90711]

The resolution of CWG issue 1321 clarified that when deciding whether two
expressions involving template parameters are equivalent, two dependent
function calls where the function is named with an unqualified-id are
considered to be equivalent if the name is the same, even if unqualified
lookup finds different sets of functions.  We were wrongly treating
qualified-ids the same way, so that EXISTS and test::EXISTS were considered
to be equivalent even though they are looking up the name in different
scopes.  This also causes a mangling bug, but I don't think it's safe to fix
that for GCC 10; this patch just fixes the comparison.

gcc/cp/ChangeLog
2020-03-30  Jason Merrill  <jason@redhat.com>

PR c++/90711
* tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
(called_fns_equal): Check DECL_CONTEXT.

5 years agors6000: vec_rlnm fix to make builtin work according to ABI
Carl Love [Tue, 31 Mar 2020 16:41:26 +0000 (11:41 -0500)] 
rs6000: vec_rlnm fix to make builtin work according to ABI

Backport from mainline:
  commit e97929e20b2f52e6cfc046c1302324d1b24d95e3
  Author: Carl Love <carll@us.ibm.com>
  Date:   Wed Mar 25 18:33:37 2020 -0500

gcc/ChangeLog

PR target/93819
            * gcc/config/rs6000/altivec.h:
            Fixed swapped arguments for vec_rlnm define.

5 years agors6000: Add command line and builtin compatibility check
Carl Love [Tue, 31 Mar 2020 16:30:00 +0000 (11:30 -0500)] 
rs6000: Add command line and builtin compatibility check

2020-03-31  Carl Love  <cel@us.ibm.com>

backport of mainline commit

commit 68dd57808f7c0147acdb5ca72c88ff655afcb0ce
Author: Carl Love <carll@us.ibm.com>
Date:   Fri Mar 20 18:15:05 2020 -0500

whith change log typo fixed.

PR target/87583
* gcc/config/rs6000/rs6000.c (rs6000_option_override_internal):
Add check for TARGET_FPRND for Power 7 or newer.

5 years agoDaily bump.
GCC Administrator [Tue, 31 Mar 2020 00:17:33 +0000 (00:17 +0000)] 
Daily bump.

5 years ago[Fortran] Fix result-variable handling of MODULE PROCEDURE (PR94348)
Tobias Burnus [Mon, 30 Mar 2020 07:23:12 +0000 (09:23 +0200)] 
[Fortran] Fix result-variable handling of MODULE PROCEDURE (PR94348)

Backport from mainline
2020-03-28  Tobias Burnus  <tobias@codesourcery.com>

PR fortran/94348
* decl.c (gfc_match_submod_proc): Add result var to the
proc's namespace.

PR fortran/94348
* gfortran.dg/module_procedure_3.f90: New.

5 years agoDaily bump.
GCC Administrator [Mon, 30 Mar 2020 00:17:31 +0000 (00:17 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Sun, 29 Mar 2020 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

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

5 years agoc++: Fix ICE popping local scope [pr84733]
Nathan Sidwell [Fri, 27 Mar 2020 20:13:39 +0000 (13:13 -0700)] 
c++: Fix ICE popping local scope [pr84733]

PR c++/84733
* name-lookup.c (do_pushdecl): Look through cleanp levels.

5 years agoDaily bump.
GCC Administrator [Fri, 27 Mar 2020 00:17:36 +0000 (00:17 +0000)] 
Daily bump.

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

5 years agofortran: ICE using undeclared symbol in array constructor PR93484
Mark Eggleston [Wed, 25 Mar 2020 13:43:23 +0000 (13:43 +0000)] 
fortran: ICE using undeclared symbol in array constructor PR93484

Using undeclared symbol k in an expression in the following
array constructor results in an ICE:

    print *, [real(x(k))]

If the call to the intrinsic is not in a constructor a no IMPLICIT
type error is reported and the ICE does not occur.

Matching on an expression instead of an initialisation express an
and not converting a MATCH_ERROR return value into MATCH_NO results
in the no IMPLICIT error and no ICE.

Note: Steven G. Kargl  <kargl@gcc.gnu.org> is the author of the
changes except for the test cases.

gcc/fortran/ChangeLog:

Backport from master
2020-03-25  Mark Eggleston <markeggleston@gcc.gnu.org>

PR fortran/93484
* match.c (gfc_match_type_spec): Replace gfc_match_init_expr with
gfc_match_expr. Return m if m is MATCH_NO or MATCH_ERROR.

gcc/testsuite

Backport from master
2020-03-25  Mark Eggleston <markeggleston@gcc.gnu.org>

PR fortran/93484
* gfortran.dg/pr93484_1.f90: New test.
* gfortran.dg/pr93484_2.f90: New test.

5 years ago[testsuite] Fix PR93935 to guard case under vect_hw_misalign
Kewen Lin [Fri, 13 Mar 2020 10:51:21 +0000 (05:51 -0500)] 
[testsuite] Fix PR93935 to guard case under vect_hw_misalign

This patch is to apply the same fix as r267528 to another similar case
bb-slp-over-widen-2.c which requires misaligned vector access.

gcc/testsuite/ChangeLog

2020-03-25  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-13  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/93935
    * gcc.dg/vect/bb-slp-over-widen-2.c: Expect basic block vectorized
    messages only on vect_hw_misalign targets.

5 years agoDaily bump.
GCC Administrator [Wed, 25 Mar 2020 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

5 years agoDefine __BIG_ENDIAN__
John David Anglin [Tue, 24 Mar 2020 17:07:23 +0000 (17:07 +0000)] 
Define __BIG_ENDIAN__

2020-03-24  John David Anglin  <danglin@gcc.gnu.org>

PR lto/94249
* config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Define __BIG_ENDIAN__.

5 years agoAArch64: Break apart paradoxical subregs for VSTRUCT writes (PR target/94052)
Tamar Christina [Tue, 24 Mar 2020 12:36:19 +0000 (12:36 +0000)] 
AArch64: Break apart paradoxical subregs for VSTRUCT writes (PR target/94052)

This works around an ICE in reload where from expand we get the following RTL
generated for VSTRUCT mode writes:

(insn 446 354 445 2 (set (reg:CI 383)
 (subreg:CI (reg:V4SI 291) 0)) "small.i":146:22 3408 {*aarch64_movci}
 (nil))

This sequence is trying to say two things:

1) liveliness: It's trying to say that eventually the whole CI reg will be
       written to. It does this by generating the paradoxical subreg.
2) write data: It's trying to in the same instruction also write the V4SI mode
       component at offset 0 in the CI reg.

This patch fixes it by in the backend when we see such a paradoxical
construction breaking it apart and issuing a clobber to correct the liveliness
information and then emitting a normal subreg write for the component that the
paradoxical subreg was trying to write to.

Concretely we generate this:

(insn 42 41 43 (clobber (reg/v:CI 122 [ diD.5226 ])) "small.i":121:23 -1
     (nil))

(insn 43 42 44 (set (subreg:V4SI (reg/v:CI 122 [ diD.5226 ]) 0)
        (reg:V4SI 136)) "small.i":121:23 -1
     (nil))

gcc/ChangeLog:

PR target/94052
* config/aarch64/aarch64-simd.md (mov<mode>): Remove paradoxical
subregs of VSTRUCT modes.

gcc/testsuite/ChangeLog:

PR target/94052
        * g++.target/aarch64/pr94052.C: New test.

5 years agobackport PR94125: Update post order number for merged SCC.
Bin Cheng [Tue, 24 Mar 2020 09:40:21 +0000 (17:40 +0800)] 
backport PR94125: Update post order number for merged SCC.

Function loop_distribution::break_alias_scc_partitions needs to compute
SCC with runtime alias edges skipped.  As a result, partitions could be
re-assigned larger post order number than SCC's precedent partition and
distributed before the precedent one.  This fixes the issue by updating
the merged partition to the minimal post order in SCC.

Backport from mainline.
    PR tree-optimization/94125
    * tree-loop-distribution.c
    (loop_distribution::break_alias_scc_partitions): Update post order
    number for merged scc.

    * gcc.dg/tree-ssa/pr94125.c: New test.

5 years agoDaily bump.
GCC Administrator [Tue, 24 Mar 2020 00:17:39 +0000 (00:17 +0000)] 
Daily bump.

5 years agoRemove wrongly committed file.
Joseph Myers [Mon, 23 Mar 2020 19:07:40 +0000 (19:07 +0000)] 
Remove wrongly committed file.

5 years agobackport PR90763: PowerPC vec_xl_len should take const argument.
Will Schmidt [Mon, 23 Mar 2020 19:04:20 +0000 (14:04 -0500)] 
backport PR90763: PowerPC vec_xl_len should take const argument.

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

    Backport from mainline.
    2020-03-10  Will Schmidt  <will_schmidt@vnet.ibm.com>

    PR target/90763
    * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
    add clause to handle P9V_BUILTIN_VEC_LXVL with const arguments.

    * gcc.target/powerpc/pr90763.c: New.

5 years agoDarwin: Fix i686 bootstrap when the assembler supports GOTOFF in data.
Iain Sandoe [Mon, 23 Mar 2020 17:10:05 +0000 (17:10 +0000)] 
Darwin: Fix i686 bootstrap when the assembler supports GOTOFF in data.

When we use an assembler that supports " .long XX@GOTOFF", the current
combination of configuration parameters and conditional compilation
(when building an i686-darwin compiler with mdynamic-no-pic) assume that
it's OK to put jump tables in the .const section.

However, when we encounter a weak function with a jump table, this
produces relocations that directly access the weak symbol section from
the .const section - which is deemed illegal by the linker (since that
would mean that the weak symbol could not be replaced).

Arguably, this is a limitation (maybe even a bug) in the linker - but
it seems that we'd have to change the ABI to fix it - since it would
require some annotation (maybe just using a special section for the
jump tables) to tell the linker that this specific circumstance is OK
because the direct access to the weak symbol can only occur from that
symbol itself.

The fix is to force jump tables into the text section for all X86 Darwin
versions (PIC code already had this change).

gcc/ChangeLog:

2020-03-23  Iain Sandoe  <iain@sandoe.co.uk>

Backport from master.
2020-03-22  Iain Sandoe  <iain@sandoe.co.uk>

* config/i386/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Remove
references to Darwin.
* config/i386/i386.h (JUMP_TABLES_IN_TEXT_SECTION): Define this
unconditionally and comment on why.

5 years agoDaily bump.
GCC Administrator [Mon, 23 Mar 2020 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Sun, 22 Mar 2020 12:52:15 +0000 (12:52 +0000)] 
Daily bump.

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

5 years agoDaily bump.
GCC Administrator [Fri, 20 Mar 2020 00:17:30 +0000 (00:17 +0000)] 
Daily bump.

5 years agodoc: Note that some warnings depend on optimizations (PR 92757)
Jonathan Wakely [Thu, 19 Mar 2020 15:33:02 +0000 (15:33 +0000)] 
doc: Note that some warnings depend on optimizations (PR 92757)

Backport from mainline
2020-01-13  Jonathan Wakely  <jwakely@redhat.com>

PR driver/92757
* doc/invoke.texi (Warning Options): Add caveat about some warnings
depending on optimization settings.

5 years agors6000: Check -+0 and NaN for smax/smin generation
Jiufu Guo [Tue, 10 Mar 2020 05:51:57 +0000 (13:51 +0800)] 
rs6000: Check -+0 and NaN for smax/smin generation

PR93709 mentioned regressions on maxlocval_4.f90 and minlocval_f.f90 which
relates to max of '-inf' and 'nan'. This regression occur on P9 because
P9 new instruction 'xsmaxcdp' is generated.
And for C code `a < b ? b : a` is also generated as `xsmaxcdp` under -O2
for P9. While this instruction behavior more like C/C++ semantic (a>b?a:b).
In GCC9, the issue also occur as the new test case shows.

This generates prevents 'xsmaxcdp' to be generated for those cases.
'xsmincdp' also is handled in patch.

gcc/
2020-03-19  Jiufu Guo  <guojiufu@linux.ibm.com>

PR target/93709
* gcc/config/rs6000/rs6000.c (rs6000_emit_p9_fp_minmax): Check
NAN and SIGNED_ZEROR for smax/smin.

gcc/testsuite
2020-03-19  Jiufu Guo  <guojiufu@linux.ibm.com>

PR target/93709
* gcc.target/powerpc/p9-minmax-3.c: New test.

5 years agoDaily bump.
GCC Administrator [Thu, 19 Mar 2020 00:17:31 +0000 (00:17 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Wed, 18 Mar 2020 00:17:30 +0000 (00:17 +0000)] 
Daily bump.

5 years agoexpand: Don't depend on warning flags in code generation of strnlen [PR94189]
Jakub Jelinek [Tue, 17 Mar 2020 09:42:35 +0000 (10:42 +0100)] 
expand: Don't depend on warning flags in code generation of strnlen [PR94189]

The following testcase FAILs with -O2 -fcompare-debug, but the reason isn't
that we'd emit different code based on -g or non-debug, but rather that
we emit different code depending on whether -w is used or not (or e.g.
-Wno-stringop-overflow or whether some other pass emitted some other warning
already on the call).

Code generation shouldn't depend on whether we emit a warning or not if at
all possible.

The following patch punts (i.e. doesn't optimize the strnlen call to a
constant value) if we would emit the warning if it was enabled.
In the PR there is an alternate patch which does optimize the strnlen call
no matter if we emit the warning or not, though I think I prefer the version
below, e.g. the strnlen call might be crossing field boundaries, which is in
strict reading undefined, but I'd be afraid people do that in the real
world programs.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/94189
* builtins.c (expand_builtin_strnlen): Do return NULL_RTX if we would
emit a warning if it was enabled and don't depend on TREE_NO_WARNING
for code-generation.

* gcc.dg/pr94189.c: New test.

5 years agotree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]
Jakub Jelinek [Mon, 16 Mar 2020 08:03:59 +0000 (09:03 +0100)] 
tree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]

The following testcase fails with -fcompare-debug.  The problem is that
bar is marked as address_taken only with -g and not without.
I've tracked it down to insert_init_stmt calling gimple_regimplify_operands
even on DEBUG_STMTs.  That function will just insert normal stmts before
the DEBUG_STMT if the DEBUG_STMT operand isn't gimple val or invariant.
While DCE will turn those statements into debug temporaries, it can cause
differences in SSA_NAMEs and more importantly, the ipa references are
generated from those before the DCE happens.
On the testcase, the DEBUG_STMT value is (int)bar.

We could generate DEBUG_STMTs with debug temporaries instead, but I fail to
see the reason to do that, DEBUG_STMTs allow other expressions and all we
want to ensure is that the expressions aren't too large (arbitrarily
complex), but during inlining/function versioning I don't see why something
would queue a DEBUG_STMT with arbitrarily complex expressions in there.

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

PR debug/94167
* tree-inline.c (insert_init_stmt): Don't gimple_regimplify_operands
DEBUG_STMTs.

* gcc.dg/pr94167.c: New test.

5 years agotree-nested: Fix handling of *reduction clauses with C array sections [PR93566]
Jakub Jelinek [Sun, 15 Mar 2020 00:27:40 +0000 (01:27 +0100)] 
tree-nested: Fix handling of *reduction clauses with C array sections [PR93566]

tree-nested.c didn't handle C array sections in {,task_,in_}reduction clauses.

2020-03-14  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93566
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Handle {,in_,task_}reduction clauses
with C/C++ array sections.

* testsuite/libgomp.c/pr93566.c: New test.

5 years agoaarch64: Fix another bug in aarch64_add_offset_1 [PR94121]
Jakub Jelinek [Fri, 13 Mar 2020 10:33:16 +0000 (11:33 +0100)] 
aarch64: Fix another bug in aarch64_add_offset_1 [PR94121]

> I'm getting this ICE with -mabi=ilp32:
>
> during RTL pass: fwprop1
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c: In function 'bar':
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c:16:1: internal compiler error: in decompose, at rtl.h:2279

That is a preexisting issue, caused by another bug in the same function.
When mode is SImode and moffset is 0x80000000 (or anything else with the
bit 31 set), we need to sign-extend it.

2020-03-13  Jakub Jelinek  <jakub@redhat.com>

PR target/94121
* config/aarch64/aarch64.c (aarch64_add_offset_1): Use gen_int_mode
instead of GEN_INT.

5 years agomaintainer-scripts: Fix up gcc_release without -l, where mkdir was using umask 077...
Jakub Jelinek [Thu, 12 Mar 2020 17:30:16 +0000 (18:30 +0100)] 
maintainer-scripts: Fix up gcc_release without -l, where mkdir was using umask 077 after migration

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* gcc_release (upload_files): Without -l, pass -m 755 to the mkdir
command invoked through ssh.

5 years agodoc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description
Jakub Jelinek [Thu, 12 Mar 2020 08:35:30 +0000 (09:35 +0100)] 
doc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description

When looking into PR94134, I've noticed bugs in the
ASM_OUTPUT_ALIGNED_DECL_LOCAL documentation.  varasm.c has:
  #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
                                   size, align);
    return true;
  #elif defined ASM_OUTPUT_ALIGNED_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
    return true;
  #else
    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
    return false;
  #endif
and the ASM_OUTPUT_ALIGNED_LOCAL documentation properly mentions:
Like @code{ASM_OUTPUT_LOCAL} and mentions the same macro in another place.
The ASM_OUTPUT_ALIGNED_DECL_LOCAL description mentions non-existing macros
ASM_OUTPUT_ALIGNED_DECL and ASM_OUTPUT_DECL instead of the right ones
ASM_OUTPUT_ALIGNED_LOCAL and ASM_OUTPUT_LOCAL.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* doc/tm.texi.in (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change
ASM_OUTPUT_ALIGNED_DECL in description to ASM_OUTPUT_ALIGNED_LOCAL
and ASM_OUTPUT_DECL to ASM_OUTPUT_LOCAL.
* doc/tm.texi: Regenerated.

5 years agotree-dse: Fix mem* head trimming if call has lhs [PR94130]
Jakub Jelinek [Thu, 12 Mar 2020 08:34:00 +0000 (09:34 +0100)] 
tree-dse: Fix mem* head trimming if call has lhs [PR94130]

As the testcase shows, if DSE decides to head trim {mem{set,cpy,move},strncpy}
and the call has lhs, it is incorrect to leave the lhs as is, because it
will then point to the adjusted address (base + head_trim) instead of the
original base.
The following patch fixes that by dropping the lhs of the call and assigning
lhs the original base in a following statement.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94130
* tree-ssa-dse.c: Include gimplify.h.
(increment_start_addr): If stmt has lhs, drop the lhs from call and
set it after the call to the original value of the first argument.
Formatting fixes.
(decrement_count): Formatting fix.

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

5 years agopdp11: Fix handling of common (local and global) vars [PR94134]
Jakub Jelinek [Wed, 11 Mar 2020 17:35:13 +0000 (18:35 +0100)] 
pdp11: Fix handling of common (local and global) vars [PR94134]

As mentioned in the PR, the generic code decides to put the a variable into
lcomm_section, which is a NOSWITCH section and thus the generic code doesn't
switch into a particular section before using
ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL, on many targets that results just in
.lcomm (or for non-local .comm) directives which don't need a switch to some
section, other targets put switch_to_section (bss_section) at the start of
that macro.
pdp11 doesn't do that (and doesn't have bss_section), and so emits the
lcomm/comm variables in whatever section is current (it has only .text/.data
and for DEC assembler rodata).

The following patch fixes that by putting it always into data section, and
additionally avoids emitting an empty line in the assembly for the lcomm
vars.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR target/94134
* config/pdp11/pdp11.c (pdp11_asm_output_var): Call switch_to_section
at the start to switch to data section.  Don't print extra newline if
.globl directive has not been emitted.

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

5 years agoaarch64: Fix ICE in aarch64_add_offset_1 [PR94121]
Jakub Jelinek [Wed, 11 Mar 2020 09:54:22 +0000 (10:54 +0100)] 
aarch64: Fix ICE in aarch64_add_offset_1 [PR94121]

abs_hwi asserts that the argument is not HOST_WIDE_INT_MIN and as the
(invalid) testcase shows, the function can be called with such an offset.
The following patch is IMHO minimal fix, absu_hwi unlike abs_hwi allows even
that value and will return (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN
in that case.  The function then uses moffset in two spots which wouldn't
care if the value is (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN or
HOST_WIDE_INT_MIN and wouldn't accept it (!moffset and
aarch64_uimm12_shift (moffset)), then in one spot where the signedness of
moffset does matter and using unsigned is the right thing -
moffset < 0x1000000 - and finally has code which will handle even this
value right; the assembler doesn't really care for DImode immediates if
        mov     x1, -9223372036854775808
or
        mov     x1, 9223372036854775808
is used and similarly it doesn't matter if we add or sub it in DImode.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR target/94121
* config/aarch64/aarch64.c (aarch64_add_offset_1): Use absu_hwi
instead of abs_hwi, change moffset type to unsigned HOST_WIDE_INT.

* gcc.dg/pr94121.c: New test.

5 years agodfp: Fix decimal_to_binary [PR94111]
Jakub Jelinek [Wed, 11 Mar 2020 08:33:52 +0000 (09:33 +0100)] 
dfp: Fix decimal_to_binary [PR94111]

As e.g. decimal_from_decnumber shows, the REAL_VALUE_TYPE representation
contains a decimal128 embedded in ->sig only if it is rvc_normal, for
other kinds like rvc_inf or rvc_nan, ->sig is ignored and everything is
contained in the REAL_VALUE_TYPE flags (cl, sign, signalling and decimal).
decimal_to_binary which is used when folding a decimal{32,64,128} constant
to a binary floating point type ignores this and thus folds infinities and
NaNs into +0.0.
The following patch fixes that by only doing that for rvc_normal.
Similarly to the binary to decimal folding, it goes through a string, in
order to e.g. deal with canonical NaN mantissas, or binary float formats
that don't support infinities and/or NaNs.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/94111
* dfp.c (decimal_to_binary): Only use decimal128ToString if from->cl
is rvc_normal, otherwise use real_to_decimal to print the number to
string.

* gcc.dg/dfp/pr94111.c: New test.

5 years agoldist: Further fixes for -ftrapv [PR94114]
Jakub Jelinek [Wed, 11 Mar 2020 08:32:22 +0000 (09:32 +0100)] 
ldist: Further fixes for -ftrapv [PR94114]

As the testcase shows, arithmetics that for -ftrapv would need multiple
basic blocks can show up not just in nb_bytes expressions where we
are calling rewrite_to_non_trapping_overflow for a while already,
but also in the pointer expression to the start of the region.
While the testcase covers just the first hunk and I've failed to create
a testcase for the latter, it is at least in theory possible too, so I've
adjusted that hunk too.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94114
* tree-loop-distribution.c (generate_memset_builtin): Call
rewrite_to_non_trapping_overflow even on mem.
(generate_memcpy_builtin): Call rewrite_to_non_trapping_overflow even
on dest and src.

* gcc.dg/pr94114.c: New test.

5 years agoprint-rtl: Fix printing of CONST_STRING in DEBUG_INSNs [PR93399]
Jakub Jelinek [Thu, 5 Mar 2020 08:12:44 +0000 (09:12 +0100)] 
print-rtl: Fix printing of CONST_STRING in DEBUG_INSNs [PR93399]

The following testcase fails to assemble, as CONST_STRING in the DEBUG_INSNs
is printed as is, so if it contains \n and/or \r, we are in trouble:
        .loc 1 14 3
        # DEBUG haystack => [si]
        # DEBUG needle => "
"
In the gimple dumps we print those (STRING_CSTs) as
  # DEBUG haystack => D#1
  # DEBUG needle => "\n"
so this patch uses what we use in tree printing for the CONST_STRINGs too.

2020-03-05  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93399
* tree-pretty-print.h (pretty_print_string): Declare.
* tree-pretty-print.c (pretty_print_string): Remove forward
declaration, no longer static.  Change nbytes parameter type
from unsigned to size_t.
* print-rtl.c (print_value) <case CONST_STRING>: Use
pretty_print_string and for shrink way too long strings.

* gcc.dg/pr93399.c: New test.

5 years agoinliner: Copy DECL_BY_REFERENCE in copy_decl_to_var [PR93888]
Jakub Jelinek [Wed, 4 Mar 2020 11:59:04 +0000 (12:59 +0100)] 
inliner: Copy DECL_BY_REFERENCE in copy_decl_to_var [PR93888]

In the following testcase we emit wrong debug info for the karg
parameter in the DW_TAG_inlined_subroutine into main.
The problem is that the karg PARM_DECL is DECL_BY_REFERENCE and thus
in the IL has const K & type, but in the source just const K.
When the function is inlined, we create a VAR_DECL for it, but don't
set DECL_BY_REFERENCE, so when emitting DW_AT_location, we treat it like
a const K & typed variable, but it has DW_AT_abstract_origin which has
just the const K type and thus the debugger thinks the variable has
const K type.

Fixed by copying the DECL_BY_REFERENCE flag.  Not doing it in
copy_decl_for_dup_finish, because copy_decl_no_change already copies
that flag through copy_node and in copy_result_decl_to_var it is
undesirable, as we handle DECL_BY_REFERENCE in that case instead
by changing the type.

2020-03-04  Jakub Jelinek  <jakub@redhat.com>

PR debug/93888
* tree-inline.c (copy_decl_to_var): Copy DECL_BY_REFERENCE flag.

* g++.dg/guality/pr93888.C: New test.

5 years agotailcall: Fix up process_assignment [PR94001]
Jakub Jelinek [Wed, 4 Mar 2020 08:01:59 +0000 (09:01 +0100)] 
tailcall: Fix up process_assignment [PR94001]

When a function returns void or the return value is ignored, ass_var
is NULL_TREE.  The tail recursion handling generally assumes DCE has been
performed and so doesn't expect to encounter useless assignments after the
call and expects them to be part of the return value adjustment that need
to be changed into tail recursion additions/multiplications.
process_assignment does some verification and has a way to tell the caller
to try to move dead or whatever other stmts that don't participate in the
return value modifications before it is returned.
For binary rhs assignments it is just fine, neither op0 nor op1 will be
NULL_TREE and thus if *ass_var is NULL_TREE, it will not match, but unary
rhs is handled by only setting op0 to rhs1 and setting op1 to NULL_TREE.
And at this point, NULL_TREE == NULL_TREE and thus we think e.g. the
  c_2 = -e_3(D);
dead stmt is actually a return value modification, so we queue it as
multiplication and then create a void type SSA_NAME accumulator for it
and ICE shortly after.

Fixed by making sure op1 == *ass_var comparison is done only if *ass_var.

2020-03-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94001
* tree-tailcall.c (process_assignment): Before comparing op1 to
*ass_var, verify *ass_var is non-NULL.

* gcc.dg/pr94001.c: New test.

5 years ago[testsuite] Fix PR94019 to check vector char when vect_hw_misalign
Kewen Lin [Mon, 9 Mar 2020 02:55:11 +0000 (21:55 -0500)] 
[testsuite] Fix PR94019 to check vector char when vect_hw_misalign

As PR94019 shows, without misaligned vector access support but with
realign load, the vectorized loop will end up with realign scheme.
It generates mask (control vector) with return type vector signed
char which breaks the not check.

gcc/testsuite/ChangeLog

2020-03-17  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-09  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/94019
    * gcc.dg/vect/vect-over-widen-17.c: Don't expect vector char if it's
    without misaligned vector access support.

5 years ago[testsuite] Fix PR94023 to guard case under vect_hw_misalign
Kewen Lin [Mon, 9 Mar 2020 02:34:13 +0000 (21:34 -0500)] 
[testsuite] Fix PR94023 to guard case under vect_hw_misalign

As PR94023 shows, the expected SLP requires misaligned vector access
support.  This patch is to guard the check under the target condition
vect_hw_misalign to ensure that.

2020-03-17  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-09  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/94023
    * gcc.dg/vect/slp-perm-12.c: Expect loop vectorized messages only on
    vect_hw_misalign targets.

5 years agoDaily bump.
GCC Administrator [Tue, 17 Mar 2020 00:17:21 +0000 (00:17 +0000)] 
Daily bump.

5 years agolibstdc++: Add default constructor to net::service_already_exists (PR 94199)
Jonathan Wakely [Mon, 16 Mar 2020 22:55:48 +0000 (22:55 +0000)] 
libstdc++: Add default constructor to net::service_already_exists (PR 94199)

The service_already_exists exception type specified in the TS doesn't
have any constructors defined. Since its base class isn't default
constructible, that means has no usable constructors. This may be a
defect in the TS.

This patch fixes it by adding a default constructor, but making it
private. The make_service function is declared as a friend to be able to
call that private constructor.

Backport from mainline
2020-03-16  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/94199
* include/experimental/executor (service_already_exists): Add default
constructor. Declare make_service to be a friend.
* testsuite/experimental/net/execution_context/make_service.cc: New
test.

5 years agoDaily bump.
GCC Administrator [Mon, 16 Mar 2020 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

5 years agoc++: Find parameter pack in typedef in lambda [92909].
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)] 
c++: Find parameter pack in typedef in lambda [92909].

find_parameter_packs_r doesn't look through typedefs, which is normally
correct, but that means we need to handle their declarations specially.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/92909
* pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
DECL_ORIGINAL_TYPE of a typedef.

5 years agoc++: Fix ICE-after-error on partial spec [92068]
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)] 
c++: Fix ICE-after-error on partial spec [92068]

Here the template arguments for the partial specialization are valid
arguments for the template, but not for a partial specialization, because
'd' can never be deduced to anything other than an empty pack.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/92068
* pt.c (process_partial_specialization): Error rather than crash on
extra pack expansion.

5 years agoc++: Fix CTAD with multiple-arg ctor template [93248].
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)] 
c++: Fix CTAD with multiple-arg ctor template [93248].

When cp_unevaluated_operand is set, tsubst_decl thinks that if it sees a
PARM_DECL that isn't already in local_specializations, we're in a decltype
in a trailing return type or some such, and so we only want a substitution
for a single PARM_DECL.  In this case, we want the whole chain, so make sure
cp_unevaluated_operand is cleared.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/93248
* pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
substituting DECL_ARGUMENTS.

5 years agoDaily bump.
GCC Administrator [Sun, 15 Mar 2020 00:17:26 +0000 (00:17 +0000)] 
Daily bump.

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

5 years agoFix wrong year in ChangeLog.
Eric Botcazou [Fri, 13 Mar 2020 17:03:41 +0000 (18:03 +0100)] 
Fix wrong year in ChangeLog.

5 years agotree-optimization/94163 constrain alignment set by PRE
Richard Biener [Fri, 13 Mar 2020 12:56:26 +0000 (13:56 +0100)] 
tree-optimization/94163 constrain alignment set by PRE

This avoids HWI -> unsigned truncation to end up with zero alignment
which set_ptr_info_alignment ICEs on.

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

PR tree-optimization/94163
* tree-ssa-pre.c (create_expression_by_pieces): Check
whether alignment would be zero.

5 years agoFix incorrect filling of delay slots in branchy code at -O2
Eric Botcazou [Fri, 13 Mar 2020 08:58:44 +0000 (09:58 +0100)] 
Fix incorrect filling of delay slots in branchy code at -O2

The issue is that relax_delay_slots can streamline the CFG in some cases,
in particular remove BARRIERs, but removing BARRIERs changes the way the
instructions are associated with (basic) blocks by the liveness analysis
code in resource.c (find_basic_block) and thus can cause entries in the
cache maintained by resource.c to become outdated, thus producing wrong
answers downstream.

The fix is to invalidate the cache entries affected by the removal of
BARRIERs in relax_delay_slots, i.e. for the instructions down to the
next BARRIER.

PR rtl-optimization/94119
* resource.h (clear_hashed_info_until_next_barrier): Declare.
* resource.c (clear_hashed_info_until_next_barrier): New function.
* reorg.c (add_to_delay_list): Fix formatting.
(relax_delay_slots): Call clear_hashed_info_until_next_barrier on
the next instruction after removing a BARRIER.

5 years agoDaily bump.
GCC Administrator [Fri, 13 Mar 2020 00:17:19 +0000 (00:17 +0000)] 
Daily bump.

5 years agors6000: Fix -mpower9-vector -mno-altivec ICE (PR87560)
Bill Schmidt [Thu, 12 Mar 2020 20:28:50 +0000 (15:28 -0500)] 
rs6000: Fix -mpower9-vector -mno-altivec ICE (PR87560)

PR87560 reports an ICE when a test case is compiled with -mpower9-vector
and -mno-altivec.  This patch terminates compilation with an error when
this combination (and other unreasonable ones) are requested.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
regressions.  Reported error is now:

f951: Error: '-mno-altivec' turns off '-mpower9-vector'

2020-03-12  Bill Schmidt  <wschmidt@linux.ibm.com>

Backport from master
2020-03-02  Bill Schmidt  <wschmidt@linux.ibm.com>

PR target/87560
* rs6000-cpus.def (OTHER_ALTIVEC_MASKS): New #define.
* rs6000.c (rs6000_disable_incompatible_switches): Add table entry
for OPTION_MASK_ALTIVEC.

5 years agolibstdc++: Handle type-changing path concatenations (PR 94063)
Jonathan Wakely [Thu, 12 Mar 2020 17:39:05 +0000 (17:39 +0000)] 
libstdc++: Handle type-changing path concatenations (PR 94063)

The filesystem::path::operator+= and filesystem::path::concat functions
operate directly on the native format of the path and so can cause a
path to mutate to a completely different type.

For Windows combining a filename "x" with a filename ":" produces a
root-name "x:". Similarly, a Cygwin root-directory "/" combined with a
root-directory and filename "/x" produces a root-name "//x".

Before this patch the implemenation didn't support those kind of
mutations, assuming that concatenating two filenames would always
produce a filename and concatenating with a root-dir would still have a
root-dir.

This patch fixes it simply by checking for the problem cases and
creating a new path by re-parsing the result of the string
concatenation. This is slightly suboptimal because the argument has
already been parsed if it's a path, but more importantly it doesn't
reuse any excess capacity that the path object being modified might
already have allocated.

Backport from mainline
2020-03-09  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/94063
* src/c++17/fs_path.cc (path::operator+=(const path&)): Add kluge to
handle concatenations that change the type of the first component.
(path::operator+=(basic_string_view<value_type>)): Likewise.
* testsuite/27_io/filesystem/path/concat/94063.cc: New test.

5 years agolibstdc++: Fix name of macro in #undef directive
Jonathan Wakely [Thu, 12 Mar 2020 17:39:05 +0000 (17:39 +0000)] 
libstdc++: Fix name of macro in #undef directive

The macro that is defined is _GLIBCXX_NOT_FN_CALL_OP but the macro that
was named in the #undef directive was _GLIBCXX_NOT_FN_CALL. This fixes
the #undef.

Backport from mainline
2020-02-04  Jonathan Wakely  <jwakely@redhat.com>

* include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
use.

5 years agolibstdc++: Fix test failure due to -Wnonnull warnings
Jonathan Wakely [Thu, 12 Mar 2020 17:39:05 +0000 (17:39 +0000)] 
libstdc++: Fix test failure due to -Wnonnull warnings

This test fails in the Fedora RPM build (but not elsewhere, for unknown
reasons). The warning is correct, we're passing a null pointer.

Backport from mainline
2020-03-12  Jonathan Wakely  <jwakely@redhat.com>

* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
a null pointer to functions with nonnull(1) attribute.

5 years agolibstdc++: Fix FS-dependent filesystem tests
Jonathan Wakely [Thu, 12 Mar 2020 17:39:04 +0000 (17:39 +0000)] 
libstdc++: Fix FS-dependent filesystem tests

These tests were failing on XFS because it doesn't support setting file
timestamps past 2038, so the expected overflow when reading back a huge
timestamp into a file_time_type didn't happen.

Additionally, the std::filesystem::file_time_type::clock has an
epoch that is out of range of 32-bit time_t so testing times around that
epoch may also fail.

This fixes the tests to give up gracefully if the filesystem doesn't
support times that can't be represented in 32-bit time_t.

Backport from mainline
2020-02-28  Jonathan Wakely  <jwakely@redhat.com>

* testsuite/27_io/filesystem/operations/last_write_time.cc: Fixes for
filesystems that silently truncate timestamps.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Likewise.

5 years agolibstdc++: Ensure root-dir converted to forward slash (PR93244)
Jonathan Wakely [Thu, 12 Mar 2020 17:39:04 +0000 (17:39 +0000)] 
libstdc++: Ensure root-dir converted to forward slash (PR93244)

Backport from mainline
2020-01-13  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/93244
* include/bits/fs_path.h (path::generic_string<C,A>)
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
root-dir is converted to forward slash in generic pathname.
* testsuite/27_io/filesystem/path/generic/utf.cc: New test.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.

5 years agoarm: correct constraints on movsi_compare0 [PR91913]
Richard Earnshaw [Fri, 6 Mar 2020 10:04:51 +0000 (10:04 +0000)] 
arm: correct constraints on movsi_compare0 [PR91913]

The peephole that detects a mov of one register to another followed by
a comparison of the original register against zero is only used in Arm
state; but the instruction that matches this is generic to all 32-bit
compilation states.  That instruction lacks support for SP which is
permitted in Arm state, but has restrictions in Thumb2 code.

This patch fixes the problem by allowing SP when in ARM state for all
registers; in Thumb state it allows SP only as a source when the
register really is copied to another target.

gcc/ChangeLog:
PR target/91913
Backport from master
* config/arm/arm.md (movsi_compare0): Allow SP as a source register
in Thumb state and also as a destination in Arm state.  Add T16
variants.

gcc/testsuite/ChangeLog:
2020-02-10  Jakub Jelinek  <jakub@redhat.com>

PR target/91913
Backport from master
* gfortran.dg/pr91913.f90: New test.

5 years agoBackport 314b91220a07bd63f13c58e37f1b5b9430a3702b
Martin Liska [Thu, 12 Mar 2020 12:36:17 +0000 (13:36 +0100)] 
Backport 314b91220a07bd63f13c58e37f1b5b9430a3702b

Backport from mainline
2020-03-09  Martin Liska  <mliska@suse.cz>

PR target/93800
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Remove set of str_align_loops and str_align_jumps as these
should be set in previous 2 conditions in the function.
Backport from mainline
2020-03-09  Martin Liska  <mliska@suse.cz>

PR target/93800
* gcc.target/powerpc/pr93800.c: New test.

5 years agoBump BASE-VER to 9.3.1.
Jakub Jelinek [Thu, 12 Mar 2020 11:38:50 +0000 (12:38 +0100)] 
Bump BASE-VER to 9.3.1.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* BASE-VER: Set to 9.3.1.

5 years agoUpdate ChangeLog and version files for release releases/gcc-9.3.0
Jakub Jelinek [Thu, 12 Mar 2020 11:08:05 +0000 (11:08 +0000)] 
Update ChangeLog and version files for release

5 years agoDaily bump.
GCC Administrator [Thu, 12 Mar 2020 00:17:18 +0000 (00:17 +0000)] 
Daily bump.

5 years agoFix internal error on locally-defined subpools
Eric Botcazou [Wed, 11 Mar 2020 09:47:34 +0000 (10:47 +0100)] 
Fix internal error on locally-defined subpools

If the type is derived in the current compilation unit, and Allocate
is not overridden on derivation (as is typically the case with
Root_Storage_Pool_With_Subpools), the entity for Allocate of the
derived type is an alias for System.Storage_Pools.Subpools.Allocate.

The main assertion in gnat_to_gnu_entity fails in this case, since
this is not a definition and Is_Public is false (since the entity
is nested in the same compilation unit).

2020-03-11  Richard Wai  <richard@annexi-strayline.com>

* gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
the Alias of the entitiy, if is present, in the main assertion.

5 years agoDaily bump.
GCC Administrator [Wed, 11 Mar 2020 00:17:22 +0000 (00:17 +0000)] 
Daily bump.

5 years agoBackport to gcc-9: PR92398: Fix testcase failure of pr72804.c
Xionghu Luo [Tue, 10 Mar 2020 01:25:20 +0000 (20:25 -0500)] 
Backport to gcc-9: PR92398: Fix testcase failure of pr72804.c

Backport the patch to fix failures on P9 and P8BE, P7LE for PR94036.
Tested pass on P9/P8/P7.
(gcc-8 is not needed as the test doesn't exists.)

P9LE generated instruction is not worse than P8LE.
mtvsrdd;xxlnot;stxv vs. not;not;std;std.
It can have longer latency, but latency via memory is not so critical,
and this does save decode and other resources.  It's hard to choose
which is best.  Update the test case to fix failures.

gcc/testsuite/ChangeLog:

2020-03-10  Luo Xiong Hu  <luoxhu@linux.ibm.com>

backport from master.
PR testsuite/94036

2019-12-02  Luo Xiong Hu  <luoxhu@linux.ibm.com>

PR testsuite/92398
* gcc.target/powerpc/pr72804.c: Split the store function to...
* gcc.target/powerpc/pr92398.h: ... this one.  New.
* gcc.target/powerpc/pr92398.p9+.c: New.
* gcc.target/powerpc/pr92398.p9-.c: New.
* lib/target-supports.exp (check_effective_target_p8): New.
(check_effective_target_p9+): New.

5 years agoDaily bump.
GCC Administrator [Tue, 10 Mar 2020 00:17:26 +0000 (00:17 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Mon, 9 Mar 2020 00:18:12 +0000 (00:18 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Sat, 7 Mar 2020 00:18:25 +0000 (00:18 +0000)] 
Daily bump.

5 years agolibstdc++: Fix call to __glibcxx_rwlock_init (PR 94069)
Jonathan Wakely [Fri, 6 Mar 2020 12:52:51 +0000 (12:52 +0000)] 
libstdc++: Fix call to __glibcxx_rwlock_init (PR 94069)

When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
wrapper around pthread_wrlock_init, but the wrapper only takes one
argument and we try to call it with two.

This went unnnoticed on most targets because they do define the
PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
darwin8.

Backport from mainline
2020-03-06  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/94069
* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
(__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
second argument to __glibcxx_rwlock_init.
* testsuite/30_threads/shared_timed_mutex/94069.cc: New test.

5 years agoDaily bump.
GCC Administrator [Fri, 6 Mar 2020 00:18:37 +0000 (00:18 +0000)] 
Daily bump.

5 years agoc++: Avoid ICE on infinite recursion with concepts.
Jason Merrill [Thu, 5 Mar 2020 18:45:38 +0000 (13:45 -0500)] 
c++: Avoid ICE on infinite recursion with concepts.

This was simple enough to backport even though it's concepts.

gcc/cp/ChangeLog
2020-03-05  Jason Merrill  <jason@redhat.com>

PR c++/88395
PR c++/93551
* constraint.cc (constraints_satisfied_p): Use push_tinst_level.

5 years agoi386: Fix some -O0 avx2intrin.h and xopintrin.h intrinsic macros [PR94046]
Jakub Jelinek [Thu, 5 Mar 2020 18:44:42 +0000 (19:44 +0100)] 
i386: Fix some -O0 avx2intrin.h and xopintrin.h intrinsic macros [PR94046]

As the testcases show, the macros we have for -O0 for intrinsics that require
constant argument(s) should first cast the argument to the type the -O1+
inline uses and afterwards to whatever type e.g. a builtin needs.
The PR reported one which violated this, and I've grepped for all double-casts
and grepped out from that meaningful casts where the __m{128,256,512}{,d,i}
first cast is cast to same sized __v* type and has the same kind of element
type (float, double, integral).  These 7 macros were using different casts,
and I've double checked them against the inline function types.

2020-03-05  Jakub Jelinek  <jakub@redhat.com>

PR target/94046
* config/i386/avx2intrin.h (_mm_mask_i32gather_ps): Fix first cast of
SRC and MASK arguments to __m128 from __m128d.
(_mm256_mask_i32gather_ps): Fix first cast of MASK argument to __m256
from __m256d.
(_mm_mask_i64gather_ps): Fix first cast of MASK argument to __m128
from __m128d.
* config/i386/xopintrin.h (_mm_permute2_pd): Fix first cast of C
argument to __m128i from __m128d.
(_mm256_permute2_pd): Fix first cast of C argument to __m256i from
__m256d.
(_mm_permute2_ps): Fix first cast of C argument to __m128i from __m128.
(_mm256_permute2_ps): Fix first cast of C argument to __m256i from
__m256.

* g++.target/i386/pr94046-1.C: New test.
* g++.target/i386/pr94046-2.C: New test.

5 years agolibstdc++: Fix some warnings in filesystem tests
Jonathan Wakely [Thu, 5 Mar 2020 17:32:58 +0000 (17:32 +0000)] 
libstdc++: Fix some warnings in filesystem tests

There's a -Wunused-but-set-variable warning in operations/all.cc which
can be fixed with [[maybe_unused]].

The statements in operations/copy.cc give -Wunused-value warnings. I
think I meant to use |= rather than !=.

And operations/file_size.cc gets -Wsign-compare warnings.

Backport from mainline
2020-03-05  Jonathan Wakely  <jwakely@redhat.com>

* testsuite/27_io/filesystem/operations/all.cc: Mark unused variable.
* testsuite/27_io/filesystem/operations/copy.cc: Fix typo.
* testsuite/experimental/filesystem/operations/copy.cc: Likewise.
* testsuite/27_io/filesystem/operations/file_size.cc: Use correct type
for return value, and in comparison.
* testsuite/experimental/filesystem/operations/file_size.cc: Likewise.

5 years agoPR libstdc++/91910 fix data race in Debug Mode destructors
Jonathan Wakely [Thu, 5 Mar 2020 16:53:20 +0000 (16:53 +0000)] 
PR libstdc++/91910 fix data race in Debug Mode destructors

Fix data race when _Safe_iterator_base::_M_detach() runs concurrently with
the _Safe_container_base destructor.

Backport from mainline
2019-09-27  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/91910
* src/c++11/debug.cc (_Safe_iterator_base::_M_detach()): Load pointer
atomically and lock the mutex before accessing the sequence.
(_Safe_local_iterator_base::_M_detach()): Likewise.
(_Safe_iterator_base::_M_reset()): Clear _M_sequence atomically.

5 years agoAdd 'noexcept' to std::lerp
Jonathan Wakely [Thu, 5 Mar 2020 16:52:19 +0000 (16:52 +0000)] 
Add 'noexcept' to std::lerp

Backport from mainline
2019-06-17  Jonathan Wakely  <jwakely@redhat.com>

* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).

5 years agolibstdc++: make negative count safe with std::for_each_n
Jonathan Wakely [Thu, 5 Mar 2020 16:52:19 +0000 (16:52 +0000)] 
libstdc++: make negative count safe with std::for_each_n

The Library Working Group have approved a change to std::for_each_n that
requires it to handle negative N gracefully, which we were not doing for
random access iterators.

Backport from mainline
2019-11-07  Jonathan Wakely  <jwakely@redhat.com>

* include/bits/stl_algo.h (for_each_n): Handle negative count.
* testsuite/25_algorithms/for_each/for_each_n_debug.cc: New test.

5 years agolibstdc++: Avoid using sizeof with function types (PR 93470)
Jonathan Wakely [Thu, 5 Mar 2020 16:52:19 +0000 (16:52 +0000)] 
libstdc++: Avoid using sizeof with function types (PR 93470)

Backport from mainline
2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/93470
* include/bits/refwrap.h (reference_wrapper::operator()): Restrict
static assertion to object types.

5 years agoarm: Fix incorrect modes with 'borrow' operations [PR90311]
Richard Earnshaw [Thu, 18 Jul 2019 13:56:52 +0000 (13:56 +0000)] 
arm: Fix incorrect modes with 'borrow' operations [PR90311]

Looking through the arm backend I noticed that the modes used to pass
comparison types into subtract-with-carry operations were being
incorrectly set.  The result is that the compiler is not truly
self-consistent.  To clean this up I've introduced a new predicate,
arm_borrow_operation (borrowed from the AArch64 backend) which can
match the comparison type with the required mode and then fixed all
the patterns to use this.  The split patterns that were generating
incorrect modes have all obviously been fixed as well.

The basic rule for the use of a borrow is:
- if the condition code was set by a 'subtract-like' operation (subs, cmp),
  then use CCmode and LTU.
- if the condition code was by unsigned overflow of addition (adds), then
  use CC_Cmode and GEU.

gcc:
PR target/90311
Backport from master
* config/arm/predicates.md (arm_borrow_operation): New predicate.
* config/arm/arm.c (subdi3_compare1): Use CCmode for the split.
(arm_subdi3, subdi_di_zesidi, subdi_di_sesidi): Likewise.
(subdi_zesidi_zesidi): Likewise.
(negdi2_compare, negdi2_insn): Likewise.
(negdi_extensidi): Likewise.
(negdi_zero_extendsidi): Likewise.
(arm_cmpdi_insn): Likewise.
(subsi3_carryin): Use arm_borrow_operation.
(subsi3_carryin_const): Likewise.
(subsi3_carryin_const0): Likewise.
(subsi3_carryin_compare): Likewise.
(subsi3_carryin_compare_const): Likewise.
(subsi3_carryin_compare_const0): Likewise.
(subsi3_carryin_shift): Likewise.
(rsbsi3_carryin_shift): Likewise.
(negsi2_carryin_compare): Likewise.

gcc/testsuite:
2020-03-05  Jakub Jelinek  <jakub@redhat.com>

Backport from master
PR target/90311
* gcc.c-torture/execute/pr90311.c: New test.

5 years agotestsuite: Compile asan_test.C with -Wno-alloc-size-larger-than
Uros Bizjak [Thu, 5 Mar 2020 16:53:03 +0000 (17:53 +0100)] 
testsuite: Compile asan_test.C with -Wno-alloc-size-larger-than

asan_test.cc tries to allocate 0xf0000000 bytes for 32bit targets in
a disabled DISABLED_DemoOOM test.  Since the testcase is compiled with
-Werror, the compilation fails with:

error: argument 1 value '4026531840' exceeds maximum object size 2147483647

Compile with -Wno-alloc-size-larger-than to avoid compilation failure.

* g++.dg/asan/asan_test.C (dg-options): Add
-Wno-alloc-size-larger-than.

5 years agoBackport fix for PR c++/93753 from trunk.
Martin Sebor [Thu, 5 Mar 2020 16:37:25 +0000 (09:37 -0700)] 
Backport fix for PR c++/93753 from trunk.

gcc/cp/ChangeLog:
Backport from trunk.
2020-02-21  Martin Sebor  <msebor@redhat.com>

PR c++/93753
* class.c (check_flexarrays): Tighten up a test for potential members
of anonymous structs or unions.

gcc/testsuite/ChangeLog:

Backport from trunk.
2020-02-21  Martin Sebor  <msebor@redhat.com>

PR c++/93753
* g++.dg/ext/flexary36.C: New test.

5 years agoc++: Fix SFINAE for invalid non-type tparm types.
Jason Merrill [Thu, 5 Mar 2020 15:22:25 +0000 (10:22 -0500)] 
c++: Fix SFINAE for invalid non-type tparm types.

Just missing the usual SFINAE pattern here.  This was fixed for GCC 10 as a
drive-by in r277902.

gcc/cp/ChangeLog
2020-03-05  Jason Merrill  <jason@redhat.com>

PR c++/90338
* pt.c (invalid_nontype_parm_type_p): Check complain for non-literal
and mutable errors.

5 years agoFix ICE in trans_associate_var
Paul Thomas [Thu, 5 Mar 2020 10:01:59 +0000 (11:01 +0100)] 
Fix ICE in trans_associate_var

2020-03-05  Paul Thomas  <pault@gcc.gnu.org>

Backport from trunk
PR fortran/92976
* match.c (select_type_set_tmp): Variable 'selector' to replace
select_type_stack->selector. If the selector array spec has
explicit bounds, make the temporary's bounds deferred.

2020-03-05  Paul Thomas  <pault@gcc.gnu.org>

Backport from trunk
PR fortran/92976
* gfortran.dg/select_type_48.f90 : New test.

5 years agoc++: Fix constexpr ICE from const mismatch [PR91607]
Jason Merrill [Thu, 5 Mar 2020 04:07:13 +0000 (23:07 -0500)] 
c++: Fix constexpr ICE from const mismatch [PR91607]

gcc/cp/ChangeLog
2020-03-04  Jason Merrill  <jason@redhat.com>

PR c++/91607
* constexpr.c (constexpr_call_hasher::equal): Use
same_type_ignoring_top_level_qualifiers_p.