]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 years agoUpdate merge.sh to reflect usage of git.
Martin Liska [Mon, 25 May 2020 18:55:29 +0000 (20:55 +0200)] 
Update merge.sh to reflect usage of git.

After switching to GIT, we should use it in libsanitizer
merge script. I'll do merge from master as soon as
PR95311 gets fixed.

I'm going to install the patch.

libsanitizer/ChangeLog:

* LOCAL_PATCHES: Use git hash instead of SVN id.
* merge.sh: Use git instead of VCS.  Update paths
relative to upstream git repository.

3 years agogcc-git: Add prepare-commit-msg hook.
Jason Merrill [Fri, 22 May 2020 22:40:35 +0000 (18:40 -0400)] 
gcc-git: Add prepare-commit-msg hook.

This patch introduces a prepare-commit-msg hook that appends a ChangeLog
skeleton to a commit message when the GCC_FORCE_MKLOG environment variable
is set, and a 'git commit-mklog' command set that variable while running
'git commit'.

contrib/ChangeLog:

* prepare-commit-msg: New file.
* gcc-git-customization.sh: Install it.  Add commit-mklog alias.
* mklog.py: Add new option -c which appends
to a ChangeLog file.

3 years agoRevert "Add ChangeLog entry for my last commit."
Martin Liska [Tue, 26 May 2020 06:07:30 +0000 (08:07 +0200)] 
Revert "Add ChangeLog entry for my last commit."

This reverts commit cfdff3eeb902958d3eefe60d5712d64e2367843f.

3 years agoAdd ChangeLog entry for my last commit. misc/first-auto-changelog
liuhongt [Tue, 26 May 2020 03:46:50 +0000 (11:46 +0800)] 
Add ChangeLog entry for my last commit.

3 years agoFix non-comforming expander for floatv2div2sf2,floatunsv2div2sf2,fix_truncv2sfv2di...
liuhongt [Tue, 26 May 2020 03:14:31 +0000 (11:14 +0800)] 
Fix non-comforming expander for floatv2div2sf2,floatunsv2div2sf2,fix_truncv2sfv2di,fixuns_truncv2sfv2di.

2020-05-26  Hongtao Liu  <hongtao.liu@intel.com>
    Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
PR target/95211
PR target/95256
* config/i386/sse.md (<floatunssuffix>v2div2sf2): New expander.
(fix<fixunssuffix>_truncv2sfv2di2): Ditto.
(avx512dq_float<floatunssuffix>v2div2sf2): Renaming from
float<floatunssuffix>v2div2sf2.
(avx512dq_fix<fixunssuffix>_truncv2sfv2di2<mask_name>):
Renaming from fix<fixunssuffix>_truncv2sfv2di2<mask_name>.
(vec_pack<floatprefix>_float_<mode>): Adjust icode name.
(vec_unpack_<fixprefix>fix_trunc_lo_<mode>): Ditto.
(vec_unpack_<fixprefix>fix_trunc_hi_<mode>): Ditto.
* config/i386/i386-builtin.def: Ditto.
* emit-rtl.c (validate_subreg): Allow use of *paradoxical* vector
subregs when both omode and imode are vector mode and
have the same inner mode.

gcc/testsuite/ChangeLog
* gcc.target/i386/pr95211.c: New test.

3 years agoDaily bump.
GCC Administrator [Tue, 26 May 2020 00:16:21 +0000 (00:16 +0000)] 
Daily bump.

3 years agolibgo: update x/sys/cpu after gccgo support added
Clément Chigot [Tue, 19 May 2020 14:03:54 +0000 (16:03 +0200)] 
libgo: update x/sys/cpu after gccgo support added

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

3 years agoFix internal error on store to FP component at -O2
Eric Botcazou [Mon, 25 May 2020 20:13:11 +0000 (22:13 +0200)] 
Fix internal error on store to FP component at -O2

This is about a GIMPLE verification failure at -O2 or above because
the GIMPLE store merging pass generates a NOP_EXPR between a FP type
and an integral type.  This happens when the bit-field insertion path
is taken for a FP field, which can happen in Ada for bit-packed record
types.

It is fixed by generating an intermediate VIEW_CONVERT_EXPR.  The patch
also tames a little the bit-field insertion path because, for bit-packed
record  types in Ada, you can end up with large bit-field regions, which
results in a lot of mask-and-shifts instructions.

gcc/ChangeLog
* gimple-ssa-store-merging.c (merged_store_group::can_be_merged_into):
Only turn MEM_REFs into bit-field stores for small bit-field regions
(imm_store_chain_info::output_merged_store): Be prepared for sources
with non-integral type in the bit-field insertion case.
(pass_store_merging::process_store): Use MAX_BITSIZE_MODE_ANY_INT as
the largest size for the bit-field case.

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

3 years agoi386: Remove broadcasts from TARGET_MMX_WITH_SSE vec_dup insn patterns
Uros Bizjak [Mon, 25 May 2020 14:11:18 +0000 (16:11 +0200)] 
i386: Remove broadcasts from TARGET_MMX_WITH_SSE vec_dup insn patterns

XMM broadcast instructions broadcast value from general reg to all
elements of the vector.  This is not allowed for TARGET_MMX_WITH_SSE,
where it is expected that bits outside lower 64bits load or retain
zero value.  Following testcases expect broadcast, and are thus invalid:

FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-not movd
FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-times pbroadcastd 1
FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-not movd
FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-times pbroadcastw 1
FAIL: gcc.target/i386/sse2-mmx-19d.c scan-assembler-times pbroadcastw 1
FAIL: gcc.target/i386/sse2-mmx-19e.c scan-assembler-times pbroadcastw 1

These testcases are removed entirely.

2020-05-25  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
* config/i386/mmx.md (*vec_dupv2sf): Redefine as define_insn.
(mmx_pshufw_1): Change Yv constraint to xYw.  Correct type attribute.
(*vec_dupv4hi): Redefine as define_insn.
Remove alternative with general register input.
(*vec_dupv2si): Ditto.

gcc/testsuite/ChangeLog:
* gcc.target/i386/sse2-mmx-18a.c (dg-options): Remove -mno-avx512vl.
* gcc.target/i386/sse2-mmx-19a.c (dg-options): Remove -mno-avx.
* gcc.target/i386/sse2-mmx-18b.c: Remove.
* gcc.target/i386/sse2-mmx-18c.c: Ditto.
* gcc.target/i386/sse2-mmx-19b.c: Ditto.
* gcc.target/i386/sse2-mmx-19c.c: Ditto.
* gcc.target/i386/sse2-mmx-19d.c: Ditto.
* gcc.target/i386/sse2-mmx-19e.c: Ditto.

3 years agoBRIG FE testsuite: Fix dump scan patterns in packed.hsail test
Martin Jambor [Mon, 25 May 2020 14:07:48 +0000 (16:07 +0200)] 
BRIG FE testsuite: Fix dump scan patterns in packed.hsail test

Starting with r11-165-eb72dc663e9 which converted DECL_GIMPLE_REG_P to
DECL_NOT_GIMPLE_REG_P we have failing BRIG testcase:

-PASS: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;"
-PASS: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;"
+FAIL: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;"
+FAIL: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;"

because the gimplifier is now smarter and generates nicer code, which
however, does not match the regexp in the testsuite:

--- before/packed.hsail.brig.005t.gimple        2020-05-12 17:59:26.434305513 +0200
+++ after/packed.hsail.brig.005t.gimple 2020-05-12 17:52:34.477055987 +0200
@@ -109,277 +109,267 @@
   q2 = q1 + _24;
   _25 = VEC_PERM_EXPR <q1, q1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }>;
   q3 = q2 + _25;
-  _26 = q2 + q3;
-  new_output.11 = _26;
-  new_output.21_27 = new_output.11;
-  _28 = VEC_PERM_EXPR <new_output.21_27, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;
-  s_output.12 = _28;
+  new_output.11 = q2 + q3;
+  s_output.12 = VEC_PERM_EXPR <new_output.11, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;
   q4 = s_output.12;

I have looked at the SSA dump and verified that the variable in
question is a gimple register because it gets its SSA name.  I have
not looked into why the gimplifier previously though it had to go
through the additional temporaries though.

Tested with make -k check-brig.

* brig.dg/test/gimple/packed.hsail: Fix scan dump patterns.

3 years agotree-optimization/95309 - fix invariant SLP node costing
Richard Biener [Mon, 25 May 2020 11:06:03 +0000 (13:06 +0200)] 
tree-optimization/95309 - fix invariant SLP node costing

This makes sure to compute SLP_TREE_NUMBER_OF_VEC_STMTS during SLP
analysis even for invariant / external nodes so costing properly
knows what to cost.

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

PR tree-optimization/95309
* tree-vect-slp.c (vect_get_constant_vectors): Move number
of vector computation ...
(vect_slp_analyze_node_operations): ... to analysis phase.

3 years ago[Ada] Fix spurious error on checking of null Abstract_State
Yannick Moy [Wed, 11 Dec 2019 16:39:07 +0000 (17:39 +0100)] 
[Ada] Fix spurious error on checking of null Abstract_State

2020-05-25  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_util.adb (Check_No_Hidden_State): Stop propagation at
first block/task/entry.

3 years ago[Ada] Change pragma Compile_Time_Error to force compile-time evaluation
Yannick Moy [Wed, 11 Dec 2019 09:21:57 +0000 (10:21 +0100)] 
[Ada] Change pragma Compile_Time_Error to force compile-time evaluation

2020-05-25  Yannick Moy  <moy@adacore.com>

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst: Document
changes to pragmas Compile_Time_Error/Compile_Time_Warning.
* gnat_rm.texi: Regenerate.
* libgnat/g-bytswa.adb: Change uses of Compile_Time_Error to
Compile_Time_Warning, as the actual expression may not always be
known statically.
* sem_prag.adb (Analyze_Pragma): Handle differently pragma
Compile_Time_Error in both compilation and in GNATprove mode.
(Validate_Compile_Time_Warning_Or_Error): Issue an error or
warning when the expression is not known at compile time.
* usage.adb: Add missing documentation for warning switches _c
and _r.
* warnsw.ads: Update comment.

3 years ago[Ada] Spurious accessibility error on return aggregate in GNATprove mode
Justin Squirek [Wed, 11 Dec 2019 03:49:43 +0000 (22:49 -0500)] 
[Ada] Spurious accessibility error on return aggregate in GNATprove mode

2020-05-25  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_ch6.adb (Check_Return_Obj_Accessibility): Use original
node to avoid looking at expansion done in GNATprove mode.

3 years agoDo not stream redundant stuff
Jan Hubicka [Mon, 25 May 2020 12:41:33 +0000 (14:41 +0200)] 
Do not stream redundant stuff

as discussed on IRC this adds knob to disable stuff we stream "just for fun"
(or to make it easier to debug streamer desychnonization).

Te size of .o files in gcc subdirectory is reduced form 506MB to 492MB

gcc/

* lto-streamer-out.c (lto_output_tree): Add streamer_debugging check.
* lto-streamer.h (streamer_debugging): New constant
* tree-streamer-in.c (streamer_read_tree_bitfields): Add
streamer_debugging check.
(streamer_get_pickled_tree): Likewise.
* tree-streamer-out.c (pack_ts_base_value_fields): Likewise.

3 years agotree-optimization/95308 - really avoid forward propagating of &TMR
Richard Biener [Mon, 25 May 2020 11:48:57 +0000 (13:48 +0200)] 
tree-optimization/95308 - really avoid forward propagating of &TMR

This fixes a hole that still allowed forwarding of TARGET_MEM_REF
addresses.

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

PR tree-optimization/95308
* tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
test for TARGET_MEM_REFs.

* g++.dg/torture/pr95308.C: New testcase.

3 years agotree-optimization/95295 - fix wrong-code with SM
Richard Biener [Mon, 25 May 2020 08:09:44 +0000 (10:09 +0200)] 
tree-optimization/95295 - fix wrong-code with SM

We failed to compare the rematerialized store values when merging
paths after walking PHIs.

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

PR tree-optimization/95295
* tree-ssa-loop-im.c (sm_seq_valid_bb): Compare remat stores
RHSes and drop to full sm_other if they are not equal.

* gcc.dg/torture/pr95295-1.c: New testcase.
* gcc.dg/torture/pr95295-2.c: Likewise.
* gcc.dg/torture/pr95283.c: Likewise.

3 years agotree-optimization/95271 - fix bswap vectorization invariant SLP type
Richard Biener [Mon, 25 May 2020 08:36:39 +0000 (10:36 +0200)] 
tree-optimization/95271 - fix bswap vectorization invariant SLP type

This properly updates invariant SLP nodes vector types for bswap
vectorization.

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

PR tree-optimization/95271
* tree-vect-stmts.c (vectorizable_bswap): Update invariant SLP
children vector type.
(vectorizable_call): Pass down slp ops.

* gcc.dg/vect/bb-slp-pr95271.c: New testcase.

3 years agotree-optimization/95297 - handle scalar shift arg for SLP invariant vectype
Richard Biener [Mon, 25 May 2020 09:14:03 +0000 (11:14 +0200)] 
tree-optimization/95297 - handle scalar shift arg for SLP invariant vectype

This skips invariant vector type setting for a scalar shift argument.

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

PR tree-optimization/95297
* tree-vect-stmts.c (vectorizable_shift): For scalar_shift_arg
skip updating operand 1 vector type.

* g++.dg/vect/pr95297.cc: New testcase.
* g++.dg/vect/pr95290.cc: Likewise.

3 years agotree-optimization/95308 - really avoid forward propagating of &TMR
Richard Biener [Mon, 25 May 2020 07:44:50 +0000 (09:44 +0200)] 
tree-optimization/95308 - really avoid forward propagating of &TMR

This fixes a hole that still allowed forwarding of TARGET_MEM_REF
addresses.

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

PR tree-optimization/95308
* tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
test for TARGET_MEM_REFs.

* g++.dg/torture/pr95308.C: New testcase.

3 years agotree-optimization/95284 - amend previous store commoning fix
Richard Biener [Mon, 25 May 2020 07:17:51 +0000 (09:17 +0200)] 
tree-optimization/95284 - amend previous store commoning fix

Generalize check for clobbers.

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

PR tree-optimization/95284
* tree-ssa-sink.c (sink_common_stores_to_bb): Amend previous
fix.

* g++.dg/torture/pr95284.C: New testcase.

3 years agoFix internal error on problematic renaming
Eric Botcazou [Mon, 25 May 2020 08:42:28 +0000 (10:42 +0200)] 
Fix internal error on problematic renaming

This is an internal renaming generated for a generalized loop iteration
made on a tagged record type with predicate, and gigi cannot use the most
efficient way of implementing renamings because the renamed object is an
expression with a non-empty Actions list.

gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
and use it throughout the function.
<E_Variable>: Rename local variable and adjust accordingly.  In the
case of a renaming, materialize the entity if the renamed object is
an N_Expression_With_Actions node.
<E_Procedure>: Use Alias accessor function consistently.

gcc/testsuite/ChangeLog
* gnat.dg/renaming16.adb: New test.
* gnat.dg/renaming16_pkg.ads: New helper.

3 years agoFix small fallout of earlier change
Eric Botcazou [Mon, 25 May 2020 08:32:21 +0000 (10:32 +0200)] 
Fix small fallout of earlier change

gcc/ada/ChangeLog
* gcc-interface/misc.c (get_array_bit_stride): Get to the debug type,
if any, before calling gnat_get_array_descr_info.

3 years agoFix missing back-annotation for derived types
Eric Botcazou [Mon, 25 May 2020 08:15:12 +0000 (10:15 +0200)] 
Fix missing back-annotation for derived types

Gigi fails to back-annotate the Present_Expr field of variants present
in a type derived from a discriminated untagged record type, which is
for example visible in the output -gnatRj.

gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Tidy up.
(build_variant_list): Add GNAT_VARIANT_PART parameter and annotate
its variants if it is present.  Adjust the recursive call by passing
the variant subpart of variants, if any.
(copy_and_substitute_in_layout): Rename GNU_SUBST_LIST to SUBST_LIST
and adjust throughout.  For a type, pass the variant part in the
call to build_variant_list.

3 years agoFix incorrect handling of Component_Size
Eric Botcazou [Mon, 25 May 2020 08:04:10 +0000 (10:04 +0200)] 
Fix incorrect handling of Component_Size

The compiler can mishandle a Component_Size clause on an array type
specifying a size multiple of the storage unit, when this size is
not a multiple of the alignment of the component type.

gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_component_type): Cap alignment
of the component type according to the component size.

gcc/testsuite/ChangeLog
* gnat.dg/array40.adb: New test.
* gnat.dg/array40_pkg.ads: New helper.

3 years agoAllow only ignored files in ChangeLog entries.
Martin Liska [Mon, 25 May 2020 07:49:09 +0000 (09:49 +0200)] 
Allow only ignored files in ChangeLog entries.

* gcc-changelog/git_commit.py: Add trailing '/'
for libdruntime.  Allow empty changelog for
only ignored files.
* gcc-changelog/test_email.py: New test for go
patch in ignored location.
* gcc-changelog/test_patches.txt: Add test.

3 years agoChange description of fat pointertype with -fgnat-encodings=minimal
Eric Botcazou [Mon, 25 May 2020 07:41:08 +0000 (09:41 +0200)] 
Change description of fat pointertype  with -fgnat-encodings=minimal

This makes a step back in the representation of fat pointer types in
the debug info with -fgnat-encodings=minimal so as to avoid hiding the
data indirection and making it easiser to synthetize the construct.

gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Add a
description of the various types associated with the unconstrained
type.  Declare the fat pointer earlier.  Set the current function
as context on the template type, and the fat pointer type on the
array type.  Always mark the fat pointer type as artificial and set
it as the context for the pointer type to the array.  Also reuse
GNU_ENTITY_NAME.  Finish up the unconstrained type at the very end.
* gcc-interface/misc.c (gnat_get_array_descr_info): Do not handle
fat pointer types and tidy up accordingly.
* gcc-interface/utils.c (build_unc_object_type): Do not set the
context on the template type.

3 years agoAdd missing ChangeLog entries in previous commit
Eric Botcazou [Mon, 25 May 2020 07:31:15 +0000 (09:31 +0200)] 
Add missing ChangeLog entries in previous commit

3 years agoFix wrong assignment to mutable Out parameter of task entry
Eric Botcazou [Mon, 25 May 2020 07:18:03 +0000 (09:18 +0200)] 
Fix wrong assignment to mutable Out parameter of task entry

Under very specific circumstances the compiler can generate a wrong
assignment to a mutable record object which contains an array component,
because it does not correctly handle the update of the discriminant.

gcc/ada/ChangeLog
* gcc-interface/gigi.h (operand_type): New static inline function.
* gcc-interface/trans.c (gnat_to_gnu): Do not suppress conversion
to the resulty type at the end for array types.
* gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not
remove conversions between array types on the LHS.

gcc/testsuite/ChangeLog
* gnat.dg/array39.adb: New test.
* gnat.dg/array39_pkg.ads: New helper.
* gnat.dg/array39_pkg.adb: Likewise.

3 years agoAdd missing expander for vector float_extend and float_truncate.
liuhongt [Sat, 23 May 2020 07:30:58 +0000 (15:30 +0800)] 
Add missing expander for vector float_extend and float_truncate.

2020-05-25  Hongtao Liu  <hongtao.liu@intel.com>

gcc/ChangeLog
PR target/95125
* config/i386/sse.md (sf2dfmode_lower): New mode attribute.
(trunc<mode><sf2dfmode_lower>2) New expander.
(extend<sf2dfmode_lower><mode>2): Ditto.

gcc/testsuite/ChangeLog
* gcc.target/i386/pr95125-avx.c: New test.
* gcc.target/i386/pr95125-avx512f.c: Ditto.

3 years agoDaily bump.
GCC Administrator [Mon, 25 May 2020 00:16:17 +0000 (00:16 +0000)] 
Daily bump.

3 years agoPR fortran/95106 - truncation of long symbol names with EQUIVALENCE
Harald Anlauf [Sun, 24 May 2020 19:35:04 +0000 (21:35 +0200)] 
PR fortran/95106 - truncation of long symbol names with EQUIVALENCE

For long module names, the generated name-mangled symbol was
truncated, leading to bogus warnings about COMMON block
mismatches.  Provide sufficiently large temporaries.

gcc/fortran/

2020-05-24  Harald Anlauf  <anlauf@gmx.de>

PR fortran/95106
* trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries
for name-mangling.

gcc/testsuite/

2020-05-24  Harald Anlauf  <anlauf@gmx.de>

PR fortran/95106
* gfortran.dg/equiv_11.f90: New test.

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

3 years agolibcpp, libdecnumber: configure and substitute AR
David Edelsohn [Sat, 23 May 2020 21:41:45 +0000 (21:41 +0000)] 
libcpp, libdecnumber: configure and substitute AR

AIX supports "FAT" libraries containing 32 bit and 64 bit objects
(similar to Darwin), but commands for manipulating libraries do not
default to accept both 32 bit and 64 bit object files.  While updating
the AIX configuration to support building and running GCC as a 64 bit
application, I have encountered some build libraries that hard code
AR=ar instead of testing the environment.

This patch adds AR_CHECK_TOOL(AR, ar) to configure.ac for the two
libraries and updates Makefile.in to accept the substitution.

2020-05-23  David Edelsohn  <dje.gcc@gmail.com>

libcpp/ChangeLog:
* Makefile.in (AR): Substitute @AR@.
* configure.ac (CHECK_PROG AR): New.
* configure: Regenerate.

libdecnumber/ChangeLog:
* Makefile.in (AR): Substitute @AR@.
* configure.ac (CHECK_PROG AR): New.
* configure: Regenerate.

3 years agolibstdc++: Compile PR93978 testcase with -Wall
Patrick Palka [Sat, 23 May 2020 19:25:40 +0000 (15:25 -0400)] 
libstdc++: Compile PR93978 testcase with -Wall

Now that the frontend issue PR c++/94038 is thoroughly fixed, the
testcase for PR93978 no longer fails to compile with -O -Wall, so add
-Wall to the testcase's compile flags to help ensure we don't regress
here.

libstdc++-v3/ChangeLog:

PR libstdc++/93978
* testsuite/std/ranges/adaptors/93978.cc: Add -Wall to
dg-additional-options.  Avoid unused-but-set-variable warning.

3 years agoc++: Avoid concept evaluation when uid-sensitive [PR94038]
Patrick Palka [Sat, 23 May 2020 18:39:28 +0000 (14:39 -0400)] 
c++: Avoid concept evaluation when uid-sensitive [PR94038]

Concept evaluation may entail DECL_UID generation and/or template
instantiation, so in general we can't perform it during uid-sensitive
constexpr evaluation.

gcc/cp/ChangeLog:

PR c++/94038
* constexpr.c (cxx_eval_constant_expression)
<case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
constexpr evaluation is uid-sensitive.

gcc/testsuite/ChangeLog:

PR c++/94038
* g++.dg/warn/pr94038-3.C: New test.

3 years agolibstdc++: Fix function that can't be constexpr in C++11 (PR 95289)
Jonathan Wakely [Sat, 23 May 2020 17:27:35 +0000 (18:27 +0100)] 
libstdc++: Fix function that can't be constexpr in C++11 (PR 95289)

The body of this function isn't just a return statement, so it can't be
constexpr until C++14.

PR libstdc++/95289
* include/debug/helper_functions.h (__get_distance): Only declare
as a constexpr function for C++14 and up.
* testsuite/25_algorithms/copy/debug/95289.cc: New test.

3 years agoFixes a hang on an invalid ID in a WAIT statement.
Thomas Koenig [Sat, 23 May 2020 17:01:43 +0000 (19:01 +0200)] 
Fixes a hang on an invalid ID in a WAIT statement.

gcc/fortran/ChangeLog:

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

PR libfortran/95191
* libgfortran.h (libgfortran_error_codes): Add
LIBERROR_BAD_WAIT_ID.

libgfortran/ChangeLog:

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

PR libfortran/95191
* io/async.c (async_wait_id): Generate error if ID is higher
than the highest current ID.
* runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID.

libgomp/ChangeLog:

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

PR libfortran/95191
* testsuite/libgomp.fortran/async_io_9.f90: New test.

3 years agolibstdc++: Refactor filesystem::path string conversions
Jonathan Wakely [Sat, 23 May 2020 08:00:32 +0000 (09:00 +0100)] 
libstdc++: Refactor filesystem::path string conversions

This simplifies the logic of converting Source arguments and pairs of
InputIterator arguments into the native string format. For any input
that is a contiguous range of path::value_type (or char8_t for POSIX)
a string view can be created and the conversion can be done directly,
with no intermediate allocation. Previously some cases created a
basic_string unnecessarily, for example construction from a pair of
path::string_type::iterators, or a pair of non-const value_type*
pointers.

* include/bits/fs_path.h (__detail::_S_range_begin)
(__detail::_S_range_end, path::_S_string_from_iter): Replace with
overloaded function template __detail::__effective_range.
(__detail::__effective_range): New overloaded function template to
create a basic_string or basic_string_view for an effective range.
(__detail::__value_type_is_char): Use __detail::__effective_range.
Do not use remove_const on value type.
(__detail::__value_type_is_char_or_char8_t): Likewise.
(path::path(const Source&, format))
(path::path(const Source&, const locale&))
(path::operator/=(const Source&), path::append(const Source&))
(path::concat(const Source&)): Use __detail::__effective_range.
(path::_S_to_string(InputIterator, InputIterator)): New function
template to create a string view if possible, or string otherwise.
(path::_S_convert): Add overloads that convert a string returned
by __detail::__effective_range. Use if-constexpr to inline conversion
logic from all overloads of _Cvt::_S_convert.
(path::_S_convert_loc): Add overload that converts a string. Use
_S_to_string to avoid allocation when possible.
(path::_Cvt): Remove.
(path::operator+=(CharT)): Remove indirection through path::concat.
* include/experimental/bits/fs_path.h (path::_S_convert_loc): Add
overload for non-const pointers, to avoid constructing a std::string.
* src/c++17/fs_path.cc (path::_S_convert_loc): Replace conditional
compilation with call to _S_convert.

3 years agolibstdc++: Remove incorrect static specifiers
Jonathan Wakely [Sat, 23 May 2020 08:00:16 +0000 (09:00 +0100)] 
libstdc++: Remove incorrect static specifiers

These functions were originally static members of the path class, but
the 'static' specifiers were not removed when they were moved to
namespace scope. This causes ODR violations when the functions are
called from functions defined in the header, which is incompatible with
Nathan's modules branch.  Change them to 'inline' instead.

* include/bits/fs_path.h (__detail::_S_range_begin)
(__detail::_S_range_end): Remove unintentional static specifiers.
* include/experimental/bits/fs_path.h (__detail::_S_range_begin)
(__detail::_S_range_end): Likewise.

3 years agolibstdc++: Simplify filesystem::path SFINAE constraints
Jonathan Wakely [Sat, 23 May 2020 06:28:40 +0000 (07:28 +0100)] 
libstdc++: Simplify filesystem::path SFINAE constraints

This replaces the filesystem::__detail::_Path SFINAE helper with two
separate helpers, _Path and _Path2. This avoids having one helper which
tries to check two different sets of requirements.

The _Path helper now uses variable templates instead of a set of
overloaded functions to detect specializations of basic_string or
basic_string_view.

The __not_<is_void<remove_pointer_t<_Tp1>> check is not necessary in
C++20 because iterator_traits<void*> is now empty. For C++17 replace
that check with a __safe_iterator_traits helper with partial
specializations for void pointers.

Finally, the __is_encoded_char check no longer uses remove_const_t,
which means that iterators with a const value_type will no longer be
accepted as arguments for path creation. Such iterators resulted in
undefined behaviour anyway, so it's still conforming to reject them in
the constraint checks.

* include/bits/fs_path.h (filesystem::__detail::__is_encoded_char):
Replace alias template with variable template. Don't remove const.
(filesystem::__detail::__is_path_src): Replace overloaded function
template with variable template and specializations.
(filesystem::__detail::__is_path_iter_src): Replace alias template
with class template.
(filesystem::__detail::_Path): Use __is_path_src. Remove support for
iterator pairs.
(filesystem::__detail::_Path2): New alias template for checking
InputIterator requirements.
(filesystem::__detail::__constructible_from): Remove.
(filesystem::path): Replace _Path<Iter, Iter> with _Path2<Iter>.
* testsuite/27_io/filesystem/path/construct/80762.cc: Check with two
constructor arguments of void and void* types.

3 years agoDarwin: Make sanitizer local vars linker-visible.
Iain Sandoe [Sat, 23 May 2020 07:25:10 +0000 (08:25 +0100)] 
Darwin: Make sanitizer local vars linker-visible.

Another case where we need a linker-visible symbols in order to
preserve the ld64 atom model.  If these symbols are emitted as
'local' the linker cannot see that they are separate from any
global weak entry that precedes them.  This will cause the linker
to complain that there is (apparently) direct access to such a
weak global, preventing it from being replaced.

This is a short-term fix for the problem - we need generic
handling for relevant cases (that also does not pessimise objects
by emitting unnecessary symbols and relocations).

gcc/ChangeLog:

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

* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL):
Make ubsan_{data,type},ASAN symbols linker-visible.

3 years agoAdjust typo in testcase of my last commit
liuhongt [Sat, 23 May 2020 03:45:28 +0000 (11:45 +0800)] 
Adjust typo in testcase of my last commit

gcc/testsuite/ChangeLog
* gcc.target/i386/pr92658-avx512vl.c: Fix typo.

3 years agoc++: Fix C++17 eval order for virtual op=.
Jason Merrill [Fri, 22 May 2020 21:06:57 +0000 (17:06 -0400)] 
c++: Fix C++17 eval order for virtual op=.

In a function call expression in C++17 evaluation of the function pointer is
sequenced before evaluation of the function arguments, but that doesn't
apply to function calls that were written using operator syntax.  In
particular, for operators with right-to-left ordering like assignment, we
must not evaluate the LHS to find a virtual function before we evaluate the
RHS.

gcc/cp/ChangeLog:

* cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
the function address if the call used operator syntax.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/eval-order9.C: New test.

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

3 years agoSuggest including <stdint.h> or <cstdint> for [u]int[8|16|32|64]_t
Mark Wielaard [Tue, 19 May 2020 22:55:00 +0000 (00:55 +0200)] 
Suggest including <stdint.h> or <cstdint> for [u]int[8|16|32|64]_t

Plus [u]intptr_t and associated constants.

Refactor the bool, true, false, <stdbool.h> code so it fits into the
new table based design.

gcc/c-family/ChangeLog:

* known-headers.cc (get_stdlib_header_for_name): Add a new
stdlib_hint array for stdbool and stdint.

gcc/testsuite/ChangeLog:

* gcc.dg/spellcheck-stdint.c: New test.
* g++.dg/spellcheck-stdint.C: Likewise.

3 years agoSuggest including <stdbool.h> for bool, true and false
Mark Wielaard [Tue, 19 May 2020 21:18:09 +0000 (23:18 +0200)] 
Suggest including <stdbool.h> for bool, true and false

Currently gcc suggests to use _Bool instead of bool and doesn't give
any suggestions when true or false are used, but undefined. This patch
makes it so that (for C99 or higher) a fixit hint is emitted to include
<stdbool.h>.

gcc/c-family/ChangeLog:

* known-headers.cc (get_stdlib_header_for_name): Return
"<stdbool.h>" for "bool", "true" or "false" when STDLIB_C and
flag_isoc99.

gcc/testsuite/ChangeLog:

* gcc.dg/spellcheck-stdbool.c: New test.

3 years agoc++: -fsanitize=vptr and -fstrong-eval-order. [PR95221]
Jason Merrill [Thu, 21 May 2020 04:22:10 +0000 (00:22 -0400)] 
c++: -fsanitize=vptr and -fstrong-eval-order. [PR95221]

With -fstrong-eval-order=all we evaluate the function address before the
arguments.  But this caused trouble with virtual functions and
-fsanitize=vptr; we would do vptr sanitization as part of calculating the
'this' argument, and separately look at the vptr in order to find the
function address.  Without -fstrong-eval-order=all 'this' is evaluated
first, but with that flag the function address is evaluated first, so we
would access the null vptr before sanitizing it.

Fixed by instrumenting the OBJ_TYPE_REF of a virtual function call instead
of the 'this' argument.

This issue suggests that we should be running the ubsan tests in multiple
standard modes like the rest of the G++ testsuite, so I've made that change
as well.

gcc/cp/ChangeLog:

* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
call, instrument the OBJ_TYPE_REF.

gcc/testsuite/ChangeLog:

* g++.dg/ubsan/ubsan.exp: Use g++-dg-runtest.
* c-c++-common/ubsan/bounds-13.c: Adjust.
* c-c++-common/ubsan/bounds-2.c: Adjust.
* c-c++-common/ubsan/div-by-zero-1.c: Adjust.
* c-c++-common/ubsan/div-by-zero-6.c: Adjust.
* c-c++-common/ubsan/div-by-zero-7.c: Adjust.
* c-c++-common/ubsan/overflow-add-1.c: Adjust.
* c-c++-common/ubsan/overflow-add-2.c: Adjust.
* c-c++-common/ubsan/overflow-int128.c: Adjust.
* c-c++-common/ubsan/overflow-sub-1.c: Adjust.
* c-c++-common/ubsan/overflow-sub-2.c: Adjust.
* g++.dg/ubsan/pr85029.C: Adjust.
* g++.dg/ubsan/vptr-14.C: Adjust.

3 years agoanalyzer: Add exit, and _exit replacement, to sm-signal.
Mark Wielaard [Sun, 17 May 2020 21:50:41 +0000 (23:50 +0200)] 
analyzer: Add exit, and _exit replacement, to sm-signal.

Warn about using exit in signal handler and suggest _exit as alternative.

gcc/analyzer/ChangeLog:

* sm-signal.cc(signal_unsafe_call::emit): Possibly add
gcc_rich_location note for replacement.
(signal_unsafe_call::get_replacement_fn): New private function.
(get_async_signal_unsafe_fns): Add "exit".

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/signal-exit.c: New testcase.

3 years agoSilence warning introduced by my previous change.
Jan Hubicka [Fri, 22 May 2020 16:17:14 +0000 (18:17 +0200)] 
Silence warning introduced by my previous change.

* lto-streamer-out.c (DFS::DFS): Silence warning.

3 years agoi386: Fix <rounding_insn><mode>2 expander [PR95255]
Uros Bizjak [Fri, 22 May 2020 16:02:49 +0000 (18:02 +0200)] 
i386: Fix <rounding_insn><mode>2 expander [PR95255]

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

gcc/ChangeLog:
PR target/95255
* config/i386/i386.md (<rounding_insn><mode>2): Do not try to
expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.

gcc/testsuite/ChangeLog:
PR target/95255
* gcc.target/i386/pr95255.c: New test.

3 years agoAvoid streaming stray references.
Jan Hubicka [Fri, 22 May 2020 14:37:06 +0000 (16:37 +0200)] 
Avoid streaming stray references.

this patch avoids stremaing completely useless stray references to gobal decl
stream.  I am re-testing the patch (rebased to current tree) on x86_64-linux
and intend to commit once testing finishes.

gcc/ChangeLog:

2020-05-22  Jan Hubicka  <hubicka@ucw.cz>

* lto-streamer-out.c (lto_output_tree): Do not stream final ref if
it is not needed.

gcc/lto/ChangeLog:

2020-05-22  Jan Hubicka  <hubicka@ucw.cz>

* lto-common.c (lto_read_decls): Do not skip stray refs.

3 years agoAdd debug dump for integer_cst streaming.
Jan Hubicka [Fri, 22 May 2020 14:31:21 +0000 (16:31 +0200)] 
Add debug dump for integer_cst streaming.

* tree-streamer-out.c (streamer_write_integer_cst): Add debug dump.

3 years agoImprove LTO streaming dumps
Jan Hubicka [Fri, 22 May 2020 13:44:10 +0000 (15:44 +0200)] 
Improve LTO streaming dumps

this patch cleans up dumping of streaming so it is clear how dump is organized
and how much space individual components needs.

Compiling:

int a=1;
main()
{
  return a;
}

The output is now:

Creating output block for function_body
    Streaming tree  <result_decl 0x7ffff7457a50 D.1931>
     Start of LTO_trees of size 1
      Encoding indexable  <integer_type 0x7ffff7463000 sizetype>  as 0
     10 bytes

^^^ I do not think we should need 10 bytes to stream single indexable reference
to 0 :)

     Start of LTO_trees of size 1
      Encoding indexable  <integer_type 0x7ffff74630a8 bitsizetype>  as 1
     10 bytes
      Streaming header of  <result_decl 0x7ffff7457a50 D.1931>  to function_body
      Streaming body of  <result_decl 0x7ffff7457a50 D.1931>  to function_body
      Encoding indexable  <integer_type 0x7ffff74635e8 int>  as 2
      Encoding indexable  <function_decl 0x7ffff757b500 main>  as 0
      Streaming ref to  <integer_cst 0x7ffff744af18 32>
      Streaming ref to  <integer_cst 0x7ffff744af30 4>
    52 bytes

^^^ Instead of having multiple LTO_trees sections followed by the final tree
it would make a lot of sense to have only one LTO_trees where the first tree
is one lto_input_tree should return.  This is easy to arrange in DFS walk -
one does not need to pop after every SCC component but pop once at the end of
walk.  However this breaks handling of integer_csts because they may now
become of LTO_trees block and streamed as header + body.
This bypasses the separate code for shared integer_cst streaming.  I think
I want to stream everything into header and materialize the tree since it is not
part of SCC anyway.

    Streaming tree  <block 0x7ffff757e420>
      Streaming header of  <block 0x7ffff757e420>  to function_body
      Streaming body of  <block 0x7ffff757e420>  to function_body
    8 bytes
  Streaming gimple stmt _2 = a;
    Streaming ref to  <block 0x7ffff757e420>
    4 bytes
    Streaming tree  <mem_ref 0x7ffff7576f78>
     Start of LTO_trees of size 1
      Encoding indexable  <pointer_type 0x7ffff746b9d8>  as 3
     10 bytes
     Start of LTO_trees of size 1
      Streaming header of  <addr_expr 0x7ffff75893c0>  to function_body
      Streaming body of  <addr_expr 0x7ffff75893c0>  to function_body
      Encoding indexable  <var_decl 0x7ffff7fcfb40 a>  as 0
     15 bytes
      Streaming header of  <mem_ref 0x7ffff7576f78>  to function_body
      Streaming body of  <mem_ref 0x7ffff7576f78>  to function_body
      Streaming ref to  <addr_expr 0x7ffff75893c0>
      Streaming ref to  <integer_cst 0x7ffff75a3240 0>
    42 bytes
  Streaming gimple stmt return _2;

Outputting global stream
 0:  <function_decl 0x7ffff757b500 main>
    Streaming tree  <function_decl 0x7ffff757b500 main>
     Start of LTO_tree_scc of size 1
      Streaming header of  <optimization_node 0x7ffff744b000>  to decls
      Streaming body of  <optimization_node 0x7ffff744b000>  to decls
     576 bytes
     Start of LTO_tree_scc of size 1
      Streaming header of  <target_option_node 0x7ffff744a018>  to decls
      Streaming body of  <target_option_node 0x7ffff744a018>  to decls
     68 bytes
     Streaming single tree
      Streaming header of  <identifier_node 0x7ffff7577aa0 main>  to decls
      Streaming body of  <identifier_node 0x7ffff7577aa0 main>  to decls
     3 bytes
     Streaming single tree
      Streaming header of  <identifier_node 0x7ffff758a8c0 t.c>  to decls
      Streaming body of  <identifier_node 0x7ffff758a8c0 t.c>  to decls
     3 bytes
     Streaming single tree
      Streaming header of  <translation_unit_decl 0x7ffff7457ac8 t.c>  to decls
      Streaming body of  <translation_unit_decl 0x7ffff7457ac8 t.c>  to decls
      Streaming ref to  <identifier_node 0x7ffff758a8c0 t.c>
     22 bytes
     Start of LTO_tree_scc of size 1
      Streaming header of  <function_type 0x7ffff74717e0>  to decls
      Streaming body of  <function_type 0x7ffff74717e0>  to decls
      Streaming ref to  <integer_type 0x7ffff74635e8 int>
      Streaming ref to  <integer_cst 0x7ffff744adc8 8>
      Streaming ref to  <integer_cst 0x7ffff744ade0 1>
      Streaming ref to  <function_type 0x7ffff74717e0>
     38 bytes
     Start of LTO_tree_scc of size 1
      Streaming header of  <function_type 0x7ffff75832a0>  to decls
      Streaming body of  <function_type 0x7ffff75832a0>  to decls
      Streaming ref to  <integer_type 0x7ffff74635e8 int>
      Streaming ref to  <integer_cst 0x7ffff744adc8 8>
      Streaming ref to  <integer_cst 0x7ffff744ade0 1>
      Streaming ref to  <function_type 0x7ffff74717e0>
     38 bytes
     Start of LTO_tree_scc of size 1
      Streaming header of  <function_decl 0x7ffff757b500 main>  to decls
      Streaming body of  <function_decl 0x7ffff757b500 main>  to decls
      Streaming ref to  <function_type 0x7ffff75832a0>
      Streaming ref to  <identifier_node 0x7ffff7577aa0 main>
      Streaming ref to  <translation_unit_decl 0x7ffff7457ac8 t.c>
      Streaming ref to  <identifier_node 0x7ffff7577aa0 main>
      Streaming ref to  <target_option_node 0x7ffff744a018>
      Streaming ref to  <optimization_node 0x7ffff744b000>
     58 bytes
    806 bytes
 0:  <var_decl 0x7ffff7fcfb40 a>
    Streaming tree  <var_decl 0x7ffff7fcfb40 a>
     Streaming single tree
      Streaming header of  <identifier_node 0x7ffff758a870 a>  to decls
      Streaming body of  <identifier_node 0x7ffff758a870 a>  to decls
     3 bytes
     Streaming single tree
      Streaming ref to  <integer_type 0x7ffff7463000 sizetype>
     7 bytes
     Streaming single tree
      Streaming ref to  <integer_type 0x7ffff74630a8 bitsizetype>
     7 bytes
     Start of LTO_tree_scc of size 1
      Streaming header of  <var_decl 0x7ffff7fcfb40 a>  to decls
      Streaming body of  <var_decl 0x7ffff7fcfb40 a>  to decls
      Streaming ref to  <integer_type 0x7ffff74635e8 int>
      Streaming ref to  <identifier_node 0x7ffff758a870 a>
      Streaming ref to  <translation_unit_decl 0x7ffff7457ac8 t.c>
      Streaming ref to  <integer_cst 0x7ffff744af18 32>
      Streaming ref to  <integer_cst 0x7ffff744af30 4>
      Streaming ref to  <identifier_node 0x7ffff758a870 a>
      Streaming ref to  <integer_cst 0x7ffff7468090 1>
     49 bytes
    66 bytes

gcc/ChangeLog:

2020-05-22  Jan Hubicka  <hubicka@ucw.cz>

* lto-section-out.c (lto_output_decl_index): Adjust dump indentation.
* lto-streamer-out.c (create_output_block): Fix whitespace
(lto_write_tree_1): Add (debug) dump.
(DFS::DFS): Add dump.
(DFS::DFS_write_tree_body): Do not dump here.
(lto_output_tree): Improve dumping; do not stream ref when not needed.
(produce_asm_for_decls): Fix whitespace.
* tree-streamer-out.c (streamer_write_tree_header): Add dump.

3 years agoAdd missing vector truncmn2 expanders [PR92658]
liuhongt [Wed, 20 May 2020 07:53:14 +0000 (15:53 +0800)] 
Add missing vector truncmn2 expanders [PR92658]

2020-05-22  Hongtao.liu  <hongtao.liu@intel.com>

gcc/ChangeLog:
PR target/92658
* config/i386/sse.md (trunc<pmov_src_lower><mode>2): New expander
(truncv32hiv32qi2): Ditto.
(trunc<ssedoublemodelower><mode>2): Ditto.
(trunc<mode><pmov_dst_3>2): Ditto.
(trunc<mode><pmov_dst_mode_4>2): Ditto.
(truncv2div2si2): Ditto.
(truncv8div8qi2): Ditto.
(avx512f_<code>v8div16qi2): Renaming from *avx512f_<code>v8div16qi2.
(avx512vl_<code>v2div2si): Renaming from *avx512vl_<code>v2div2si2.
(avx512vl_<code><mode>v2<ssecakarnum>qi2): Renaming
from *avx512vl_<code><mode>v<ssescalarnum>qi2.

gcc/testsuite/ChangeLog:
* gcc.target/i386/pr92658-avx512f.c: New test.
* gcc.target/i386/pr92658-avx512vl.c: Ditto.
* gcc.target/i386/pr92658-avx512bw-trunc.c: Ditto.

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

3 years agoFix up go related ignored locations.
Jakub Jelinek [Fri, 22 May 2020 11:09:34 +0000 (13:09 +0200)] 
Fix up go related ignored locations.

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

* gcc-changelog/git_commit.py: Add trailing / to
gcc/testsuite/go.test/test and replace gcc/go/frontend/
with gcc/go/gofrontend/ in ignored locations.

3 years agotree-optimization/95268 - fix commoning of clobbers
Richard Biener [Fri, 22 May 2020 07:03:40 +0000 (09:03 +0200)] 
tree-optimization/95268 - fix commoning of clobbers

This fixes handling of clobbers when commoning stores.

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

PR tree-optimization/95268
* tree-ssa-sink.c (sink_common_stores_to_bb): Handle clobbers
properly.

* g++.dg/torture/pr95268.C: New testcase.

3 years agoFix hashing of prestreamed nodes
Jan Hubicka [Fri, 22 May 2020 10:31:34 +0000 (12:31 +0200)] 
Fix hashing of prestreamed nodes

this patch seems to solve basically all collisions while building cc1.
From:

[WPA] read 3312246 unshared trees
[WPA] read 1144381 mergeable SCCs of average size 4.833785
[WPA] 8843938 tree bodies read in total
[WPA] tree SCC table: size 524287, 197767 elements, collision ratio: 0.506446
[WPA] tree SCC max chain length 43 (size 1)
[WPA] Compared 946614 SCCs, 775077 collisions (0.818789)

to

[WPA] read 3314520 unshared trees
[WPA] read 1144763 mergeable SCCs of average size 4.835021
[WPA] 8849473 tree bodies read in total
[WPA] tree SCC table: size 524287, 200574 elements, collision ratio: 0.486418
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 944189 SCCs, 179 collisions (0.000190)

The problem is that preloaded nodes all have hash code 0 because
cache->nodes.length is not updated while streaming out.

I also added an arbitrary constant to avoid clash with constant of 0 used to
hash NULL pointers and 1 used to hash pointers inside SCC.

* tree-streamer.c (record_common_node): Fix hash value of pre-streamed
nodes.

3 years agoSimplify streaming of SCC components
Jan Hubicka [Fri, 22 May 2020 10:29:19 +0000 (12:29 +0200)] 
Simplify streaming of SCC components

this patch saves few bytes from SCC streaming.  First we stream end markers
that are fully ignored at stream in.
Second I missed streaming of emtry_len in the previous change so it is
pointlessly streamed for LTO_trees. Moreover entry_len is almost always 1
(always during gcc bootstrap) and thus it makes sense to avoid stremaing it
in majority of cases.

gcc/ChangeLog:

2020-05-21  Jan Hubicka  <hubicka@ucw.cz>

* lto-streamer-in.c (lto_read_tree): Do not stream end markers.
(lto_input_scc): Optimize streaming of entry lengths.
* lto-streamer-out.c (lto_write_tree): Do not stream end markers
(DFS::DFS): Optimize stremaing of entry lengths

3 years agolto/95190 - amend -flto docs for diagnostic option handling
Richard Biener [Tue, 19 May 2020 06:36:13 +0000 (08:36 +0200)] 
lto/95190 - amend -flto docs for diagnostic option handling

This documents new GCC 10 behavior on diagnostic options and -flto.

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

PR lto/95190
* doc/invoke.texi (flto): Document behavior of diagnostic
options.

3 years agoenfoce SLP_TREE_VECTYPE for invariants
Richard Biener [Mon, 18 May 2020 14:05:56 +0000 (16:05 +0200)] 
enfoce SLP_TREE_VECTYPE for invariants

This tries to enforce a set SLP_TREE_VECTYPE in vect_get_constant_vectors
and provides some infrastructure for setting it in the vectorizable_*
functions, amending those.

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

* tree-vectorizer.h (vect_is_simple_use): New overload.
(vect_maybe_update_slp_op_vectype): New.
* tree-vect-stmts.c (vect_is_simple_use): New overload
accessing operands of SLP vs. non-SLP operation transparently.
(vect_maybe_update_slp_op_vectype): New function updating
the possibly shared SLP operands vector type.
(vectorizable_operation): Be a bit more SLP vs non-SLP agnostic
using the new vect_is_simple_use overload;  update SLP invariant
operand nodes vector type.
(vectorizable_comparison): Likewise.
(vectorizable_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_store): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_assignment): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Likewise.
* tree-vect-slp.c (vect_get_constant_vectors): Enforce
present SLP_TREE_VECTYPE and check it matches previous
behavior.

3 years agotree-optimization/95248 - fix oversight in SM rewrite
Richard Biener [Fri, 22 May 2020 06:48:04 +0000 (08:48 +0200)] 
tree-optimization/95248 - fix oversight in SM rewrite

This fixes a leftover early out in determining the sequence of stores
to materialize.

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

PR tree-optimization/95248
* tree-ssa-loop-im.c (sm_seq_valid_bb): Remove bogus early out.

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

3 years agoAdd missing ChangeLog entry.
Martin Liska [Fri, 22 May 2020 07:01:16 +0000 (09:01 +0200)] 
Add missing ChangeLog entry.

3 years agoadd ctor/dtor to slp_tree
Richard Biener [Wed, 20 May 2020 13:14:47 +0000 (15:14 +0200)] 
add ctor/dtor to slp_tree

This adds constructor and destructor to slp_tree factoring common
code.  I've not changed the wrappers to overloaded CTORs since
I hope to use object_allocator<> and am not sure whether that can
be done in any fancy way yet.

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

* tree-vectorizer.h (_slp_tree::_slp_tree): New.
(_slp_tree::~_slp_tree): Likewise.
* tree-vect-slp.c (_slp_tree::_slp_tree): Factor out code
from allocators.
(_slp_tree::~_slp_tree): Implement.
(vect_free_slp_tree): Simplify.
(vect_create_new_slp_node): Likewise.  Add nops parameter.
(vect_build_slp_tree_2): Adjust.
(vect_analyze_slp_instance): Likewise.

3 years agoAdd gcc/testsuite/go.test/test to ignored locations for gcc_commit.py.
Martin Liska [Fri, 22 May 2020 06:03:03 +0000 (08:03 +0200)] 
Add gcc/testsuite/go.test/test to ignored locations for gcc_commit.py.

contrib/ChangeLog:

2020-05-22  Martin Liska  <mliska@suse.cz>

* gcc-changelog/git_commit.py: Add gcc/testsuite/go.test/test
to ignored locations.

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

3 years agoc++: Check constant array bounds later.
Jason Merrill [Thu, 21 May 2020 14:27:11 +0000 (10:27 -0400)] 
c++: Check constant array bounds later.

We give a better diagnostic for non-constant array bounds in
compute_array_index_type_loc, we don't need to diagnose it in the parser.
But to avoid a regression on parse/varmod1.C we need to actually check
non-dependent expressions in a template.

gcc/cp/ChangeLog:

* decl.c (compute_array_index_type_loc): Diagnose expressions
in a template that can't be constant.
* parser.c (cp_parser_direct_declarator): Don't check
non-constant array bounds here.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/depend-iterator-2.c: Adjust.
* g++.dg/ext/vla1.C: Adjust.
* g++.dg/template/array9.C: Adjust.
* g++.dg/template/error41.C: Adjust.

3 years agoc++: Constant expression parsing and parameters.
Jason Merrill [Thu, 21 May 2020 14:27:11 +0000 (10:27 -0400)] 
c++: Constant expression parsing and parameters.

The difference between a "potential" constant-expression and a regular
constant-expression is the treatment of parameters; in a constexpr function,
a parameter is potentially constant when evaluating a call to that function,
but it is not constant during parsing of the function.
cp_parser_constant_expression should check the latter rather than the
former.

gcc/cp/ChangeLog:

* cp-tree.h (is_rvalue_constant_expression): Declare.
* constexpr.c (is_rvalue_constant_expression): New.
* parser.c (cp_parser_constant_expression): Use it.
* decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
template as constant.

3 years agoc++: Improve error recovery for =.
Jason Merrill [Thu, 21 May 2020 14:27:11 +0000 (10:27 -0400)] 
c++: Improve error recovery for =.

In a template we were happily embedding error_mark_node in a MODOP_EXPR,
leading to confusion later.

gcc/cp/ChangeLog:

* typeck.c (build_x_modify_expr): Handle error_mark_node arguments.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/lambda/lambda-ice30.C: Adjust.
* g++.dg/cpp0x/lambda/lambda-ice31.C: Adjust.
* g++.dg/ext/fixed1.C: Adjust.
* g++.dg/template/crash107.C: Adjust.
* g++.dg/template/error35.C: Adjust.
* g++.dg/template/sizeof-template-argument.C: Adjust.

3 years agoc++: Improve error-recovery for parms.
Jason Merrill [Thu, 21 May 2020 14:27:11 +0000 (10:27 -0400)] 
c++: Improve error-recovery for parms.

If a parameter is erroneous, we currently drop it, leading to "too many
arguments" errors later.  Treating the function as (...) avoids those
errors.

gcc/cp/ChangeLog:

* decl.c (grokparms): Return NULL_TREE if any parms were erroneous.

gcc/testsuite/ChangeLog:

* g++.dg/parse/error33.C: Adjust.

3 years agocoroutines: Partial reversion of r11-437-g5ef067eb14d4.
Iain Sandoe [Thu, 21 May 2020 14:06:53 +0000 (15:06 +0100)] 
coroutines: Partial reversion of r11-437-g5ef067eb14d4.

co_returns are statements, not expressions; they do not need
to be wrapped in an EXPR_STMT.

gcc/cp/ChangeLog:

* coroutines.cc (finish_co_return_stmt): Revert change to use
finish_expr_stmt.

3 years agoInclude memmodel.h in adjust-alignment.c
Rainer Orth [Thu, 21 May 2020 15:02:18 +0000 (17:02 +0200)] 
Include memmodel.h in adjust-alignment.c

Commit dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af broke SPARC bootstrap:

In file included from ./tm_p.h:4,
                 from /vol/gcc/src/hg/master/local/gcc/adjust-alignment.c:28:
/vol/gcc/src/hg/master/local/gcc/config/sparc/sparc-protos.h:45:47: error: use of enum 'memmodel' without previous declaration
 extern void sparc_emit_membar_for_model (enum memmodel, int, int);
                                               ^~~~~~~~

Fixed by including memmodel.h.  Bootstrapped on sparc-sun-solaris2.11
and i386-pc-solaris2.11.

2020-05-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/
* adjust-alignment.c: Include memmodel.h.

3 years agoconfig/i386/cpuid.h: Use hexadecimal in comments
H.J. Lu [Thu, 21 May 2020 14:19:27 +0000 (07:19 -0700)] 
config/i386/cpuid.h: Use hexadecimal in comments

Since Intel SDM uses hexadecimal, use hexadecimal in comments.

PR target/95260
* config/i386/cpuid.h: Use hexadecimal in comments.

3 years agolibstdc++: Enable simple invocation of runtest in testsuite
Matthias Kretz [Thu, 21 May 2020 12:22:48 +0000 (13:22 +0100)] 
libstdc++: Enable simple invocation of runtest in testsuite

2020-05-21  Matthias Kretz  <kretz@kde.org>

* testsuite/Makefile.am: Remove dup target_triplet and set tool,
allowing runtest to work without arguments.
* testsuite/Makefile.in: Regenerate.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
3 years agoc++: template instantiation during fold_for_warn [PR94038]
Patrick Palka [Thu, 21 May 2020 13:03:43 +0000 (09:03 -0400)] 
c++: template instantiation during fold_for_warn [PR94038]

Unfortunately, the previous fix to PR94038 is fragile.  When the
argument to fold_for_warn is a bare CALL_EXPR, then all is well: the
result of maybe_constant_value from fold_for_warn (with
uid_sensitive=true) is reused via the cv_cache in the subsequent call to
maybe_constant_value from cp_fold (with uid_sensitive=false), so we
avoid instantiating bar<int>.

But when the argument to fold_for_warn is more complex, e.g. an
INDIRECT_REF of a CALL_EXPR, as in the testcase below (due to bar<int>()
returning const int& which we need to decay to int) then from
fold_for_warn we call maybe_constant_value on the INDIRECT_REF, and from
cp_fold we call it on the CALL_EXPR, so there is no reuse via the
cv_cache and we therefore end up instantiating bar<int>.

So for a more robust solution to this general issue of warning flags
affecting code generation, it seems that we need a way to globally avoid
template instantiation during constexpr evaluation whenever we're
performing warning-dependent folding.

To that end, this patch replaces the flag constexpr_ctx::uid_sensitive
with a global flag uid_sensitive_constexpr_evaluation_p, and enables it
during fold_for_warn using an RAII helper.

The patch also adds a counter that keeps track of the number of times
uid_sensitive_constexpr_evaluation_p is called and returned true, and we
use this to determine whether the result of constexpr evaluation
was restricted by the flag.  This lets us safely update the cv_cache and
fold_cache from fold_for_warn in the most common case where the flag
did not restrict constexpr evaluation.

gcc/cp/ChangeLog:

PR c++/94038
* constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
(uid_sensitive_constexpr_evaluation_value): Define.
(uid_sensitive_constexpr_evaluation_true_counter): Define.
(uid_sensitive_constexpr_evaluation_p): Define.
(uid_sensitive_constexpr_evaluation_sentinel): Define its
constructor.
(uid_sensitive_constexpr_evaluation_checker): Define its
constructor and its evaluation_restricted_p method.
(get_fundef_copy): Remove 'ctx' parameter.  Use u_s_c_e_p
instead of constexpr_ctx::uid_sensitive.
(cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
last.  Adjust call to get_fundef_copy.
(instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
counter if necessary.
(cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
parameter.  Adjust function body accordingly.
(maybe_constant_value): Remove 'uid_sensitive' parameter and
adjust function body accordingly.  Set up a
uid_sensitive_constexpr_evaluation_checker, and use it to
conditionally update the cv_cache.
* cp-gimplify.c (cp_fold): Set up a
uid_sensitive_constexpr_evaluation_checker, and use it to
conditionally update the fold_cache.
* cp-tree.h (maybe_constant_value): Update declaration.
(struct uid_sensitive_constexpr_evaluation_sentinel): Define.
(struct sensitive_constexpr_evaluation_checker): Define.
* expr.c (fold_for_warn): Set up a
uid_sensitive_constexpr_evaluation_sentinel before calling
the folding subroutines.  Drop all but the first argument to
maybe_constant_value.

gcc/testsuite/ChangeLog:

PR c++/94038
* g++.dg/warn/pr94038-2.C: New test.

3 years agolibgcc: Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16
H.J. Lu [Thu, 21 May 2020 12:32:53 +0000 (05:32 -0700)] 
libgcc: Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16

Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16 to avoid
changing libgcc ABI.

gcc/

PR target/95212
* config/i386/i386-builtins.c (processor_features): Move
F_AVX512VP2INTERSECT after F_AVX512BF16.
(isa_names_table): Likewise.

libgcc/

PR target/95212
* config/i386/cpuinfo.h (processor_features): Move
FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16.

3 years agoFix a test-case warning.
Martin Liska [Thu, 21 May 2020 12:21:31 +0000 (14:21 +0200)] 
Fix a test-case warning.

PR target/95229
* g++.target/i386/pr95229.C: Fix
error: unnamed type with no linkage used
to declare variable ‘<unnamed class> e’ with linkage
with -std=gnu++98.

3 years agoRemove accidental testcase commit
Nathan Sidwell [Thu, 21 May 2020 12:07:23 +0000 (05:07 -0700)] 
Remove accidental testcase commit

* c-c++-common/cpp/cmd-1.c: Delete.
* c-c++-common/cpp/cmd-1.h: Delete.

3 years agolibgfortran: Use __builtin_cpu_is/__builtin_cpu_supports
H.J. Lu [Thu, 21 May 2020 10:54:32 +0000 (03:54 -0700)] 
libgfortran: Use __builtin_cpu_is/__builtin_cpu_supports

* m4/matmul.m4: Don't include <config/i386/cpuinfo.h>.  Use
__builtin_cpu_is/__builtin_cpu_supports
* generated/matmul_c10.c: Regenerated.
* generated/matmul_c16.c: Likewise.
* generated/matmul_c4.c: Likewise.
* generated/matmul_c8.c: Likewise.
* generated/matmul_i1.c: Likewise.
* generated/matmul_i16.c: Likewise.
* generated/matmul_i2.c: Likewise.
* generated/matmul_i4.c: Likewise.
* generated/matmul_i8.c: Likewise.
* generated/matmul_r10.c: Likewise.
* generated/matmul_r16.c: Likewise.
* generated/matmul_r4.c: Likewise.
* generated/matmul_r8.c: Likewise.

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

3 years agoPrepare git_update_version.py for real usage.
Martin Liska [Thu, 21 May 2020 09:51:32 +0000 (11:51 +0200)] 
Prepare git_update_version.py for real usage.

* gcc-changelog/git_update_version.py: Prepare the script, the
only missing piece is pushing of the updated branches.

3 years agoSupport DR entries for gcc-changelog.
Martin Liska [Thu, 21 May 2020 08:23:50 +0000 (10:23 +0200)] 
Support DR entries for gcc-changelog.

* gcc-changelog/git_commit.py: Support DR entries/
* gcc-changelog/test_email.py: New test for it.
* gcc-changelog/test_patches.txt: New patch for it.

3 years agomklog: support parsing of DR.
Martin Liska [Thu, 21 May 2020 08:14:56 +0000 (10:14 +0200)] 
mklog: support parsing of DR.

* mklog.py: Support DR parsing.
* test_mklog.py: New test for DR parsing.

3 years agolibstdc++: Avoid constraint recursion with iterator_traits (PR 93983)
Jonathan Wakely [Thu, 21 May 2020 06:32:15 +0000 (07:32 +0100)] 
libstdc++: Avoid constraint recursion with iterator_traits (PR 93983)

Checking whether a filesystem::path constructor argument is an iterator
requires instantiating std::iterator_traits. In C++20 that checks for
satisfaction of std::iterator_traits constraints, which checks if the
type is copyable, which can end up recursing back to the path
constructor. The fix in LWG 3420 is to reorder the cpp17-iterator
concept's constraints to check if the type looks vaguely like an
iterator before checking copyable. That avoids the recursion for types
which definitely aren't iterators, but isn't foolproof.

PR libstdc++/93983
* include/bits/iterator_concepts.h (__detail::__cpp17_iterator):
Reorder constraints to avoid recursion when constructors use
iterator_traits (LWG 3420).
* testsuite/24_iterators/customization_points/lwg3420.cc: New test.

3 years agoDaily bump.
GCC Administrator [Thu, 21 May 2020 00:16:29 +0000 (00:16 +0000)] 
Daily bump.

3 years agolibstdc++: Use macro for nodiscard attribute
Jonathan Wakely [Thu, 21 May 2020 00:03:27 +0000 (01:03 +0100)] 
libstdc++: Use macro for nodiscard attribute

* include/experimental/socket (basic_socket::is_open()
(basic_socket_acceptor::is_open()): Use _GLIBCXX_NODISCARD macro.

3 years agolibstdc++: Better requirements checking in Networking TS
Jonathan Wakely [Wed, 20 May 2020 23:59:55 +0000 (00:59 +0100)] 
libstdc++: Better requirements checking in Networking TS

Define concepts and traits for checking type requirements.

* include/experimental/bits/net.h (__endpoint, __protocol)
(__acceptable_protocol, __inet_protocol): New concepts.
(__detail::__is_endpoint): Move trait from <experimental/socket>.
(__is_protocol, __is_acceptable_protocol, __is_inet_protocol): New
traits.
(__endpoint, __protocol, __acceptable_protocol): New variable
templates.
* include/experimental/socket (__is_endpoint): Move to net.h header.
(basic_socket, basic_socket_acceptor): Check requirements.

3 years agolibstdc++: Fix net::basic_socket::close(error_code&)
Jonathan Wakely [Wed, 20 May 2020 23:59:55 +0000 (00:59 +0100)] 
libstdc++: Fix net::basic_socket::close(error_code&)

Also add some missing member functions, nodiscard attributes, and
noexcept-specifiers.

* include/experimental/executor (use_future_t::use_future_t()): Fix
incorrect noexcept-specifier.
* include/experimental/internet (basic_resolver_results): Adjust
whitespace.
* include/experimental/socket (__basic_socket_impl::release): Add
member function.
(basic_socket(io_context&, const endpoint_type&)): Fix argument to
target constructor.
(basic_socket::release(), basic_socket::release(error_code&)): Add
missing member functions.
(basic_socket::is_open()): Add nodiscard attribute.
(basic_socket::close(error_code&)): Pass argument to base function.
(basic_socket_acceptor::release())
(basic_socket_acceptor::release(error_code&)): Add missing member
functions.
(basic_socket_acceptor::is_open()): Add nodiscard attribute.
(basic_socket_streambuf::error()): Add noexcept.
(basic_socket_iostream::error()): Likewise.
* testsuite/experimental/net/socket/basic_socket.cc: New test.

3 years agolibstdc++: Use 'using' for types in Networking TS headers
Jonathan Wakely [Wed, 20 May 2020 23:59:55 +0000 (00:59 +0100)] 
libstdc++: Use 'using' for types in Networking TS headers

* include/experimental/buffer: Replace typedefs with
alias-declarations.
* include/experimental/executor: Likewise.
* include/experimental/internet: Likewise.
* include/experimental/socket: Likewise.
* include/experimental/timer: Likewise.

3 years agoi386: Do not use commutative operands with (use) RTX [PR95238]
Uros Bizjak [Wed, 20 May 2020 23:53:09 +0000 (01:53 +0200)] 
i386: Do not use commutative operands with (use) RTX [PR95238]

2020-05-21  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
PR target/95218

* config/i386/mmx.md (*mmx_<code>v2sf): Do not mark
operands 1 and 2 commutative.  Manually swap operands.
(*mmx_nabsv2sf2): Ditto.

Partially revert:

* config/i386/i386.md (*<code>tf2_1):
Mark operands 1 and 2 commutative.
(*nabstf2_1): Ditto.
* config/i386/sse.md (*<code><mode>2): Mark operands 1 and 2
commutative.  Do not swap operands.
(*nabs<mode>2): Ditto.

3 years agoFix premature omission of ChangeLog entry in ChangeLog file..
Jozef Lawrynowicz [Wed, 20 May 2020 21:40:10 +0000 (22:40 +0100)] 
Fix premature omission of ChangeLog entry in ChangeLog file..

* g++.dg/warn/Wconversion-null-2.C: Add explicit declarations for l()
and g() with int, long, long long and __int20 arguments.
* g++.dg/warn/Wconversion-null.C: Likewise.

3 years agoTESTSUITE: Fix Wconversion-null*.C tests for aarch64 -mabi=ilp32
Jozef Lawrynowicz [Wed, 20 May 2020 21:15:18 +0000 (22:15 +0100)] 
TESTSUITE: Fix Wconversion-null*.C tests for aarch64 -mabi=ilp32

This fixes regressions for aarch64 with -mabi=ilp32 of the
Wconversion-null*.C tests, introduced by 92ea8e1bccc.

The "g (int)" declaration is required for that target where
sizeof(int) == sizeof(long) == sizeof(void *).

To handle the msp430/-mlarge case, an explicit declaration of
"g (__int20)" is required.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wconversion-null-2.C: Add explicit declarations for l()
and g() with int, long, long long and __int20 arguments.
* g++.dg/warn/Wconversion-null.C: Likewise.

3 years agoc++: C++20 DR 2237, disallow simple-template-id in cdtor.
Marek Polacek [Sat, 4 Apr 2020 22:09:53 +0000 (18:09 -0400)] 
c++: C++20 DR 2237, disallow simple-template-id in cdtor.

This patch implements DR 2237 which says that a simple-template-id is
no longer valid as the declarator-id of a constructor or destructor;
see [diff.cpp17.class]#2.  It is not explicitly stated but out-of-line
destructors with a simple-template-id are also meant to be ill-formed
now.  (Out-of-line constructors like that are invalid since DR1435 I
think.)  This change only applies to C++20; it is not a DR against C++17.

I'm not crazy about the diagnostic in constructors but ISTM that
cp_parser_constructor_declarator_p shouldn't print errors.

DR 2237
* parser.c (cp_parser_unqualified_id): Reject simple-template-id as
the declarator-id of a destructor.
(cp_parser_constructor_declarator_p): Reject simple-template-id as
the declarator-id of a constructor.

* g++.dg/DRs/dr2237.C: New test.
* g++.dg/parse/constructor2.C: Add dg-error for C++20.
* g++.dg/parse/dtor12.C: Likewise.
* g++.dg/parse/dtor4.C: Likewise.
* g++.dg/template/dtor4.C: Adjust dg-error.
* g++.dg/template/error34.C: Likewise.
* g++.old-deja/g++.other/inline15.C: Only run for C++17 and lesses.
* g++.old-deja/g++.pt/ctor2.C: Add dg-error for C++20.

3 years agopreprocessor: Revert premature change
Nathan Sidwell [Wed, 20 May 2020 20:43:11 +0000 (13:43 -0700)] 
preprocessor:  Revert premature change

This part of the cleanup patch turns out to require more pieces to
function correctly.  I must have got confused over which tree I was
testing.  The very first map has a different pointer to the file name,
so doesn't match with a pointer compare. We were relying on that.

* c-common.c (try_to_locate_new_include_insertion_point): Revert change.

3 years agopreprocessor: cleanups in c-common handling
Nathan Sidwell [Wed, 20 May 2020 18:15:34 +0000 (11:15 -0700)] 
preprocessor: cleanups in c-common handling

* c-common.c (try_to_locate_new_include_insertion_point): Use
strcmp to compare filenames.
* c-lex.c (init_c_lex): Move declaration to initialization.
* c-opts.c (handle_deferred_opts): Move cpp_get_deps call into
deferred count loop.

3 years agoc++: Implement DR 2289, Uniqueness of structured binding names [PR94553]
Marek Polacek [Wed, 20 May 2020 03:53:28 +0000 (23:53 -0400)] 
c++: Implement DR 2289, Uniqueness of structured binding names [PR94553]

DR 2289 clarified that since structured bindings have no C compatibility
implications, they should be unique in their declarative region, see
[basic.scope.declarative]/4.2.

The duplicate_decls hunk is the gist of the patch, but that alone would
not be enough to detect the 'A' case: cp_parser_decomposition_declaration
uses

13968       tree decl2 = start_decl (declarator, &decl_specs, SD_INITIALIZED,
13969                                NULL_TREE, NULL_TREE, &elt_pushed_scope);

to create the 'A' VAR_DECL but in this start_decl's grokdeclarator we
don't do fit_decomposition_lang_decl because the declarator kind is not
cdk_decomp, so then when start_decl calls maybe_push_decl, the decl 'A'
isn't DECL_DECOMPOSITION_P and we don't detect this case.  So I needed a
way to signal to start_decl that it should fit_decomposition_lang_decl.
In this patch, I'm adding SD_DECOMPOSITION flag to say that the variable
is initialized and it should also be marked as DECL_DECOMPOSITION_P.

DR 2289
PR c++/94553
* cp-tree.h (SD_DECOMPOSITION): New flag.
* decl.c (duplicate_decls): Make sure a structured binding is unique
in its declarative region.
(start_decl): If INITIALIZED is SD_DECOMPOSITION, call
fit_decomposition_lang_decl.
(grokdeclarator): Compare INITIALIZED directly to SD_* flags.
* parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
to start_decl.

* g++.dg/cpp1z/decomp52.C: New test.

3 years agoi386: Fix zero/sign extend expanders [PR95229]
Uros Bizjak [Wed, 20 May 2020 17:00:39 +0000 (19:00 +0200)] 
i386: Fix zero/sign extend expanders [PR95229]

2020-05-20  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
PR target/95229
* config/i386/sse.md (<code>v8qiv8hi2): Use
simplify_gen_subreg instead of simplify_subreg.
(<code>v8qiv8si2): Ditto.
(<code>v4qiv4si2): Ditto.
(<code>v4hiv4si2): Ditto.
(<code>v8qiv8di2): Ditto.
(<code>v4qiv4di2): Ditto.
(<code>v2qiv2di2): Ditto.
(<code>v4hiv4di2): Ditto.
(<code>v2hiv2di2): Ditto.
(<code>v2siv2di2): Ditto.

gcc/testsuite/ChangeLog:
PR target/95229
* g++.target/i386/pr95229.C: New test.

3 years agoi386: Fix *pushsi2_rex64 constraints [PR95238]
Uros Bizjak [Wed, 20 May 2020 16:57:32 +0000 (18:57 +0200)] 
i386: Fix *pushsi2_rex64 constraints [PR95238]

2020-05-20  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
PR target/95238
* config/i386/i386.md (*pushsi2_rex64):
Use "e" constraint instead of "i".

3 years agogit_email.py: fix duplicate author_lines.
Martin Liska [Wed, 20 May 2020 14:10:02 +0000 (16:10 +0200)] 
git_email.py: fix duplicate author_lines.

* gcc-changelog/git_commit.py: Add author_tuple
only if not present in author_lines.
* gcc-changelog/test_email.py: New test.
* gcc-changelog/test_patches.txt: Add new patch.