]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agox86: Handle -mavx512vpopcntdq for -march=native
H.J. Lu [Fri, 22 May 2020 11:18:34 +0000 (04:18 -0700)] 
x86: Handle -mavx512vpopcntdq for -march=native

Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.

PR target/95258
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
AVX512VPOPCNTDQ.

(cherry picked from commit 808b611bfb4b05703ea174e50874c711dca44c98)

5 years agoDaily bump.
GCC Administrator [Sun, 24 May 2020 00:17:49 +0000 (00:17 +0000)] 
Daily bump.

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

5 years agoAdd early return for invalid STATUS for close.
Thomas Koenig [Thu, 14 May 2020 16:30:27 +0000 (18:30 +0200)] 
Add early return for invalid STATUS for close.

2020-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/95119
* io/close.c (close_status): Add CLOSE_INVALID.
(st_close): Return early on invalid STATUS parameter.

2020-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/95119
* testsuite/libgomp.fortran/close_errors_1.f90: New test.

(cherry picked from commit cdc34b505796327b3eee9e97bc5f27ba71fd9e7a)
(cherry picked from commit d975519ad1066ed0397714c91aafadadb52a63dd)
(cherry picked from commit 8275e0a6686b465d4d1717784e3e864305d37d02)

5 years agoAdd missing unit dependence vector in data dependence analysis
Bin Cheng [Fri, 22 May 2020 03:42:11 +0000 (11:42 +0800)] 
Add missing unit dependence vector in data dependence analysis

Current data dependence analysis misses unit distant vector if DRs in
DDR have the same invariant access functions.  This adds the vector as
the constant access function case.

Also fix typo in testcase.

Backport from master.

2020-05-13  Bin Cheng  <bin.cheng@linux.alibaba.com>

gcc/
PR tree-optimization/94969
* tree-data-ref.c (constant_access_functions): Rename to...
(invariant_access_functions): ...this.  Add parameter.  Check for
invariant access function, rather than constant.
(build_classic_dist_vector): Call above function.
* tree-loop-distribution.c (pg_add_dependence_edges): Add comment.

gcc/testsuite/
PR tree-optimization/94969
* gcc.dg/tree-ssa/pr94969.c: New test.

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

gcc/testsuite/
PR tree-optimization/95110
* gcc.dg/tree-ssa/pr94969.c: Swap scan-tree-dump-not arguments.

5 years agoDaily bump.
GCC Administrator [Fri, 22 May 2020 00:17:38 +0000 (00:17 +0000)] 
Daily bump.

5 years agoFix backport due to usage for x_target_flags.
Martin Liska [Thu, 21 May 2020 14:53:35 +0000 (16:53 +0200)] 
Fix backport due to usage for x_target_flags.

gcc/ChangeLog:

* common/config/aarch64/aarch64-common.c (aarch64_handle_option):
Use MASK_OUTLINE_ATOMICS for x_target_flags.

(cherry picked from commit f26cfe27e19eeb538675ffb2de0503b760662261)

5 years agoAdd outline-atomics to target attribute.
Martin Liska [Thu, 21 May 2020 10:45:47 +0000 (12:45 +0200)] 
Add outline-atomics to target attribute.

* common/config/aarch64/aarch64-common.c (aarch64_handle_option):
Handle OPT_moutline_atomics.
* config/aarch64/aarch64.c: Add outline-atomics to
aarch64_attributes.

* doc/extend.texi: Document the newly added target attribute.

* gcc.target/aarch64/target_attr_20.c: New test.
* gcc.target/aarch64/target_attr_21.c: New test.

(cherry picked from commit 9e02b45ffc60e0078bde3c56a14f00c54b7f8039)

5 years agox86: Update VPCLMULQDQ check
H.J. Lu [Wed, 20 May 2020 01:55:08 +0000 (18:55 -0700)] 
x86: Update VPCLMULQDQ check

Update VPCLMULQDQ check to support processors with AVX version of
VPCLMULQDQ.

Backport from master
PR target/91695
* config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ
check.

(cherry picked from commit 1e46a443f25d26816536c0c480211714b123a1d5)

5 years agoDaily bump.
GCC Administrator [Thu, 21 May 2020 00:18:01 +0000 (00:18 +0000)] 
Daily bump.

5 years agoFortran : ProcPtr function results: 'ppr@' in error message PR39695
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.

Backported 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.

(cherry picked from commit eb069ae8819c3a84d7f78becc5501e21ee3a9554)

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

5 years agox86: Update GFNI check
H.J. Lu [Tue, 19 May 2020 21:42:12 +0000 (14:42 -0700)] 
x86: Update GFNI check

Update GFNI check to support processors with SSE and AVX versions of GFNI.

Backport from master
PR target/95220
* config/i386/cpuinfo.c (get_available_features): Fix
FEATURE_GFNI check.

5 years agoDaily bump.
GCC Administrator [Tue, 19 May 2020 00:18:07 +0000 (00:18 +0000)] 
Daily bump.

5 years agoRequire powerpc_vsx_ok in gcc.target/powerpc/pr71763.c
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.

gcc/testsuite/

        * gcc.target/powerpc/pr71763.c: Require powerpc_vsx_ok.

(cherry picked from commit c917584aa9ec32934acf0082ed383b04f49fd174)

5 years agod: Fix multiple definition error when using mixins and interfaces.
Iain Buclaw [Mon, 16 Mar 2020 22:04:49 +0000 (23:04 +0100)] 
d: Fix multiple definition error when using mixins and interfaces.

gcc/d/ChangeLog:

PR d/92216
* decl.cc (make_thunk): Don't set TREE_PUBLIC on thunks if the target
function is external to the current compilation.

gcc/testsuite/ChangeLog:

PR d/92216
* gdc.dg/imports/pr92216.d: New.
* gdc.dg/pr92216.d: New test.

5 years agoDaily bump.
GCC Administrator [Mon, 18 May 2020 00:17:45 +0000 (00:17 +0000)] 
Daily bump.

5 years agod: Fix ICE in verify_gimple_stmt, at tree-cfg.c:4959
Iain Buclaw [Sun, 17 May 2020 14:28:24 +0000 (16:28 +0200)] 
d: Fix ICE in verify_gimple_stmt, at tree-cfg.c:4959

Both array concat and array new expressions wrapped any temporaries
created into a BIND_EXPR.  This does not work if an expression used to
construct the result requires scope destruction, which is represented by
a TARGET_EXPR with a clean-up, and a CLEANUP_POINT_EXPR at the
location where the temporaries logically go out of scope.  The reason
for this not working is because the lowering of cleanup point
expressions does not traverse inside BIND_EXPRs to expand any gimple
cleanup expressions within.

The use of creating BIND_EXPR has been removed at both locations, and
replaced with a normal temporary variable that has initialization
delayed until its address is taken.

gcc/d/ChangeLog:

PR d/94970
* d-codegen.cc (force_target_expr): Move create_temporary_var
implementation inline here.
(create_temporary_var): Remove.
(maybe_temporary_var): Remove.
(bind_expr): Remove.
* d-convert.cc (d_array_convert): Use build_local_temp to generate
temporaries, and generate its assignment.
* d-tree.h (create_temporary_var): Remove.
(maybe_temporary_var): Remove.
(d_array_convert): Remove vars argument.
* expr.cc (ExprVisitor::visit (CatExp *)): Use build_local_temp to
generate temporaries, don't wrap them in a BIND_EXPR.
(ExprVisitor::visit (NewExp *)): Likewise.

gcc/testsuite/ChangeLog:

PR d/94970
* gdc.dg/pr94970.d: New test.

5 years agoDaily bump.
GCC Administrator [Sun, 17 May 2020 00:18:03 +0000 (00:18 +0000)] 
Daily bump.

5 years agod: Fix wrong vtable offset in virtual function call
Iain Buclaw [Sat, 16 May 2020 21:33:15 +0000 (23:33 +0200)] 
d: Fix wrong vtable offset in virtual function call

The Semantic (pass 1) analysis for classes is handled by
ClassDeclaration::semantic.  For a given class, this method may be ran
multiple times in order to resolve forward references.  The method
incrementally tries to resolve the types referred to by the members of
the class.

The subsequent calls to this method are short-circuited if the class
members have been fully analyzed.  For this the code tests that it is
not the first/main call to the method (semanticRun == PASS.init else
branch), scx is not set, and that the this->symtab is already set.  If
all these conditions are met, the method returns.  But before returning,
the method was setting this->semanticRun to PASSsemanticdone.  It should
not set semanticRun since the class has not been fully analyzed yet.
The base class analysis for this class could be pending and as a result
vtable may not have been fully created.

This fake setting of semanticRun results in the semantic analyzer to
believe that the class has been fully analyzed.  As exposed by the
issues in upstream, it may result in compile time errors when a derived
type class is getting analyzed and because of this fake semanticdone on
the base class, the semantic analysis construes that an overriden method
is not defined in the base class.  PR95155 exposes anoter scenario where
a buggy vtable may be created and a call to a class method may result in
execution of some adhoc code.

gcc/d/ChangeLog:

PR d/95155
* dmd/dclass.c (ClassDeclaration::semantic): Don't prematurely
set done on semantic analysis.

gcc/testsuite/ChangeLog:

PR d/95155
* gdc.test/compilable/imports/pr9471a.d: New test.
* gdc.test/compilable/imports/pr9471b.d: New test.
* gdc.test/compilable/imports/pr9471c.d: New test.
* gdc.test/compilable/imports/pr9471d.d: New test.
* gdc.test/compilable/pr9471.d: New test.

5 years agolibphobos: Fix struct layout of stat_t on sparc-*-solaris*
Iain Buclaw [Sat, 16 May 2020 20:32:17 +0000 (22:32 +0200)] 
libphobos: Fix struct layout of stat_t on sparc-*-solaris*

The last change to the bindings removed the st_pad3 field from the wrong
struct.  It should have been stat64_t that needed updating instead.

libphobos/ChangeLog

PR d/90719
* libdruntime/core/sys/posix/sys/stat.d (Solaris): Move st_pad3 from
struct stat64_t to stat32_t.

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

5 years agoDaily bump.
GCC Administrator [Fri, 15 May 2020 00:17:56 +0000 (00:17 +0000)] 
Daily bump.

5 years agoaarch64: don't emit bti j after NOTE_INSN_DELETED_LABEL [PR94748]
Szabolcs Nagy [Fri, 24 Apr 2020 16:36:02 +0000 (17:36 +0100)] 
aarch64: don't emit bti j after NOTE_INSN_DELETED_LABEL [PR94748]

It was previously discussed that indirect branches cannot go to
NOTE_INSN_DELETED_LABEL so inserting a landing pad is unnecessary.
See https://gcc.gnu.org/pipermail/gcc-patches/2019-May/522625.html

Before the patch a bti j was inserted after the label in

  __attribute__((target("branch-protection=bti")))
  int foo (void)
  {
  label:
    return 0;
  }

This is not necessary and weakens the security protection.

gcc/ChangeLog:

Backport from mainline.
2020-04-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94748
* config/aarch64/aarch64-bti-insert.c (rest_of_insert_bti): Remove
the check for NOTE_INSN_DELETED_LABEL.

gcc/testsuite/ChangeLog:

Backport from mainline.
2020-04-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94748
* gcc.target/aarch64/pr94748.c: New test.

5 years agoaarch64: ensure bti c is emitted at function start [PR94697]
Szabolcs Nagy [Fri, 17 Apr 2020 15:54:12 +0000 (16:54 +0100)] 
aarch64: ensure bti c is emitted at function start [PR94697]

The bti pass currently first emits bti c at function start
if there is no paciasp (which also acts as indirect call
landing pad), then bti j is emitted at jump labels, however
if there is a label right before paciasp then the function
start can end up like

  foo:
  label:
    bti j
    paciasp
    ...

This patch is a minimal fix that just moves the bti c handling
after the bti j handling so we end up with

  foo:
    bti c
  label:
    bti j
    paciasp
    ...

This could be improved by emitting bti jc in this case, or by
detecting that the label is not in fact an indirect jump target
and then this situation would be much less common.

Needs to be backported to gcc-9 branch.

Backported without the testcase because of missing infrastructure
for check-function-bodies.

gcc/ChangeLog:

Backport from mainline.
2020-04-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94697
* config/aarch64/aarch64-bti-insert.c (rest_of_insert_bti): Swap
bti c and bti j handling.

5 years agoaarch64: Fix .cfi_window_save with pac-ret [PR94515]
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.

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.

5 years agoaarch64, libgcc: Fix unwinding from pac-ret to normal frames [PR94514]
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.

gcc/testsuite/ChangeLog:

Backport from mainline.
2020-04-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94514
* g++.target/aarch64/pr94514.C: Require lp64.
* gcc.target/aarch64/pr94514.c: Likewise.

Backport from mainline.
2020-04-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94514
* g++.target/aarch64/pr94514.C: New test.
* gcc.target/aarch64/pr94514.c: New test.

libgcc/ChangeLog:

Backport from mainline.
2020-04-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

PR target/94514
* config/aarch64/aarch64-unwind.h (aarch64_frob_update_context):
Update context->flags accroding to the frame state.

5 years agoDaily bump.
GCC Administrator [Thu, 14 May 2020 00:17:55 +0000 (00:17 +0000)] 
Daily bump.

5 years agoFortran : ICE in gfc_conv_array_constructor_expr PR93497
Mark Eggleston [Thu, 7 May 2020 07:29:14 +0000 (08:29 +0100)] 
Fortran  : ICE in gfc_conv_array_constructor_expr PR93497

Invalid expressions, such as those involving array constructors,
used for the length of character types will cause an ICE.

2020-05-11  Mark Eggleston  <markeggleston@gcc.gnu.org>

Backported from master
2020-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/

PR fortran/93497
* decl.c (char_len_param_value): Check whether character
length expression is of type EXPR_OP and if so simplify it.
* resolve.c (resolve_charlen): Reject length if it has a
rank.

2020-05-11  Mark Eggleston  <markeggleston@gcc.gnu.org>

Backported from master
2020-05-13  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

PR fortran/93497
* gfortran.dg/pr88025.f90: Change in wording of error.
* gfortran.dg/pr93497.f90: New test.
* gfortran.dg/pr93714_1.f90: Change in wording of errors.
* gfortran.dg/pr93714_2.f90: Change in wording of errors.

5 years agoDaily bump.
GCC Administrator [Wed, 13 May 2020 00:18:03 +0000 (00:18 +0000)] 
Daily bump.

5 years agolibstdc++: Fix incorrect size calculation in PMR resource (PR 94906)
Jonathan Wakely [Tue, 12 May 2020 08:54:44 +0000 (09:54 +0100)] 
libstdc++: Fix incorrect size calculation in PMR resource  (PR 94906)

Calculating the size of a chunk being returned to the upstream allocator
was done with a 32-bit type, so it wrapped if the chunk was 4GB or
larger.

I don't know how to test this without allocating 4GB, so there's no test
in the testsuite. It has been tested manually of course.

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

PR libstdc++/94906
* src/c++17/memory_resource.cc
(monotonic_buffer_resource::_Chunk::release): Use size_t for shift
operands.

5 years agors6000: Link with libc128.a for long-double-128.
Clement Chigot [Wed, 8 Apr 2020 20:58:36 +0000 (16:58 -0400)] 
rs6000: Link with libc128.a for long-double-128.

AIX applications using 128-bit long double must be linked with
libc128.a, in order to have 128-bit compatible routines.

AIX 7.2, 7.1, 6.1: Build/Tests: OK

2020-04-03 Clément Chigot <clement.chigot@atos.net>

* config/rs6000/aix61.h (LIB_SPEC): Add -lc128 with -mlong-double-128.
* config/rs6000/aix71.h (LIB_SPEC): Likewise.
* config/rs6000/aix72.h (LIB_SPEC): Likewise.

5 years agors6000: AIX long double builtins for 64 bit long double.
David Edelsohn [Tue, 12 May 2020 15:46:47 +0000 (11:46 -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 explicit
        for fmodl, frexpl, ldexpl and modfl builtins.

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

5 years agoFortran : Spurious warning message with -Wsurprising PR59107
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_typebound_procedure): Use new field
name.  (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.

5 years agors6000: Don't use HARD_FRAME_POINTER_REGNUM if it's not live in pro_and_epilogue...
Xionghu Luo [Mon, 11 May 2020 01:27:38 +0000 (20:27 -0500)] 
rs6000: Don't use HARD_FRAME_POINTER_REGNUM if it's not live in pro_and_epilogue (PR91518)

Backport from master.

This bug is exposed by FRE refactor of r263875.  Comparing the fre
dump file shows no obvious change of the segment fault function proves
it to be a target issue.
frame_pointer_needed is set to true in reload pass setup_can_eliminate,
but regs_ever_live[31] is false, pro_and_epilogue uses it without live
check causing CPU2006 465.tonto segment fault of loading from invalid
addresses due to r31 not saved/restored.  Thus, add HARD_FRAME_POINTER_REGNUM
live check with frame_pointer_needed_indeed when generating pro_and_epilogue
instructions.

gcc/ChangeLog

2020-05-11  Xiong Hu Luo  <luoxhu@linux.ibm.com>

Backport from master.
2020-04-27  Xiong Hu Luo  <luoxhu@linux.ibm.com>

PR target/91518
* config/rs6000/rs6000.c (frame_pointer_needed_indeed):
New variable.
(rs6000_emit_prologue_components):
Check with frame_pointer_needed_indeed.
(rs6000_emit_epilogue_components): Likewise.
(rs6000_emit_prologue): Likewise.
(rs6000_emit_epilogue): Set frame_pointer_needed_indeed.

5 years agoDaily bump.
GCC Administrator [Mon, 11 May 2020 00:18:03 +0000 (00:18 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Sun, 10 May 2020 00:17:52 +0000 (00:17 +0000)] 
Daily bump.

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

5 years agoDaily bump.
GCC Administrator [Fri, 8 May 2020 00:17:54 +0000 (00:17 +0000)] 
Daily bump.

5 years agoalpha: Implement the PR94780 fix for alpha.
Uros Bizjak [Thu, 7 May 2020 15:21:15 +0000 (17:21 +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.

5 years agotestsuite: Improve g++.dg/ext/attr-parm-1.C testcase [PR94946]
Jakub Jelinek [Thu, 7 May 2020 12:56:51 +0000 (14:56 +0200)] 
testsuite: Improve g++.dg/ext/attr-parm-1.C testcase [PR94946]

The testcase in the current form doesn't FAIL without the patch on
x86_64-linux unless also testing with -m32; as that the 64-bit testing
on that target is probably way more common, and we can use also attributes
that FAIL without the patch with -m64, the following patch adjusts the
test, so that it FAILs without the patch for both -m64 and -m32 (but not
-mx32) and PASSes with the patch.

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

PR c++/94946
* g++.dg/ext/attr-parm-1.C: Enable the test also for lp64 x86, use
sysv_abi and ms_abi attributes in that case instead of fastcall and
no attribute.

5 years agoUpdate the baseline symbols for SPARC64/Linux
Eric Botcazou [Thu, 7 May 2020 12:11:43 +0000 (14:11 +0200)] 
Update the baseline symbols for SPARC64/Linux

5 years agolibstdc++: Update Solaris baselines for GCC 9.4
Rainer Orth [Thu, 7 May 2020 07:41:21 +0000 (09:41 +0200)] 
libstdc++: Update Solaris baselines for GCC 9.4

Just as for GCC 10.1, the libstdc++ ABI baselines need to be regenerated on
the gcc-9 branch for the GLIBCXX_3.4.28 symbols added in GCC 9.3.0.  The
following patch does that for Solaris.

Tested on i386-pc-solaris2.1[01] and sparc-sun-solaris2.1[01].

* config/abi/post/i386-solaris2.10/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris2.10/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/i386-solaris2.11/baseline_symbols.txt: Likewise.
* config/abi/post/i386-solaris2.11/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris2.10/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris2.10/sparcv9/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris2.11/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris2.11/sparcv9/baseline_symbols.txt:
Likewise.

5 years agoDaily bump.
GCC Administrator [Thu, 7 May 2020 00:18:04 +0000 (00:18 +0000)] 
Daily bump.

5 years agoc++: QT overload regression with attribute [PR94946]
Nathan Sidwell [Wed, 6 May 2020 19:37:30 +0000 (12:37 -0700)] 
c++: QT overload regression with attribute [PR94946]

Jason's fix for 90570 & 79585 was a bit overzealous.  Dependent attribs should still
ttach to a parameter decl.

                * decl.c (grokdeclarator): Don't splice template attributes in
                parm context -- they can apply to the parm.

5 years agolibstdc++: Document library versioning for 9.[123] and 10.1
Jonathan Wakely [Wed, 6 May 2020 09:30:15 +0000 (10:30 +0100)] 
libstdc++: Document library versioning for 9.[123] and 10.1

* doc/xml/manual/abi.xml (abi.versioning.history): Document library
versions for GCC 9.[123] and 10.1 releases.
* doc/html/*: Regenerate.

5 years agolibstdc++: Update {x86_64,i?86,powerpc64,s390x,aarch64}-linux baselines for GCC 10.1
Jakub Jelinek [Wed, 6 May 2020 09:21:28 +0000 (11:21 +0200)] 
libstdc++: Update {x86_64,i?86,powerpc64,s390x,aarch64}-linux baselines for GCC 10.1

On Wed, May 06, 2020 at 10:49:13AM +0200, Rainer Orth wrote:
> I just remembered that the libstdc++ ABI baselines haven't been updated
> for the GCC 10 release yet.  This patch corrects this for Solaris/SPARC
> and x86.

Oops, here are the updates from Fedora packages built during the weekend.

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

* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.

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

5 years agoIBM Z: vec_store_len_r/vec_load_len_r fix
Andreas Krebbel [Tue, 5 May 2020 08:46:33 +0000 (10:46 +0200)] 
IBM Z: vec_store_len_r/vec_load_len_r fix

This fixes a problem with the vec_store_len_r intrinsic.  The macros
mapping the intrinsic to a GCC builtin had the wrong signature.

With the patch an immediate length operand of vlrl/vstrl is handled
the same way as if it was passed in a register to vlrlr/vstrlr.
Values bigger than 15 always load the full vector.  If it can be
recognized that it is in effect a full vector register load or store
it is now implemented with vl/vst instead.

gcc/ChangeLog:

2020-05-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2020-04-30  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/constraints.md ("j>f", "jb4"): New constraints.
* config/s390/vecintrin.h (vec_load_len_r, vec_store_len_r): Fix
macro definitions.
* config/s390/vx-builtins.md ("vlrlrv16qi", "vstrlrv16qi"): Add a
separate expander.
("*vlrlrv16qi", "*vstrlrv16qi"): Add alternative for vl/vst.
Change constraint for vlrl/vstrl to jb4.

gcc/testsuite/ChangeLog:

2020-05-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2020-04-30  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/zvector/vec_load_len_r.c: New test.
* gcc.target/s390/zvector/vec_store_len_r.c: New test.

5 years agoDaily bump.
GCC Administrator [Tue, 5 May 2020 00:18:00 +0000 (00:18 +0000)] 
Daily bump.

5 years agolibstdc++: Fix broken link to SGI STL FAQ
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.

5 years agoFix Ada bootstrap on Cygwin64
Eric Botcazou [Mon, 4 May 2020 21:32:39 +0000 (23:32 +0200)] 
Fix Ada bootstrap on Cygwin64

This fixes a compilation error preventing bootstrap with Ada
on x86_64-pc-cygwin.

2020-05-04  Mikael Pettersson  <mikpelinux@gmail.com>

PR bootstrap/94918
* mingw32.h: Prevent windows.h from including emmintrin.h on Cygw64.

5 years agoICE in gfc_get_dataptr_offset, at fortran/trans-array.c:6951
Tobias Burnus [Mon, 4 May 2020 11:47:41 +0000 (13:47 +0200)] 
ICE in gfc_get_dataptr_offset, at fortran/trans-array.c:6951

 gcc/testsuite/
Backport from mainline.
2020-03-08  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/93581
* resolve.c (gfc_resolve_ref): Modify array refs to be elements
if the ref chain ends in INQUIRY_LEN.
* trans-array.c (gfc_get_dataptr_offset): Provide the offsets
for INQUIRY_RE and INQUIRY_IM.

gcc/testsuite/
Backport from mainline.
2020-03-08  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/93581
* gfortran.dg/inquiry_type_ref_6.f90 : New test.

5 years agoAdd missing changelog entries
Andreas Krebbel [Mon, 4 May 2020 08:50:42 +0000 (10:50 +0200)] 
Add missing changelog entries

5 years agoS/390: Fix PR94666
Andreas Krebbel [Mon, 20 Apr 2020 18:06:53 +0000 (20:06 +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>

* g++.dg/pr94666.C: New test.

5 years agoPR94613: Fix vec_sel builtin for IBM Z
Andreas Krebbel [Mon, 20 Apr 2020 17:36:33 +0000 (19:36 +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.

5 years agoAdd unsigned type iv_cand for iv_use with non mode-precision type
Bin Cheng [Mon, 4 May 2020 06:28:54 +0000 (14:28 +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.

gcc/testsuite/
    * g++.dg/pr93674.C: New test.

5 years agoDaily bump.
GCC Administrator [Mon, 4 May 2020 00:17:45 +0000 (00:17 +0000)] 
Daily bump.

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

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

5 years agoRevert patch for PR fortran/93956.
Thomas Koenig [Fri, 1 May 2020 12:45:56 +0000 (14:45 +0200)] 
Revert patch for PR fortran/93956.

2020-04-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/93956
    PR fortran/94788
    * expr.c (gfc_check_pointer_assign): Revert patch for PR 93956.
    * interface.c: Likewise.

5 years ago[RS6000] PR94145, make PLT loads volatile
Alan Modra [Wed, 11 Mar 2020 10:52:37 +0000 (21:22 +1030)] 
[RS6000] PR94145, make PLT loads volatile

PR target/94145
* config/rs6000/rs6000.c (rs6000_longcall_ref): Use unspec_volatile
for PLT16_LO.
* config/rs6000/rs6000.md (UNSPEC_PLT16_LO): Remove.
(UNSPECV_PLT16_LO): Define.
(pltseq_plt16_lo_): Use unspec_volatile.

(cherry picked from commit 19e5389debb03c3623f6a2ce8a8f6f4aa2118901)
minus the PLT_PCREL parts

5 years agoDaily bump.
GCC Administrator [Fri, 1 May 2020 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

5 years agors6000, Fix header comment for intrinsic function _mm_movemask_epi8
Carl Love [Wed, 22 Apr 2020 16:57:53 +0000 (11:57 -0500)] 
rs6000, Fix header comment for intrinsic function _mm_movemask_epi8

gcc/ChangeLog

2020-04-30  Carl Love  <cel@us.ibm.com>

* config/rs6000/emmintrin.h (_mm_movemask_epi8): Fix comment.

5 years agoDaily bump.
GCC Administrator [Thu, 30 Apr 2020 00:17:22 +0000 (00:17 +0000)] 
Daily bump.

5 years agox86: Allow -fcf-protection with external thunk
H.J. Lu [Wed, 29 Apr 2020 11:52:46 +0000 (04:52 -0700)] 
x86: Allow -fcf-protection with external thunk

Allow -fcf-protection with external thunk since the external thunk can be
made compatible with -fcf-protection.

gcc/

Backport from master
PR target/93654
* config/i386/i386-options.c (ix86_set_indirect_branch_type):
Allow -fcf-protection with -mindirect-branch=thunk-extern and
-mfunction-return=thunk-extern.
* doc/invoke.texi: Update notes for -fcf-protection=branch with
-mindirect-branch=thunk-extern and -mindirect-return=thunk-extern.

gcc/testsuite/

Backport from master
PR target/93654
* gcc.target/i386/pr93654.c: New test.

(cherry picked from commit 9be3bb2c0a258fd6a7d3d05d232a21930c757d3c)

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

5 years agoc++: Avoid ICE with dependent attribute on type.
Jason Merrill [Mon, 27 Jan 2020 10:45:01 +0000 (05:45 -0500)] 
c++: Avoid ICE with dependent attribute on type.

We previously happened to accept this testcase, but never actually did
anything useful with the attribute.  The patch for PR86379 stopped using
TREE_TYPE as USING_DECL_SCOPE, so 'using A::b' no longer had TREE_TYPE set,
so the language-independent decl_attributes started crashing on it.

GNU attributes are more flexible in their placement than C++11 attributes,
so if we encounter a dependent GNU attribute that syntactically appertains
to a type rather than the declaration as a whole, move it to the
declaration; that's almost certainly what the user meant, anyway.

gcc/cp/ChangeLog
2020-01-27  Jason Merrill  <jason@redhat.com>

PR c++/90750
PR c++/79585
* decl.c (grokdeclarator): Move dependent attribute to decl.
* decl2.c (splice_template_attributes): No longer static.

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

5 years agolibphobos: Fix struct layout of addrinfo on sparc-*-solaris*
Iain Buclaw [Mon, 27 Apr 2020 21:51:50 +0000 (23:51 +0200)] 
libphobos: Fix struct layout of addrinfo on sparc-*-solaris*

Comparing the struct addrinfo declarations in <netdb.h>

    struct addrinfo {
...
    #ifdef __sparcv9
        int _ai_pad;
    #endif /* __sparcv9 */
...
    };

In the extern(C) core.sys bindings, there's a mismatch here; the system
version has no _aid_pad member on 32-bit SPARC.

libphobos/ChangeLog:

PR d/90718
* libdruntime/core/sys/posix/netdb.d (Solaris): Include _ai_pad member
in struct addrinfo only when targeting SPARC64.

5 years agolibphobos: Fix struct layout of stat32_t on sparc-*-solaris*
Iain Buclaw [Mon, 27 Apr 2020 21:40:48 +0000 (23:40 +0200)] 
libphobos: Fix struct layout of stat32_t on sparc-*-solaris*

Solaris 11 <sys/stat.h> has:

    struct stat {
...
    #if _FILE_OFFSET_BITS != 64
long st_pad3;
    #endif
...
    };

In the extern(C) core.sys bindings, st_pad3 is included in the
non-largefie version of struct stat when it shouldn't be.

libphobos/ChangeLog:

PR d/90719
* libdruntime/core/sys/posix/sys/stat.d (Solaris): Remove st_pad3 from
struct stat32_t.

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

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

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

5 years agolibstdc++: Fix type-erasure in experimental::net::executor (PR 94203)
Jonathan Wakely [Fri, 24 Apr 2020 13:29:37 +0000 (14:29 +0100)] 
libstdc++: Fix type-erasure in experimental::net::executor (PR 94203)

The _Tgt and _TgtImpl types that implement type-erasure didn't agree on
the virtual interface, so failed as soon as they were instantiated. With
Clang they failed even sooner. The interface was also dependent on
whether RTTI was enabled or not.

This patch fixes the broken virtual functions and makes the type work
without RTTI, by using a pointer to a specialization of a function
template (similar to the approaches in std::function and std::any).

The changes to the virtual functions would be an ABI change, except that
the previous code didn't even compile if instantiated. This is
experimental TS material anyway.

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

PR libstdc++/94203
* include/experimental/executor (executor::executor(Executor)): Call
make_shared directly instead of _M_create. Create _Tgt1 object.
(executor::executor(allocator_arg_t, const ProtoAlloc&, Executor)):
Call allocate_shared directly instead of _M_create. Create _Tgt2
object.
(executor::target_type): Add cast needed for new _Tgt interface.
(executor::target): Define when RTTI is disabled. Use _Tgt::_M_func.
(executor::_Tgt): Define the same interface whether RTTI is enabled or
not.
(executor::_Tgt::target_type, executor::_Tgt::target): Do not use
std::type_info in the interface.
(executor::_Tgt::_M_func): Add data member.
(executor::_TgtImpl): Replace with _Tgt1 and _Tgt2 class templates.
(executor::_Tgt1::_S_func): Define function to access target without
depending on RTTI.
(executor::_M_create): Remove.
(operator==, operator!=): Simplify comparisons for executor.
* include/experimental/socket (is_error_code_enum<socket_errc>):
Define specialization before use.
* testsuite/experimental/net/executor/1.cc: New test.

5 years agolibstdc++: Make net::service_already_exists default constructible
Jonathan Wakely [Fri, 24 Apr 2020 13:27:23 +0000 (14:27 +0100)] 
libstdc++: Make net::service_already_exists default constructible

The LWG issue I created is Tentatively Ready and proposes to declare a
public default constructor, rather than the private one I added
recently.

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

* include/experimental/executor (service_already_exists): Make default
constructor public (LWG 3414).
* testsuite/experimental/net/execution_context/make_service.cc: Check
the service_already_exists can be default constructed.

5 years agoFix PR 93956, wrong pointer when returned via function.
Thomas König [Fri, 24 Apr 2020 06:22:48 +0000 (08:22 +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.

5 years agoDaily bump.
GCC Administrator [Fri, 24 Apr 2020 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

5 years agolibstdc++: Mark experimental::net::system_context ctor deleted
Thomas Rodgers [Thu, 23 Apr 2020 20:42:46 +0000 (13:42 -0700)] 
libstdc++: Mark experimental::net::system_context ctor deleted

           Backport from mainline.

           * include/experimental/net/executor (system_context): Mark
           system_context::system_context() = delete.
           * testsuite/experimental/net/executor/1.cc: Add new
           test to check system_context is not default constructible.

5 years agolibstdc++: Fix date of changelog entry
Thomas Rodgers [Thu, 23 Apr 2020 20:57:01 +0000 (13:57 -0700)] 
libstdc++: Fix date of changelog entry

5 years agolibstdc++: Fix PSTL tests to run correctly with newer Thread Building Blocks
Thomas Rodgers [Thu, 23 Apr 2020 20:33:09 +0000 (13:33 -0700)] 
libstdc++: Fix PSTL tests to run correctly with newer Thread Building Blocks

* testsuite/lib/libstdc++.exp: Add additional_flags=
-DTBB_SUPRESS_DEPRECATED_MESSAGES=1 to suppress warnings when
compiling with a newer Thread Building Blocks.

5 years agolibstdc++: Define __cpp_lib_execution feature test
Jonathan Wakely [Thu, 23 Apr 2020 17:48:50 +0000 (18:48 +0100)] 
libstdc++: Define __cpp_lib_execution feature test

This macro has never been defined by libstdc++, despite supporting the
parallel algorithms. It should have a different value for C++17 and
C++20, because P1001R2 should not be supported in C++17, but
unsequenced_policy is defined for C++17 (see PR 94702).

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

* include/std/execution (__cpp_lib_execution): Define to indicate
support for P0024R2 and P1001R2.
* include/std/version (__cpp_lib_execution): Define.
* testsuite/25_algorithms/pstl/feature_test.cc: Only test macro
defined by <algorithm>, move other tests to new tests ...
* testsuite/25_algorithms/pstl/feature_test-2.cc: New test.
* testsuite/25_algorithms/pstl/feature_test-3.cc: New test.
* testsuite/25_algorithms/pstl/feature_test-4.cc: New test.
* testsuite/25_algorithms/pstl/feature_test-5.cc: New test.

5 years agolibstdc++: Update __cpp_lib_array_constexpr and __cpp_lib_string_view
Jonathan Wakely [Thu, 23 Apr 2020 17:42:04 +0000 (18:42 +0100)] 
libstdc++: Update __cpp_lib_array_constexpr and __cpp_lib_string_view

The C++20 P0858R0 changes are supported even in C++17 (because array and
string_view iterators are just pointers), so the feature test macros can
be defined to 201803 for C++17.

* include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Update
value to indicate P0858R0 support.
* include/std/string_view (__cpp_lib_string_view): Likewise.
* include/std/version (__cpp_lib_array_constexpr)
(__cpp_lib_string_view): Likewise.
* testsuite/23_containers/array/element_access/constexpr_c++17.cc:
New test.
* testsuite/23_containers/array/requirements/constexpr_iter.cc: Test
in C++17 mode and check feature test macro.

5 years agolibstdc++: Add missing feature test macros
Jonathan Wakely [Thu, 23 Apr 2020 16:39:21 +0000 (17:39 +0100)] 
libstdc++: Add missing feature test macros

These macros all correspond to features that are already supported, but
the macro was not defined when the feature was implemented.

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

* include/bits/ptr_traits.h (__cpp_lib_constexpr_memory): Define to
indicate P1006R1 support.
(__cpp_lib_to_address): Define to indicate P0653R2 support.
* include/std/memory (__cpp_lib_assume_aligned): Define to indicate
P1007R3 support.
* include/std/memory_resource (__cpp_lib_polymorphic_allocator):
Define to indicate P0339R6 support.
* include/std/string_view (__cpp_lib_starts_ends_with): Define to
indicate P0457R2 support.
* include/std/type_traits (__cpp_lib_is_nothrow_convertible): Define
to indicate P0758R1 support.
(__cpp_lib_remove_cvref): Define to indicate P0550R2 support.
(__cpp_lib_type_identity): Define to indicate P0887R1 support.
* include/std/version (__cpp_lib_is_nothrow_convertible)
(__cpp_lib_remove_cvref, __cpp_lib_type_identity)
(__cpp_lib_assume_aligned, __cpp_lib_constexpr_memory)
(__cpp_lib_polymorphic_allocator, __cpp_lib_starts_ends_with)
(__cpp_lib_to_address): Define.
* testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number.

5 years agolibstdc++: Add comments to non-standard feature test macros
Jonathan Wakely [Thu, 23 Apr 2020 16:26:26 +0000 (17:26 +0100)] 
libstdc++: Add comments to non-standard feature test macros

These macros were replaced by __cpp_lib_map_try_emplace and
__cpp_lib_unordered_map_try_emplace, because those names are more
descriptive. The old names have been removed for gcc-10, but for this
branch just add comments noting they are non-standard.

* include/bits/stl_map.h (__cpp_lib_map_insertion): Add comment to
non-standard macro.
* include/bits/unordered_map.h (__cpp_lib_unordered_map_insertion):
Likewise.
* include/std/version (__cpp_lib_map_insertion)
(__cpp_lib_unordered_map_insertion): Likewise.

5 years agolibstdc++: Define missing __cpp_lib_int_pow2 macro
Jonathan Wakely [Thu, 23 Apr 2020 16:20:47 +0000 (17:20 +0100)] 
libstdc++: Define missing __cpp_lib_int_pow2 macro

The P1956R1 renaming isn't implemented on the gcc-9 branch, so this is
the old value corresponding to the original proposal that added these
functions.

* include/std/bit (__cpp_lib_int_pow2): Define to indicate P0556R3
support.
* include/std/version (__cpp_lib_int_pow2): Likewise.

5 years agolibstdc++: Define __cpp_lib_constexpr_complex macro
Jonathan Wakely [Thu, 23 Apr 2020 16:14:09 +0000 (17:14 +0100)] 
libstdc++: Define __cpp_lib_constexpr_complex macro

This is LWG issue 3349.

Backport from mainline
2019-12-10  Jonathan Wakely  <jwakely@redhat.com>

* include/std/complex (__cpp_lib_constexpr_complex): Define.
* include/std/version (__cpp_lib_constexpr_complex): Likewise.
* testsuite/26_numerics/complex/1.cc: New test.
* testsuite/26_numerics/complex/2.cc: New test.

5 years agoFix <version> header for freestanding
Jonathan Wakely [Thu, 23 Apr 2020 16:07:54 +0000 (17:07 +0100)] 
Fix <version> header for freestanding

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

* include/std/version [!_GLIBCXX_HOSTED]: Do not define feature test
macros for features that are only present in hosted builds.

5 years agolibstdc++: Fix some missing/incorrect feature test macros
Jonathan Wakely [Thu, 23 Apr 2020 15:56:01 +0000 (16:56 +0100)] 
libstdc++: Fix some missing/incorrect feature test macros

Backport from mainline
2019-10-30  Jonathan Wakely  <jwakely@redhat.com>

* include/std/bit (__cpp_lib_bitops): Define.
* include/std/version (__cpp_lib_constexpr): Remove.
(__cpp_lib_bitops): Define.
* testsuite/26_numerics/bit/header.cc: New test.
* testsuite/26_numerics/bit/header-2.cc: New test.

5 years agolibstdc++: Add __cpp_lib_unwrap_ref feature test macro
Jonathan Wakely [Wed, 19 Feb 2020 15:06:24 +0000 (15:06 +0000)] 
libstdc++: Add __cpp_lib_unwrap_ref feature test macro

We already defined the traits in <type_traits> as now required by LWG
3348, but the macro was missing. This adds it.

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

* include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348).
* include/std/version (__cpp_lib_unwrap_ref): Likewise.
* testsuite/20_util/unwrap_reference/1.cc: Check macro.
* testsuite/20_util/unwrap_reference/3.cc: New test.

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

5 years agoc++: reject scalar array initialization with nullptr [PR94510]
Martin Sebor [Tue, 21 Apr 2020 15:02:06 +0000 (11:02 -0400)] 
c++: reject scalar array initialization with nullptr [PR94510]

The change committed to GCC 9 to allow string literals as template arguments
caused the compiler to prune away, and thus miss diagnosing, conversion from
nullptr to int in an array initializer.  After looking at various approaches
to improving the pruning, we realized that the only place the pruning is
necessary is in the mangler.

gcc/cp/ChangeLog
2020-04-21  Martin Sebor  <msebor@redhat.com>
    Jason Merrill  <jason@redhat.com>

PR c++/94510
* decl.c (reshape_init_array_1): Avoid stripping redundant trailing
zero initializers...
* mangle.c (write_expression): ...and handle them here even for
pointers to members by calling zero_init_expr_p.
* cp-tree.h (zero_init_expr_p): Declare.
* tree.c (zero_init_expr_p): Define.
(type_initializer_zero_p): Remove.
* pt.c (tparm_obj_values): New hash_map.
(get_template_parm_object): Store to it.
(tparm_object_argument): New.

gcc/testsuite/ChangeLog
2020-04-21  Martin Sebor  <msebor@redhat.com>

PR c++/94510
* g++.dg/init/array58.C: New test.
* g++.dg/init/array59.C: New test.
* g++.dg/cpp2a/nontype-class34.C: New test.
* g++.dg/cpp2a/nontype-class35.C: New test.

5 years agoaarch64: Fix bootstrap with old binutils [PR93053]
Andre Vieira [Wed, 22 Apr 2020 14:16:20 +0000 (15: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-22  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.

5 years agolibstdc++: Improve C++14 status docs
Jonathan Wakely [Wed, 22 Apr 2020 07:09:11 +0000 (08:09 +0100)] 
libstdc++: Improve C++14 status docs

This adds a full table of contents for the C++14 standard, with status
for each part.

The list of C++14 proposals is removed, as it adds little value now that
everything is supported.

* doc/Makefile.am (xml_sources_manual): Add missing XML files.
* doc/Makefile.in: Regenerate.
* doc/xml/manual/status_cxx1998.xml: Refer to "this section" instead
of "this page".
* doc/xml/manual/status_cxx2011.xml: Formatting and other corrections
to the C++11 status table.
* doc/xml/manual/status_cxx2014.xml: Replace list of C++14 feature
proposals with table matching contents of the C++14 standard.
* doc/html/*: Regenerate.

5 years agolibstdc++: Update __cpp_lib_erase_if macro (P1115R3)
Jonathan Wakely [Wed, 22 Apr 2020 06:21:01 +0000 (07:21 +0100)] 
libstdc++: Update __cpp_lib_erase_if macro (P1115R3)

Now that this feature has been approved for C++20 we can define the
macro to the official value.

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

* include/bits/erase_if.h (__cpp_lib_erase_if): Define to 202002L.
* include/std/deque (__cpp_lib_erase_if): Likewise.
* include/std/forward_list (__cpp_lib_erase_if): Likewise.
* include/std/list (__cpp_lib_erase_if): Likewise.
* include/std/string (__cpp_lib_erase_if): Likewise.
* include/std/vector (__cpp_lib_erase_if): Likewise.
* include/std/version (__cpp_lib_erase_if): Likewise.
* testsuite/21_strings/basic_string/erasure.cc: Test for new value.
* testsuite/23_containers/deque/erasure.cc: Likewise.
* testsuite/23_containers/forward_list/erasure.cc: Likewise.
* testsuite/23_containers/list/erasure.cc: Likewise.
* testsuite/23_containers/map/erasure.cc: Likewise.
* testsuite/23_containers/set/erasure.cc: Likewise.
* testsuite/23_containers/unordered_map/erasure.cc: Likewise.
* testsuite/23_containers/unordered_set/erasure.cc: Likewise.
* testsuite/23_containers/vector/erasure.cc: Likewise.

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

5 years agolibstdc++: Document correct feature test macro, __cpp_lib_is_invocable
Jonathan Wakely [Tue, 21 Apr 2020 16:26:52 +0000 (17:26 +0100)] 
libstdc++: Document correct feature test macro, __cpp_lib_is_invocable

The std::is_callable trait was renamed to is_invocable, but I never
updated the manual to reflect the updated feature test macro.

* doc/xml/manual/status_cxx2017.xml: Fix name of feature test macro.
* doc/html/*: Regenerate.

5 years agosra-9: Fix sra_modify_expr handling of partial writes (PR 94482)
Martin Jambor [Tue, 21 Apr 2020 12:20:37 +0000 (14:20 +0200)] 
sra-9: Fix sra_modify_expr handling of partial writes (PR 94482)

This is a fairly straightforward backport of the mainline fix for PR 94482.

When sra_modify_expr is invoked on an expression that modifies only
part of the underlying replacement, such as a BIT_FIELD_REF on a LHS
of an assignment and the SRA replacement's type is not compatible with
what is being replaced (0th operand of the B_F_R in the above
example), it does not work properly, basically throwing away the part
of the expr that should have stayed intact.

This is fixed in two ways.  For BIT_FIELD_REFs, which operate on the
binary image of the replacement (and so in a way serve as a
VIEW_CONVERT_EXPR) we just do not bother with converting.  For
REALPART_EXPRs and IMAGPART_EXPRs, if the replacement is not a
register, we insert a VIEW_CONVERT_EXPR under
the complex partial access expression, which is always OK, for loads
from registers we take the extra step of converting it to a temporary.

This revealed a bug in fwprop which is fixed with the hunk from Richi.
This is the only difference from the mainline patch which has two
hunks, but the code handling BIT_FIELD_REF is not present in gcc-9.

Oh, and the testcase options were changed to what Jakub put there on
the mainline to suppress all vector ABI warnings.

Bootstrapped and tested on x86_64-linux.

2020-04-21  Martin Jambor  <mjambor@suse.cz>

        Backport from master
2020-04-09  Martin Jambor  <mjambor@suse.cz>
                    Richard Biener  <rguenther@suse.de>

PR tree-optimization/94482
* tree-sra.c (create_access_replacement): Dump new replacement with
TDF_UID.
(sra_modify_expr): Fix handling of cases when the original EXPR writes
to only part of the replacement.
* tree-ssa-forwprop.c (pass_forwprop::execute): Properly verify
the first operand of combinations into REAL/IMAGPART_EXPR and
BIT_FIELD_REF.

testsuite/
* gcc.dg/torture/pr94482.c: New test.
* gcc.dg/tree-ssa/pr94482-2.c: Likewise.

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