]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agoc++: Fix mismatch in template argument deduction [PR90505]
Marek Polacek [Wed, 4 Mar 2020 23:49:37 +0000 (18:49 -0500)] 
c++: Fix mismatch in template argument deduction [PR90505]

2020-03-03  Jason Merrill  <jason@redhat.com>
    Marek Polacek  <polacek@redhat.com>

PR c++/90505 - mismatch in template argument deduction.
* pt.c (tsubst): Don't reduce the template level of template
parameters when tf_partial.

* g++.dg/template/deduce4.C: New test.
* g++.dg/template/deduce5.C: New test.
* g++.dg/template/deduce6.C: New test.
* g++.dg/template/deduce7.C: New test.

5 years agoc++: Fix [[no_unique_address]] and default mem-init [PR90432]
Jason Merrill [Wed, 4 Mar 2020 22:30:58 +0000 (17:30 -0500)] 
c++: Fix [[no_unique_address]] and default mem-init [PR90432]

output_constructor doesn't like two consecutive entries with fields at the
same position; let's avoid adding the one for the empty field.

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

PR c++/90432
* init.c (perform_member_init): Don't do aggregate initialization of
empty field.
* constexpr.c (cx_check_missing_mem_inits): Don't enforce
initialization of empty field.

5 years agoc++: avoid ICE with __builtin_memset (PR90997).
Jason Merrill [Wed, 4 Mar 2020 22:30:58 +0000 (17:30 -0500)] 
c++: avoid ICE with __builtin_memset (PR90997).

warn_for_memset calls fold_for_warn, which calls fold_non_dependent_expr, so
also calling instantiate_non_dependent_expr here is undesirable.

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

PR c++/90997
* semantics.c (finish_call_expr): Don't call
instantiate_non_dependent_expr before warn_for_memset.

5 years agoRemove unnecessary XFAILs from existing testcase 20050603-3.c.
Will Schmidt [Wed, 4 Mar 2020 16:34:33 +0000 (10:34 -0600)] 
Remove unnecessary XFAILs from existing testcase 20050603-3.c.

The XFAILs in this testcase (20050603-3.c) are no longer necessary
since the fix to PR68803 was committed with svn revision r242681.

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

testsuite

* gcc.target/powerpc/20050603-3.c: Remove XFAILS.

5 years agomaintainer-scripts: Speed up git clone in gcc_release
Jakub Jelinek [Thu, 27 Feb 2020 08:38:12 +0000 (09:38 +0100)] 
maintainer-scripts: Speed up git clone in gcc_release

When doing the 8.4-rc1, I've noticed (probably also because of the dying
disk on sourceware) that git clone is extremely slow, and furthermore when
all of us have some local snapshots, it is a waste of resources to download
everything again.  Especially for the -f runs when we'll need to wait until
git tag -s asks us for a gpg password interactively.

The following patch adds an option through which one can point the script
at a local gcc .git directory from which it can --dissociate --reference ...
during cloning to speed it up.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

* gcc_release: Add support for -b local-git-repo argument.

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

5 years agoDarwin, libsanitizer: Update minimum supported system version.
Iain Sandoe [Tue, 3 Mar 2020 10:17:15 +0000 (10:17 +0000)] 
Darwin, libsanitizer: Update minimum supported system version.

The imported sources from 'upstream' do not support Darwin10
or earlier, so do not enable these by default.

5 years agoexplow: Fix ICE caused by plus_constant [PR94002]
Jakub Jelinek [Tue, 3 Mar 2020 09:42:34 +0000 (10:42 +0100)] 
explow: Fix ICE caused by plus_constant [PR94002]

The following testcase ICEs in cross to riscv64-linux.  The problem is
that we have a DImode integral constant (that doesn't fit into SImode),
which is pushed into a constant pool and later access just the first half of
it using a MEM.  When plus_constant is called on such a MEM, if the constant
has mode, we verify the mode, but if it doesn't, we don't and ICE later on
when we think the CONST_INT is a valid SImode constant.

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

PR rtl-optimization/94002
* explow.c (plus_constant): Punt if cst has VOIDmode and
get_pool_mode is different from mode.

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

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

5 years agoc++: Fix ({ ... }) array mem-initializer.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
c++: Fix ({ ... }) array mem-initializer.

Here, we were going down the wrong path in perform_member_init because of
the incorrect parens around the mem-initializer for the array.  And then
cxx_eval_vec_init_1 didn't know what to do with a CONSTRUCTOR as the
initializer.  For GCC 9, let's just fix the latter issue.

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

PR c++/86917
* constexpr.c (cxx_eval_vec_init_1): Handle CONSTRUCTOR.

5 years agoc++: Allow parm of empty class type in constexpr.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
c++: Allow parm of empty class type in constexpr.

Since copying a class object is defined in terms of the copy constructor,
copying an empty class is OK even if it would otherwise not be usable in a
constant expression.  Relatedly, using a parameter as an lvalue is no more
problematic than a local variable, and calling a member function uses the
object as an lvalue.

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

PR c++/91953
* constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
empty class type.
[COMPONENT_REF]: A member function reference doesn't use the object
as an rvalue.

5 years agoc++: Fix cast to pointer to VLA.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
c++: Fix cast to pointer to VLA.

The C front-end fixed this issue in r257620 by adding a DECL_EXPR from
grokdeclarator.  We don't have an easy way to do that in the C++ front-end,
but it works fine to create and prepend a DECL_EXPR when we are genericizing
the NOP_EXPR for the cast.

The C patch wraps the DECL_EXPR in a BIND_EXPR, but that seems unnecessary
in C++; this is just a hook to run gimplify_type_sizes, we aren't actually
declaring anything that we need to worry about scoping for.

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

PR c++/88256
* cp-gimplify.c (predeclare_vla): New.
(cp_genericize_r) [NOP_EXPR]: Call it.

5 years agochecking: avoid verify_type_variant crash on incomplete type.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
checking: avoid verify_type_variant crash on incomplete type.

Here, we end up calling gen_type_die_with_usage for a type that's in the
middle of finish_struct_1, after we set TYPE_NEEDS_CONSTRUCTING on it but
before we copy all the flags to the variants--and, significantly, before we
set its TYPE_SIZE.  It seems reasonable to only look at
TYPE_NEEDS_CONSTRUCTING on complete types, since we aren't going to try to
create an object of an incomplete type any other way.

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

PR c++/92601
* tree.c (verify_type_variant): Only verify TYPE_NEEDS_CONSTRUCTING
of complete types.

5 years agoc++: Fix return deduction of lambda in discarded stmt.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
c++: Fix return deduction of lambda in discarded stmt.

A return statement in a discarded statement is not used for return type
deduction, but we still want to do deduction for a return statement in a
lambda in a discarded statement.

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

PR c++/93442
* parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.

5 years agoPR c++/90732 - ICE with VLA capture and generic lambda.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
PR c++/90732 - ICE with VLA capture and generic lambda.

We were failing to handle VLA capture in tsubst_lambda_expr; initially
building a DECLTYPE_TYPE for the capture and then tsubsting it doesn't give
the special VLA handling.  So with this patch we call add_capture again for
VLAs.

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

PR c++/90732 - ICE with VLA capture and generic lambda.
* pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.

5 years agoc++: Fix attributes with lambda and trailing return type.
Jason Merrill [Mon, 2 Mar 2020 19:42:47 +0000 (14:42 -0500)] 
c++: Fix attributes with lambda and trailing return type.

My fix for 60503 fixed handling of C++11 attributes following the
lambda-declarator.  My patch for 89640 re-added support for GNU attributes,
but attributes after the trailing return type were parsed as applying to the
return type rather than to the function.  This patch adjusts parsing of a
trailing-return-type to ignore GNU attributes at the end of the declaration
so that they will be applied to the declaration as a whole.

I also considered parsing the attributes between the closing paren and the
trailing-return-type, and tried a variety of approaches to implementing
that, but I think it's better to stick with the documented rule that "An
attribute specifier list may appear immediately before the comma, '=' or
semicolon terminating the declaration of an identifier...."  Anyone
disagree?

Meanwhile, C++ committee discussion about the lack of any way to apply
attributes to a lambda op() seems to have concluded that they should go
between the introducer and declarator, so I've implemented that as well.

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

PR c++/90333
PR c++/89640
PR c++/60503
* parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
a trailing return type.
(cp_parser_lambda_declarator_opt): Parse C++11 attributes before
parens.

5 years agolto: Also copy .note.gnu.property section
H.J. Lu [Mon, 2 Mar 2020 11:08:57 +0000 (03:08 -0800)] 
lto: Also copy .note.gnu.property section

When generating the separate file with LTO debug sections, we should
also copy .note.gnu.property section.

PR lto/93966
* simple-object.c (handle_lto_debug_sections): Also copy
.note.gnu.property section.

(cherry picked from commit 577350603a657590c4b54a4a966cb49497e2514c)

5 years agoReadd ChangeLog entries for
Peter Bergner [Mon, 2 Mar 2020 08:42:43 +0000 (09:42 +0100)] 
Readd ChangeLog entries for

r9-8308-g8fdde048c9e40b9ef4de14612326378d4831ac49^..r9-8311-ga0e22367235f5cd092f9d7800f17081ca4dc79e8

plus add entries for their reversion.

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

5 years agox32: Update baseline_symbols.txt
H.J. Lu [Sun, 1 Mar 2020 14:13:28 +0000 (06:13 -0800)] 
x32: Update baseline_symbols.txt

* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.

(cherry picked from commit fed76afb95af5ec24c9681cacfae73532a104508)

5 years agoDaily bump.
GCC Administrator [Sun, 1 Mar 2020 00:18:41 +0000 (00:18 +0000)] 
Daily bump.

5 years agoFix/skip various tests for hppa*-*-hpux*.
John David Anglin [Sat, 29 Feb 2020 22:37:28 +0000 (22:37 +0000)] 
Fix/skip various tests for hppa*-*-hpux*.

2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

* gcc.dg/pr90756.c: Add -fno-common option on hppa*-*-hpux*.
* gcc.dg/torture/20190327-1.c: Likewise.
* gcc.dg/torture/pr90020.c: Skip on hppa*-*-hpux*.

5 years agoRevert "Fix bad code of vector extract of PC-relative address with variable element #."
Peter Bergner [Sat, 29 Feb 2020 22:30:48 +0000 (16:30 -0600)] 
Revert "Fix bad code of vector extract of PC-relative address with variable element #."

This reverts commit 48558cdf49373ba508cf8d7fcaaafb383316f644.
See PR93974.

5 years agoRevert "Adjust how variable vector extraction is done."
Peter Bergner [Sat, 29 Feb 2020 22:30:32 +0000 (16:30 -0600)] 
Revert "Adjust how variable vector extraction is done."

This reverts commit 428a4feef8594142e5324c0f5cfc8281e43bf75a.
See PR93974.

5 years agoRevert "rs6000: Fix infinite loop building ghostscript and icu [PR93658]"
Peter Bergner [Sat, 29 Feb 2020 22:30:07 +0000 (16:30 -0600)] 
Revert "rs6000: Fix infinite loop building ghostscript and icu [PR93658]"

This reverts commit 066184a282b622ac6880150eb4e42fe57881b606.
See PR93974.

5 years agoRevert "rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix...
Peter Bergner [Sat, 29 Feb 2020 22:29:19 +0000 (16:29 -0600)] 
Revert "rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913]"

This reverts commit 98529e6d7408e896cb74c327ae60b3ccea055d9c.
See PR93974.

5 years agoFix libbacktrace build on hppa-hpux.
John David Anglin [Sat, 29 Feb 2020 22:25:04 +0000 (22:25 +0000)] 
Fix libbacktrace build on hppa-hpux.

2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

Backport from mainline
2019-09-26  Ian Lance Taylor  <iant@golang.org>

PR libbacktrace/91908
* pecoff.c (backtrace_initialize): Explicitly cast unchecked
__sync_bool_compare_and_swap to void.
* xcoff.c (backtrace_initialize): Likewise.

5 years agoSkip charset.cc tests on *-*-hpux*.
John David Anglin [Sat, 29 Feb 2020 21:07:08 +0000 (21:07 +0000)] 
Skip charset.cc tests on *-*-hpux*.

2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

* testsuite/17_intro/headers/c++1998/charset.cc: Skip on *-*-hpux*.
* testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2020/charset.cc: Likewise.

5 years agoDisable gnat.dg/socket1.adb on hppa*-*-hpux*.
John David Anglin [Sat, 29 Feb 2020 20:39:09 +0000 (20:39 +0000)] 
Disable gnat.dg/socket1.adb on hppa*-*-hpux*.

2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

PR ada/91100
* gnat.dg/socket1.adb: Disable on hppa*-*-hpux*.

5 years agoDaily bump.
GCC Administrator [Sat, 29 Feb 2020 00:18:33 +0000 (00:18 +0000)] 
Daily bump.

5 years agoBackport 08bf7bde9f2987b1c623d272cc71fc14a1622442
Martin Liska [Fri, 28 Feb 2020 17:52:55 +0000 (18:52 +0100)] 
Backport 08bf7bde9f2987b1c623d272cc71fc14a1622442

Backport from mainline
2020-02-28  Martin Liska  <mliska@suse.cz>

PR other/93965
* configure.ac: Improve detection of ld_date by requiring
either two dashes or none.
* configure: Regenerate.

5 years agoDaily bump.
GCC Administrator [Fri, 28 Feb 2020 00:19:11 +0000 (00:19 +0000)] 
Daily bump.

5 years agors6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913]
Peter Bergner [Wed, 26 Feb 2020 17:58:08 +0000 (11:58 -0600)] 
rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913]

Backport from trunk
2020-02-26  Peter Bergner  <bergner@linux.ibm.com>

PR target/93913
* gcc.target/powerpc/fold-vec-st-char.c (scan-assembler-times): Allow
stxv and stxvx instructions as well.
* gcc.target/powerpc/fold-vec-st-float.c: Likewise.
* gcc.target/powerpc/fold-vec-st-int.c: Likewise.
* gcc.target/powerpc/fold-vec-st-short.c: Likewise.

5 years agogimplify: Don't optimize register const vars to static [PR93949]
Jakub Jelinek [Thu, 27 Feb 2020 09:45:30 +0000 (10:45 +0100)] 
gimplify: Don't optimize register const vars to static [PR93949]

The following testcase is rejected, while it was accepted in 3.4 and earlier
(before tree-ssa merge).
The problem is that we decide to promote the const variable to TREE_STATIC,
but TREE_STATIC DECL_REGISTER VAR_DECLs may only be the global register vars
and so assemble_variable/make_decl_rtl diagnoses it.

Either we do what the following patch does, where we could consider
register as a hint the user doesn't want such optimization, because if
something is forced static, it is not "register" anymore and register static
is not valid in C either, or we could clear DECL_REGISTER instead, but would
still need to punt at least on DECL_HARD_REGISTER cases.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

PR c/93949
* gimplify.c (gimplify_init_constructor): Don't promote readonly
DECL_REGISTER variables to TREE_STATIC.

* gcc.c-torture/compile/pr93949.c: New test.

5 years agosccvn: Punt on ref->size not multiple of 8 for memset (, 123, ) in 9.x [PR93945]
Jakub Jelinek [Thu, 27 Feb 2020 10:21:52 +0000 (11:21 +0100)] 
sccvn: Punt on ref->size not multiple of 8 for memset (, 123, ) in 9.x [PR93945]

And here is the corresponding 9.x change where we the patch just punts if
ref->size is not whole bytes, like we already punt if offseti is not byte
aligned.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/93945
* tree-ssa-sccvn.c (vn_reference_lookup_3): For memset with non-zero
second operand, require ref->size to be a multiple of BITS_PER_UNIT.

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

5 years agoPPC64, fix documentation for __builtin_crypto_vpmsum* builtin functions.
Carl Love [Thu, 27 Feb 2020 00:22:46 +0000 (18:22 -0600)] 
PPC64, fix documentation for __builtin_crypto_vpmsum* builtin functions.

PR target/91276 - Doc typos in __builtin_crypto_vpmsum*

gcc/ChangeLog:

2020-02-26  Carl Love  <cel@us.ibm.com>

PR target/91276
* doc/extend.texi (PowerPC AltiVec Built-in Functions available on
ISA 3.0): The builtin-function name __builtin_crypto_vpmsumb is only
for the vector unsigned short arguments.  It is also listed as the
name of the built-in for arguments vector unsigned short,
vector unsigned int and vector unsigned long long built-ins.  The
name of the builtins for these arguments should be:
__builtin_crypto_vpmsumh, __builtin_crypto_vpmsumw and
__builtin_crypto_vpmsumd respectively.

5 years agoDaily bump.
GCC Administrator [Thu, 27 Feb 2020 00:18:33 +0000 (00:18 +0000)] 
Daily bump.

5 years agoRevert "setup branch"
Joseph Myers [Wed, 26 Feb 2020 21:08:19 +0000 (21:08 +0000)] 
Revert "setup branch"

This reverts commit 65e894738f629a388847f38687c9af2b05233526.

Commit appears to have been made on the wrong branch, and breaks
contrib/gcc_update because it checks in a file gcc/REVISION.

5 years agosetup branch
Michael Meissner [Wed, 26 Feb 2020 20:56:56 +0000 (15:56 -0500)] 
setup branch

5 years agoPR c++/92745 - bogus error when initializing array of vectors.
Marek Polacek [Fri, 20 Dec 2019 23:30:04 +0000 (23:30 +0000)] 
PR c++/92745 - bogus error when initializing array of vectors.

In r268428 I changed reshape_init_r in such a way that when it sees
a nested { } in a CONSTRUCTOR with missing braces, it just returns
the initializer:
+     else if (COMPOUND_LITERAL_P (stripped_init)
...
+         ++d->cur;
+         gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
+         return init;

But as this test shows, that's incorrect: if TYPE is an array, we need
to proceed to reshape_init_array_1 which will iterate over the array
initializers:
 6006   /* Loop until there are no more initializers.  */
 6007   for (index = 0;
 6008        d->cur != d->end && (!sized_array_p || index <= max_index_cst);
 6009        ++index)
 6010     {
and update d.cur accordingly.  In other words, when reshape_init gets

{{col[0][0], col[1][0], col[2][0], col[3][0]},
 {col[0][1], col[1][1], col[2][1], col[3][1]},
 {col[0][2], col[1][2], col[2][2], col[3][2]},
 {col[0][3], col[1][3], col[2][3], col[3][3]}}

we recurse on the first element:
  {col[0][0], col[1][0], col[2][0], col[3][0]}
and we can't just move d.cur to point to
  {col[0][1], col[1][1], col[2][1], col[3][1]}
and return; we need to iterate, so that d.cur ends up being properly
updated, and after all initializers have been seen, points to d.end.
Currently we skip the loop, wherefore we hit this:

 6502   /* Make sure all the element of the constructor were used. Otherwise,
 6503      issue an error about exceeding initializers.  */
 6504   if (d.cur != d.end)
 6505     {
 6506       if (complain & tf_error)
 6507         error ("too many initializers for %qT", type);
 6508       return error_mark_node;
 6509     }

gcc/cp/ChangeLog
2019-12-19  Marek Polacek  <polacek@redhat.com>

PR c++/92745 - bogus error when initializing array of vectors.
* decl.c (reshape_init_r): For a nested compound literal, do
call reshape_init_{class,array,vector}.

gcc/testsuite/ChangeLog
2019-12-19  Marek Polacek  <polacek@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

PR c++/92745 - bogus error when initializing array of vectors.
* g++.dg/cpp0x/initlist118.C: New test.
* g++.dg/cpp0x/initlist118.C: Add -Wno-psabi -w to dg-options.

5 years agocgraph: A COMDAT decl always has non-zero address.
Jason Merrill [Wed, 26 Feb 2020 18:03:23 +0000 (13:03 -0500)] 
cgraph: A COMDAT decl always has non-zero address.

We should be able to assume that a template instantiation or other COMDAT
has non-zero address even if MAKE_DECL_ONE_ONLY for the target sets
DECL_WEAK and we haven't yet decided to emit a definition in this
translation unit.

gcc/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

PR c++/92003
* symtab.c (symtab_node::nonzero_address): A DECL_COMDAT decl has
non-zero address even if weak and not yet defined.

5 years agoc++: Fix constexpr vs. omitted aggregate init.
Jason Merrill [Wed, 26 Feb 2020 18:03:23 +0000 (13:03 -0500)] 
c++: Fix constexpr vs. omitted aggregate init.

Value-initialization is importantly different from {}-initialization for
this testcase, where the former calls the deleted S constructor and the
latter initializes S happily.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

PR c++/90951
* constexpr.c (cxx_eval_array_reference): {}-initialize missing
elements instead of value-initializing them.

5 years agoc++: Fix decltype of empty pack expansion of parm.
Jason Merrill [Wed, 26 Feb 2020 18:03:23 +0000 (13:03 -0500)] 
c++: Fix decltype of empty pack expansion of parm.

In unevaluated context, we only substitute a single PARM_DECL, not the
entire chain, but the handling of an empty pack expansion was missing that
check.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

PR c++/93140
* pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
handling of TREE_CHAIN for empty pack.

5 years agoc++: Preserve location in maybe_constant_value.
Jason Merrill [Wed, 26 Feb 2020 18:03:23 +0000 (13:03 -0500)] 
c++: Preserve location in maybe_constant_value.

If cxx_eval_outermost_constant_expr doesn't change the argument, we really
shouldn't unshare it when we try to fold it again.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

PR c++/92852
* constexpr.c (maybe_constant_value): Don't unshare if the cached
value is the same as the argument.

5 years agolibstdc++: Fix undefined behaviour in random dist serialization (PR93205)
Jonathan Wakely [Wed, 26 Feb 2020 16:31:19 +0000 (16:31 +0000)] 
libstdc++: Fix undefined behaviour in random dist serialization (PR93205)

The deserialization functions for random number distributions fail to
check the stream state before using the extracted values. In some cases
this leads to using indeterminate values to resize a vector, and then
filling that vector with indeterminate values.

No values that affect control flow should be used without checking that a
good value was read from the stream.

Additionally, where reasonable to do so, defer modifying any state in
the distribution until all values have been successfully read, to avoid
modifying some of the distribution's parameters and leaving others
unchanged.

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

PR libstdc++/93205
* include/bits/random.h (operator>>): Check stream operation succeeds.
* include/bits/random.tcc: (operator>>): Likewise.
(__extract_params): New function to fill a vector from a stream.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.

5 years agolibstdc++: Fix description of std::ios::trunc (PR 92886)
Jonathan Wakely [Wed, 26 Feb 2020 16:31:19 +0000 (16:31 +0000)] 
libstdc++: Fix description of std::ios::trunc (PR 92886)

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

PR libstdc++/92886
* include/bits/ios_base.h (std::ios_base::trunc): Fix comment.

5 years agors6000: fixinc: Skip machine_name fix for powerpc*-*-linux*
Matheus Castanho [Thu, 13 Feb 2020 23:43:39 +0000 (23:43 +0000)] 
rs6000: fixinc: Skip machine_name fix for powerpc*-*-linux*

Some system headers can be broken by the machine_name fix performed
by GCC during the fixincludes step. According to the comment in
fixincludes/fixinc.h:130 :

   On some platforms, machine_name doesn't work properly and
   breaks some of the header files.  Since everything works
   properly without it, just wipe the macro list to
   disable the fix.

So we can just skip it to avoid trouble.

Backport from trunk
2020-02-13  Matheus Castanho  <msc@linux.ibm.com>

fixincludes/
* fixinc.in: Skip machine_name fix on powerpc*-*-linux*.

5 years agolibstdc++: Replace glibc-specific check for clock_gettime (PR 93325)
Jonathan Wakely [Wed, 26 Feb 2020 15:32:34 +0000 (15:32 +0000)] 
libstdc++: Replace glibc-specific check for clock_gettime (PR 93325)

It's wrong to assume that clock_gettime is unavailable on any *-*-linux*
target that doesn't have glibc 2.17 or later. Use a generic test instead
of using __GLIBC_PREREQ. Only do that test when is_hosted=yes so that we
don't get an error for cross targets without a working linker.

This ensures that C library's clock_gettime will be used on non-glibc
targets, instead of an incorrect syscall to SYS_clock_gettime.

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

PR libstdc++/93325
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
clock_gettime instead of explicit glibc version check.
* configure: Regenerate.

5 years agolibstdc++: Fix regressions in unique_ptr::swap (PR 93562)
Jonathan Wakely [Wed, 26 Feb 2020 15:04:53 +0000 (15:04 +0000)] 
libstdc++: Fix regressions in unique_ptr::swap (PR 93562)

The requirements for this function are only that the deleter is
swappable, but we incorrectly require that the element type is complete
and that the deleter can be swapped using std::swap (which requires it
to be move cosntructible and move assignable).

The fix is to add __uniq_ptr_impl::swap which swaps the pointer and
deleter individually, instead of using the generic std::swap on the
tuple containing them.

PR libstdc++/93562
* include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
(unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
* testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.

5 years agolibstdc++: Fix freestanding build (PR 92376)
Jonathan Wakely [Wed, 26 Feb 2020 14:20:55 +0000 (14:20 +0000)] 
libstdc++: Fix freestanding build (PR 92376)

In a freestanding library we don't install the <pstl/pstl_config.h>
header, so don't try to include it unless it exists.

Explicitly declare aligned alloc functions for freestanding, because
<cstdlib> doesn't declare them.

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

PR libstdc++/92376
* include/bits/c++config: Only do PSTL config when the header is
present, to fix freestanding.
* libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
functions if they were detected by configure.

5 years agoPR libstdc++/78552 only construct std::locale for C locale once
Jonathan Wakely [Wed, 26 Feb 2020 14:00:07 +0000 (14:00 +0000)] 
PR libstdc++/78552 only construct std::locale for C locale once

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

PR libstdc++/78552
* src/c++98/locale_init.cc (locale::classic()): Do not construct a new
locale object for every call.
(locale::_S_initialize_once()): Construct C locale here.

5 years agors6000: mark clobber for registers changed by untpyed_call
Jiufu Guo [Mon, 17 Feb 2020 02:48:39 +0000 (10:48 +0800)] 
rs6000: mark clobber for registers changed by untpyed_call

As PR93047 said, __builtin_apply/__builtin_return does not work well with
-frename-registers.  This is caused by return register(e.g. r3) is used to
rename another register, before return register is stored to stack.
This patch fix this issue by emitting clobber for those egisters which
maybe changed by untyped call.

gcc/
2020-02-26  Jiufu Guo  <guojiufu@linux.ibm.com>

PR target/93047
* config/rs6000/rs6000.md (untyped_call): Add emit_clobber.

gcc/testsuite
2020-02-26  Jiufu Guo  <guojiufu@linux.ibm.com>

PR target/93047
* gcc.dg/torture/stackalign/builtin-return-2.c: New test case.

5 years agostore-merging: Fix coalesce_immediate_stores [PR93820]
Jakub Jelinek [Wed, 26 Feb 2020 08:33:48 +0000 (09:33 +0100)] 
store-merging: Fix coalesce_immediate_stores [PR93820]

The following testcase is miscompiled in 8+.
The problem is that check_no_overlap has a special case for INTEGER_CST
marked stores (i.e. stores of constants), if both all currenly merged stores
and the one under consideration for merging with them are marked that way,
it anticipates that other INTEGER_CST marked stores that overlap with those
and precede those (have smaller info->order) could be merged with those and
doesn't punt for them.
In PR86844 and PR87859 fixes I've then added quite large code that is
performed after check_no_overlap and tries to find out if we need and can
merge further INTEGER_CST marked stores, or need to punt.
Unfortunately, that code is there only in the overlapping case code and
the testcase below shows that we really need it even in the adjacent store
case.  After sort_by_bitpos we have:
bitpos width order rhs_code
96 32 3 INTEGER_CST
128 32 1 INTEGER_CST
128 128 2 INTEGER_CST
192 32 0 MEM_REF
Because of the missing PR86844/PR87859-ish code in the adjacent store
case, we merge the adjacent (memory wise) stores 96/32/3 and 128/32/1,
and then we consider the 128-bit store which is in program-order in between
them, but in this case we punt, because the merging would extend the
merged store region from bitpos 96 and 64-bits to bitpos 96 and 160-bits
and that has an overlap with an incompatible store (the MEM_REF one).
The problem is that we can't really punt this way, because the 128-bit
store is in between those two we've merged already, so either we manage
to merge even that one together with the others, or would need to avoid
already merging the 96/32/3 and 128/32/1 stores together.
Now, rather than copying around the PR86844/PR87859 code to the other spot,
we can actually just use the overlapping code, merge_overlapping is really
a superset of merge_into, so that is what the patch does.  If doing
adjacent store merge for rhs_code other than INTEGER_CST, I believe the
current code is already fine, check_no_overlap in that case doesn't make
the exception and will punt if there is some earlier (smaller order)
non-mergeable overlapping store.  There is just one case that could be
problematic, if the merged_store has BIT_INSERT_EXPRs in them and the
new store is a constant store (INTEGER_CST rhs_code), then check_no_overlap
would do the exception and still would allow the special case.  But we
really shouldn't have the special case in that case, so this patch also
changes check_no_overlap to just have a bool whether we should have the
special case or not.

Note, as I said in the PR, for GCC11 we could consider performing some kind
of cheap DSE during the store merging (perhaps guarded with flag_tree_dse).
And another thing to consider is only consider as problematic non-mergeable
stores that not only have order smaller than last_order as currently, but
also have order larger than first_order, as in this testcase if we actually
ignored (not merged with anything at all) the 192/32/0 store, because it is
not in between the other stores we'd merge, it would be fine to merge the
other 3 stores, though of course the testcase can be easily adjusted by
putting the 192/32 store after the 128/32 store and then this patch would be
still needed.  Though, I think I'd need more time thinking this over.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/93820
* gimple-ssa-store-merging.c (check_no_overlap): Change RHS_CODE
argument to ALL_INTEGER_CST_P boolean.
(imm_store_chain_info::try_coalesce_bswap): Adjust caller.
(imm_store_chain_info::coalesce_immediate_stores): Likewise.  Handle
adjacent INTEGER_CST store into merged_store->only_constants like
overlapping one.

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

5 years agoc++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905]
Jakub Jelinek [Wed, 26 Feb 2020 08:04:44 +0000 (09:04 +0100)] 
c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905]

Add testcase for a bug that has been just on the 8 branch.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

PR c++/93905
* g++.dg/cpp0x/pr93905.C: New test.

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

5 years agoARM: Fix -mpure-code for v6m
Christophe Lyon [Wed, 19 Feb 2020 20:55:23 +0000 (20:55 +0000)] 
ARM: Fix -mpure-code for v6m

When running the testsuite with -fdisable-rtl-fwprop2 and -mpure-code
for cortex-m0, I noticed that some testcases were failing because we
still generate "ldr rX, .LCY", which is what we want to avoid with
-mpure-code. This is latent since a recent improvement in fwprop
(PR88833).

In this patch I change the thumb1_movsi_insn pattern so that it emits
the desired instruction sequence when arm_disable_literal_pool is set.

To achieve that, I introduce a new required_for_purecode attribute to
enable the corresponding alternative in thumb1_movsi_insn and take the
actual instruction sequence length into account.

gcc/ChangeLog:

2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

Backport from mainline
2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

* config/arm/arm.md (required_for_purecode): New attribute.
(enabled): Handle required_for_purecode.
* config/arm/thumb1.md (thumb1_movsi_insn): Add alternative to
work with -mpure-code.

5 years agoARM: Add support for -mpure-code in thumb-1 (v6m)
Christophe Lyon [Tue, 17 Dec 2019 15:43:07 +0000 (15:43 +0000)] 
ARM: Add support for -mpure-code in thumb-1 (v6m)

This patch extends support for -mpure-code to all thumb-1 processors,
by removing the need for MOVT.

Symbol addresses are built using upper8_15, upper0_7, lower8_15 and
lower0_7 relocations, and constants are built using sequences of
movs/adds and lsls instructions.

The extension of the *thumb1_movhf pattern uses always the same size
(6) although it can emit a shorter sequence when possible. This is
similar to what *arm32_movhf already does.

CASE_VECTOR_PC_RELATIVE is now false with -mpure-code, to avoid
generating invalid assembly code with differences from symbols from
two different sections (the difference cannot be computed by the
assembler).

Tests pr45701-[12].c needed a small adjustment to avoid matching
upper8_15 when looking for the r8 register.

Test no-literal-pool.c is augmented with __fp16, so it now uses
-mfp16-format=ieee.

Test thumb1-Os-mult.c generates an inline code sequence with
-mpure-code and computes the multiplication by using a sequence of
add/shift rather than using the multiply instruction, so we skip it in
presence of -mpure-code.

With -mcpu=cortex-m0, the pure-code/no-literal-pool.c fails because
code like:
static char *p = "Hello World";
char *
testchar ()
{
  return p + 4;
}

generates 2 indirections (I removed non-essential directives/code)
          .section        .rodata
  .LC0:
  .ascii  "Hello World\000"
  .data
  p:
  .word   .LC0
  .section        .rodata
  .LC2:
  .word   p
  .section .text,"0x20000006",%progbits
  testchar:
  push    {r7, lr}
  add     r7, sp, #0
  movs    r3, #:upper8_15:#.LC2
  lsls    r3, #8
  adds    r3, #:upper0_7:#.LC2
  lsls    r3, #8
  adds    r3, #:lower8_15:#.LC2
  lsls    r3, #8
  adds    r3, #:lower0_7:#.LC2
  ldr     r3, [r3]
  ldr     r3, [r3]
  adds    r3, r3, #4
  movs    r0, r3
  mov     sp, r7
  @ sp needed
  pop     {r7, pc}

By contrast, when using -mcpu=cortex-m4, the code looks like:
        .section        .rodata
.LC0:
.ascii  "Hello World\000"
.data
p:
.word   .LC0
testchar:
push    {r7}
add     r7, sp, #0
movw    r3, #:lower16:p
movt    r3, #:upper16:p
ldr     r3, [r3]
adds    r3, r3, #4
mov     r0, r3
mov     sp, r7
pop     {r7}
bx      lr

I haven't found yet how to make code for cortex-m0 apply upper/lower
relocations to "p" instead of .LC2. The current code looks functional,
but could be improved.

2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

Backport from mainline
2019-10-18  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/arm/arm-protos.h (thumb1_gen_const_int): Add new prototype.
* config/arm/arm.c (arm_option_check_internal): Remove restriction
on MOVT for -mpure-code.
(thumb1_gen_const_int): New function.
(thumb1_legitimate_address_p): Support -mpure-code.
(thumb1_rtx_costs): Likewise.
(thumb1_size_rtx_costs): Likewise.
(arm_thumb1_mi_thunk): Likewise.
* config/arm/arm.h (CASE_VECTOR_PC_RELATIVE): Likewise.
* config/arm/thumb1.md (thumb1_movsi_symbol_ref): New.
(*thumb1_movhf): Support -mpure-code.

gcc/testsuite/
* gcc.target/arm/pr45701-1.c: Adjust for -mpure-code.
* gcc.target/arm/pr45701-2.c: Likewise.
* gcc.target/arm/pure-code/no-literal-pool.c: Add tests for
__fp16.
* gcc.target/arm/pure-code/pure-code.exp: Remove thumb2 and movt
conditions.
* gcc.target/arm/thumb1-Os-mult.c: Skip if -mpure-code is used.

5 years agocombine: Fix find_split_point handling of constant store into ZERO_EXTRACT [PR93908]
Jakub Jelinek [Tue, 25 Feb 2020 12:56:47 +0000 (13:56 +0100)] 
combine: Fix find_split_point handling of constant store into ZERO_EXTRACT [PR93908]

git is miscompiled on s390x-linux with -O2 -march=zEC12 -mtune=z13.
I've managed to reduce it into the following testcase.  The problem is that
during combine we see the s->k = -1; bitfield store and change the SET_SRC
from a pseudo into a constant:
(set (zero_extract:DI (mem/j:HI (plus:DI (reg/v/f:DI 60 [ s ])
                (const_int 10 [0xa])) [0 +0 S2 A16])
        (const_int 2 [0x2])
        (const_int 7 [0x7]))
    (const_int -1 [0xffffffffffffffff]))
This on s390x with the above option isn't recognized as valid instruction,
so find_split_point decides to handle it as IOR or IOR/AND.
src is -1, mask is 3 and pos is 7.
src != mask (this is also incorrect, we want to set all (both) bits in the
bitfield), so we go for IOR/AND, but instead of trying
mem = (mem & ~0x180) | ((-1 << 7) & 0x180)
we actually try
mem = (mem & ~0x180) | (-1 << 7)
and that is further simplified into:
mem = mem | (-1 << 7)
aka
mem = mem | 0xff80
which doesn't set just the 2-bit bitfield, but also many other bitfields
that shouldn't be touched.
We really should do:
mem = mem | 0x180
instead.
The problem is that we assume that no bits but those low len (2 here) will
be set in the SET_SRC, but there is nothing that can prevent that, we just
should ignore the other bits.

The following patch fixes it by masking src with mask, this way already
the src == mask test will DTRT, and as the code for or_mask uses
gen_int_mode, if the most significant bit is set after shifting it left by
pos, it will be properly sign-extended.

2020-02-25  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/93908
* combine.c (find_split_point): For store into ZERO_EXTRACT, and src
with mask.

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

5 years agoFix link failure with debug info in LTO mode
Eric Botcazou [Tue, 25 Feb 2020 11:34:00 +0000 (12:34 +0100)] 
Fix link failure with debug info in LTO mode

This fixes a regression whereby the program fails to link with debug
info in LTO mode because of an undefined reference to a symbol coming
from the object files containing the early debug info.

* dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.

5 years agodoc: backport proper description of --enable-checking behavior
Roman Zhuykov [Tue, 25 Feb 2020 11:32:42 +0000 (14:32 +0300)] 
doc: backport proper description of --enable-checking behavior

This patch rewords the whole description to fix minor issues:
 - documents 'gimple' and 'types' checks,
 - clarifies what happens when option is used without '=list',
 - fixes inaccurate wrong wording about release snapshots,
 - describes that release checks can only be disabled explicitly.

Backport from master
2020-02-24  Roman Zhuykov  <zhroma@ispras.ru>

* doc/install.texi (--enable-checking): Properly document current
behavior.
(--enable-stage1-checking): Minor clarification about bootstrap.

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

5 years agovect: Fix offset calculation for -ve strides [PR93767]
Richard Sandiford [Tue, 18 Feb 2020 18:06:32 +0000 (18:06 +0000)] 
vect: Fix offset calculation for -ve strides [PR93767]

This PR is a regression caused by r256644, which added support for alias
checks involving variable strides.  One of the changes in that commit
was to split the access size out of the segment length.  The PR shows
that I hadn't done that correctly for the handling of negative strides
in vect_compile_time_alias.  The old code was:

      const_length_a = (-wi::to_poly_wide (segment_length_a)).force_uhwi ();
      offset_a = (offset_a + vect_get_scalar_dr_size (a)) - const_length_a;

where vect_get_scalar_dr_size (a) was cancelling out the subtraction
of the access size inherent in "- const_length_a".  Taking the access
size out of the segment length meant that the addition was no longer
needed/correct.

2020-02-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

PR tree-optimization/93767
* tree-vect-data-refs.c (vect_compile_time_alias): Remove the
access-size bias from the offset calculations for negative strides.

gcc/testsuite/
Backport from mainline
2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

PR tree-optimization/93767
* gcc.dg/vect/pr93767.c: New test.

5 years agofortran: ICE using SHAPE with FINDLOC PR93835
Mark Eggleston [Mon, 24 Feb 2020 15:53:24 +0000 (15:53 +0000)] 
fortran: ICE using SHAPE with FINDLOC PR93835

Backported from mainline
2020-02-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

PR fortran/93835
* simplify.c (simplify_findloc_nodim) : Fix whitespace issues.
(gfc_simplify_shape) : Create and initialise one shape value
for the result expression. Set shape value with the rank of
the source array.

PR fortran/93835
* gfortran.dg/pr77351.f90 : Check for one error instead of two.
* gfortran.dg/pr93835.f08 : New test.

5 years agoAvoid collect2 calling signal unsafe functions and/or unlink with uninitialized memory
Bernd Edlinger [Mon, 17 Feb 2020 16:40:07 +0000 (17:40 +0100)] 
Avoid collect2 calling signal unsafe functions and/or unlink with uninitialized memory

2020-02-24  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* collect2.c (tool_cleanup): Avoid calling not signal-safe
functions.
(maybe_run_lto_and_relink): Avoid possible signal handler
access to unintialzed memory (lto_o_files).

5 years agors6000: Fix infinite loop building ghostscript and icu [PR93658]
Peter Bergner [Mon, 24 Feb 2020 00:22:57 +0000 (18:22 -0600)] 
rs6000: Fix infinite loop building ghostscript and icu [PR93658]

Fix rs6000_legitimate_address_p(), which erroneously marks a valid Altivec
address as being invalid, which causes LRA's process_address()  to go into
an infinite loop spilling the same address over and over again.
Include Mike's earlier commits that fix bugs this patch exposes.

Backport from master
2020-02-20  Peter Bergner  <bergner@linux.ibm.com>

PR target/93658
* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX
vector modes.

* gcc.target/powerpc/pr93658.c: New test.

5 years agoAdjust how variable vector extraction is done.
Michael Meissner [Mon, 24 Feb 2020 00:17:12 +0000 (18:17 -0600)] 
Adjust how variable vector extraction is done.

Backport from master
2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (get_vector_offset): New helper function
to calculate the offset in memory from the start of a vector of a
particular element.  Add code to keep the element number in
bounds if the element number is variable.
(rs6000_adjust_vec_address): Move calculation of offset of the
vector element to get_vector_offset.
(rs6000_split_vec_extract_var): Do not do the initial AND of
element here, move the code to get_vector_offset.

Fix PR 93568 (thinko)

Backport from master
2020-02-05  Michael Meissner  <meissner@linux.ibm.com>

PR target/93568
* config/rs6000/rs6000.c (get_vector_offset): Fix Q constraint assert
to use MEM.

5 years agoFix bad code of vector extract of PC-relative address with variable element #.
Michael Meissner [Mon, 24 Feb 2020 00:13:00 +0000 (18:13 -0600)] 
Fix bad code of vector extract of PC-relative address with variable element #.

Backport from master
2020-01-06  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/vsx.md (vsx_extract_<mode>_var, VSX_D iterator):
Use 'Q' for doing vector extract from memory.
(vsx_extract_v4sf_var): Use 'Q' for doing vector extract from
memory.
(vsx_extract_<mode>_var, VSX_EXTRACT_I iterator): Use 'Q' for
doing vector extract from memory.
(vsx_extract_<mode>_<VS_scalar>mode_var): Use 'Q' for doing vector
extract from memory.

5 years agoDaily bump.
GCC Administrator [Mon, 24 Feb 2020 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

5 years agoDaily bump.
GCC Administrator [Sun, 23 Feb 2020 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

5 years agoUse au->lock exclusively for locking in async I/O.
Thomas König [Thu, 13 Feb 2020 21:22:04 +0000 (22:22 +0100)] 
Use au->lock exclusively for locking in async I/O.

2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/93599
* io/async.c (destroy_adv_cond): Do not destroy lock.
(async_io): Make sure au->lock is locked for finishing of thread.
Do not lock/unlock around signalling emptysignal. Unlock au->lock
before return.
(init_adv_cond): Do not initialize lock.
(enqueue_transfer): Unlock after signal.
(enqueue_done_id): Likewise.
(enqueue_done): Likewise.
(enqueue_close): Likewise.
(enqueue_data_transfer): Likewise.
(async_wait_id): Do not lock/unlock around signalling au->work.
(async_wait): Unlock after signal.
* io/async.h (SIGNAL): Add comment about needed au->lock.
Remove locking/unlocking of advcond->lock.
(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
advcond->lock.  Unlock mutex only at the end.  Loop on
__ghread_cond_wait returning zero.
(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
advcond->lock.
(struct adv_cond): Remove mutex from struct.

5 years agoDaily bump.
GCC Administrator [Sat, 22 Feb 2020 00:18:28 +0000 (00:18 +0000)] 
Daily bump.

5 years agoFix handling of floating-point homogeneous aggregates.
John David Anglin [Fri, 21 Feb 2020 23:34:09 +0000 (23:34 +0000)] 
Fix handling of floating-point homogeneous aggregates.

2020-02-21  John David Anglin  <danglin@gcc.gnu.org>

* gcc/config/pa/pa.c (pa_function_value): Fix check for word and
double-word size when handling aggregate return values.
* gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate
that homogeneous SFmode and DFmode aggregates are passed and returned
in general registers.

5 years agoDaily bump.
GCC Administrator [Fri, 21 Feb 2020 00:18:50 +0000 (00:18 +0000)] 
Daily bump.

5 years agoi386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]
Uros Bizjak [Thu, 20 Feb 2020 20:58:57 +0000 (21:58 +0100)] 
i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]

shufps moves two of the four packed single-precision floating-point values
from *destination* operand (first operand) into the low quadword of the
destination operand.  Match source operand to the destination.

PR target/93828
* config/i386/mmx.md (*vec_extractv2sf_1): Match source operand
to destination operand for shufps alternative.
(*vec_extractv2si_1): Ditto.

5 years agoi386: Skip ENDBR32 at the target function entry
H.J. Lu [Thu, 20 Feb 2020 11:05:27 +0000 (03:05 -0800)] 
i386: Skip ENDBR32 at the target function entry

Skip ENDBR32 at the target function entry when initializing trampoline.

Tested on Linux/x86-64 CET machine with and without -m32.

gcc/

Backport from master
PR target/93656
* config/i386/i386.c (ix86_trampoline_init): Skip ENDBR32 at
the target function entry.

gcc/testsuite/

Backport from master
PR target/93656
* gcc.target/i386/pr93656.c: New test.

(cherry picked from commit 1d69147af203d4dcd2270429f90c93f1a37ddfff)

5 years agoDaily bump.
GCC Administrator [Thu, 20 Feb 2020 00:19:06 +0000 (00:19 +0000)] 
Daily bump.

5 years ago[fortran] xfail no longer necessary in typebound_call_22.f03
Mark Eggleston [Wed, 19 Feb 2020 16:19:54 +0000 (16:19 +0000)] 
[fortran] xfail no longer necessary in typebound_call_22.f03

PR91984 changes resulted in an expected failure. Backport of PR92113
negated the need for the xfail.

gcc/testsuite/ChangeLog

* typebound_call_22.d03 : Remove xfail clause.

5 years ago[Fortran] ICE assign character pointer to non target PR93714
Mark Eggleston [Wed, 19 Feb 2020 09:36:42 +0000 (09:36 +0000)] 
[Fortran] ICE assign character pointer to non target PR93714

An ICE occurred if an attempt was made to assign a pointer to a
character variable that has an length incorrectly specified using
a real constant and does not have the target attribute.

Backported from mainline
2020-02-18  Mark Eggleston  <markeggleston@gcc.gnu.org>

PR fortran/93714
* expr.c (gfc_check_pointer_assign): Move check for
matching character length to after checking the lvalue
attributes for target or pointer.

PR fortran/93714
* gfortran.dg/char_pointer_assign_6.f90: Look for no target
message instead of length mismatch.
* gfortran.dg/pr93714_1.f90
* gfortran.dg/pr93714_2.f90

5 years agoAdd -mavx512vbmi2 to i386-2.C and i386-3.C
liuhongt [Wed, 19 Feb 2020 02:11:32 +0000 (10:11 +0800)] 
Add -mavx512vbmi2 to i386-2.C and i386-3.C

2020-02-18  Hongtao Liu  <hongtao.liu@intel.com>

gcc/testsuite/
* g++.dg/other/i386-2.C: Add -mavx512vbmi2.
* g++.dg/other/i386-3.C: Ditto.

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

5 years agoCheck for bitwise identity when encoding VECTOR_CSTs [PR92768]
Richard Sandiford [Thu, 5 Dec 2019 14:20:38 +0000 (14:20 +0000)] 
Check for bitwise identity when encoding VECTOR_CSTs [PR92768]

This PR shows that we weren't checking for bitwise-identical values
when trying to encode a VECTOR_CST, so -0.0 was treated the same as
0.0 for -fno-signed-zeros.  The patch adds a new OEP flag to select
that behaviour.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2019-12-05  Richard Sandiford  <richard.sandiford@arm.com>

PR middle-end/92768
* tree-core.h (OEP_BITWISE): New flag.
* fold-const.c (operand_compare::operand_equal_p): Handle it.
* tree-vector-builder.h (tree_vector_builder::equal_p): Pass it.

gcc/testsuite/
PR middle-end/92768
* gcc.dg/pr92768.c: New test.

5 years agoReject tail calls that read from an escaped RESULT_DECL [PR90313]
Richard Sandiford [Fri, 9 Aug 2019 09:37:55 +0000 (09:37 +0000)] 
Reject tail calls that read from an escaped RESULT_DECL [PR90313]

In this PR we have two return paths from a function "map".  The common
code sets <result> to the value returned by one path, while the other
path does:

   <retval> = map (&<retval>, ...);

We treated this call as tail recursion, losing the copy semantics
on the value returned by the recursive call.

We'd correctly reject the same thing for variables:

   local = map (&local, ...);

The problem is that RESULT_DECLs didn't get the same treatment.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2019-08-09  Richard Sandiford  <richard.sandiford@arm.com>

PR middle-end/90313
* tree-tailcall.c (find_tail_calls): Reject calls that might
read from an escaped RESULT_DECL.

gcc/testsuite/
PR middle-end/90313
* g++.dg/torture/pr90313.cc: New test.

5 years ago[fortran] ICE in gfc_validate_kind(): Got bad kind [PR93580]
Mark Eggleston [Tue, 18 Feb 2020 10:56:38 +0000 (10:56 +0000)] 
[fortran] ICE in gfc_validate_kind(): Got bad kind [PR93580]

Caused by using invalid part_refs in kind specifications,
e.g. %re or %im on non-complex expressions and %len on
non character expressions.

Check whether %re, %im and %len are valid when checking
kind specification.

The original patch from Steven G. Kargl  <kargl@gcc.gnu.org> only
checked for %re and %im.

Backported from mainline
2020-02-18  Mark Eggleston <markeggleston@gcc.gnu.org>

PR fortran/93580
* primary.c (gfc_match_varspec): If the symbol following %
is re or im and the primary expression type is not BT_COMPLEX
issue an error. If the symbol is len and the primary
expression type is not BT_CHARACTER is an error.

PR fortran/93580
* gfortran.dg/dg/pr93580.f90: New test.

5 years agopredcom: Fix invalid store-store commoning [PR93434]
Richard Sandiford [Mon, 27 Jan 2020 19:37:55 +0000 (19:37 +0000)] 
predcom: Fix invalid store-store commoning [PR93434]

predcom has the following code to stop one rogue load from
interfering with other store-load opportunities:

      /* If A is read and B write or vice versa and there is unsuitable
 dependence, instead of merging both components into a component
 that will certainly not pass suitable_component_p, just put the
 read into bad component, perhaps at least the write together with
 all the other data refs in it's component will be optimizable.  */

But when store-store commoning was added later, this had the effect
of ignoring loads that occur between two candidate stores.

There is code further up to handle loads and stores with unknown
dependences:

      /* Don't do store elimination if there is any unknown dependence for
 any store data reference.  */
      if ((DR_IS_WRITE (dra) || DR_IS_WRITE (drb))
  && (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
      || DDR_NUM_DIST_VECTS (ddr) == 0))
eliminate_store_p = false;

But the store-load code above skips loads for *known* dependences
if (a) the load has already been marked "bad" or (b) the data-ref
machinery knows the dependence distance, but determine_offsets
can't handle the combination.

(a) happens to be the problem in the testcase, but a different
sequence could have given (b) instead.  We have writes to individual
fields of a structure and reads from the whole structure.  Since
determine_offsets requires the types to be the same, it returns false
for each such read/write combination.

This patch records which components have had loads removed and
prevents store-store commoning for them.  It's a bit too pessimistic,
since there shouldn't be a problem if a "bad" load dominates all stores
in a component.  But (a) we can't AFAIK use pcom_stmt_dominates_stmt_p
here and (b) the handling for that case would probably need to be
removed again if we handled more exotic cases in future.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2020-01-28  Richard Sandiford  <richard.sandiford@arm.com>

PR tree-optimization/93434
* tree-predcom.c (split_data_refs_to_components): Record which
components have had aliasing loads removed.  Prevent store-store
commoning for all such components.

gcc/testsuite/
PR tree-optimization/93434
* gcc.c-torture/execute/pr93434.c: New test.

5 years agoDon't pass booleans as mask types to simd clones [PR92710]
Richard Sandiford [Fri, 29 Nov 2019 13:04:56 +0000 (13:04 +0000)] 
Don't pass booleans as mask types to simd clones [PR92710]

In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

PR tree-optimization/92710
* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
vector mask arguments.

gcc/testsuite/
PR tree-optimization/92710
* gcc.dg/vect/pr92710.c: New test.

5 years agoFix SLP downward group access classification [PR92420]
Richard Sandiford [Mon, 11 Nov 2019 19:43:52 +0000 (19:43 +0000)] 
Fix SLP downward group access classification [PR92420]

This PR was caused by the SLP handling in get_group_load_store_type
returning VMAT_CONTIGUOUS rather than VMAT_CONTIGUOUS_REVERSE for
downward groups.

A more elaborate fix would be to try to combine the reverse permutation
into SLP_TREE_LOAD_PERMUTATION for loads, but that's really a follow-on
optimisation and not backport material.  It might also not necessarily
be a win, if the target supports (say) reversing and odd/even swaps
as independent permutes but doesn't recognise the combined form.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2019-11-11  Richard Sandiford  <richard.sandiford@arm.com>

PR tree-optimization/92420
* tree-vect-stmts.c (get_negative_load_store_type): Move further
up file.
(get_group_load_store_type): Use it for reversed SLP accesses.

gcc/testsuite/
PR tree-optimization/92420
* gcc.dg/vect/pr92420.c: New test.

5 years agore PR target/90724 (ICE with __sync_bool_compare_and_swap with -march=armv8.2-a+sve)
Prathamesh Kulkarni [Wed, 21 Aug 2019 18:34:43 +0000 (18:34 +0000)] 
re PR target/90724 (ICE with __sync_bool_compare_and_swap with -march=armv8.2-a+sve)

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
Backport from mainline
2019-08-21  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/90724
* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): Force y
in reg if it fails aarch64_plus_operand predicate.

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

5 years agoAdd Changelog entries to relavent Changelog files for my last commit.
liuhongt [Mon, 17 Feb 2020 00:55:17 +0000 (08:55 +0800)] 
Add Changelog entries to relavent Changelog files for my last commit.

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

5 years agoi386: Fix atan2l argument order [PR93743]
Uros Bizjak [Sun, 16 Feb 2020 22:43:22 +0000 (23:43 +0100)] 
i386: Fix atan2l argument order [PR93743]

PR target/93743
* config/i386/i386.md (atan2xf3): Swap operands 1 and 2.
(atan2<mode>3): Update operand order in the call to gen_atan2xf3.

testsuite/ChangeLog:

PR target/93743
* gcc.target/i386/pr93743.c : New test.

5 years agoDaily bump.
GCC Administrator [Sun, 16 Feb 2020 00:18:33 +0000 (00:18 +0000)] 
Daily bump.

5 years agomatch.pd: Disallow side-effects in GENERIC for non-COND_EXPR to COND_EXPR simplificat...
Jakub Jelinek [Sat, 15 Feb 2020 11:53:44 +0000 (12:53 +0100)] 
match.pd: Disallow side-effects in GENERIC for non-COND_EXPR to COND_EXPR simplifications [PR93744]

As the following testcases show (the first one reported, last two
found by code inspection), we need to disallow side-effects
in simplifications that turn some unconditional expression into conditional
one.  From my little understanding of genmatch.c, it is able to
automatically disallow side effects if the same operand is used multiple
times in the match pattern, maybe if it is used multiple times in the
replacement pattern, and if it is used in conditional contexts in the match
pattern, could it be taught to handle this case too?  If yes, perhaps
just the first hunk could be usable for 8/9 backports (+ the testcases).

2020-02-15  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/93744
* match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0,
A - ((A - B) & -(C cmp D)) -> (C cmp D) ? B : A,
A + ((B - A) & -(C cmp D)) -> (C cmp D) ? B : A): For GENERIC, make
sure @2 in the first and @1 in the other patterns has no side-effects.

* gcc.c-torture/execute/pr93744-1.c: New test.
* gcc.c-torture/execute/pr93744-2.c: New test.
* gcc.c-torture/execute/pr93744-3.c: New test.

5 years agoDaily bump.
GCC Administrator [Sat, 15 Feb 2020 00:19:32 +0000 (00:19 +0000)] 
Daily bump.

5 years agoFix problematic TLS sequences for the Solaris linker
Eric Botcazou [Fri, 14 Feb 2020 18:21:02 +0000 (19:21 +0100)] 
Fix problematic TLS sequences for the Solaris linker

This is an old thinko pertaining to the interaction between TLS
sequences and delay slot filling: the compiler knows that it cannot
put instructions with TLS relocations into delay slots with the
original Sun TLS model, but it tests TARGET_SUN_TLS in this context,
which depends only on the assembler.  So if the compiler is configured
with the GNU assembler and the Solaris linker, then TARGET_GNU_TLS is
set instead and the limitation is not enforced.

PR target/93704
* config/sparc/sparc.c (eligible_for_call_delay): Test HAVE_GNU_LD
in conjunction with TARGET_GNU_TLS in early return.

5 years agoc++: Fix thinko in enum_min_precision [PR61414]
Jakub Jelinek [Fri, 14 Feb 2020 16:36:00 +0000 (17:36 +0100)] 
c++: Fix thinko in enum_min_precision [PR61414]

When backporting the PR61414 fix to 8.4, I've noticed that the caching
of prec is actually broken, as it would fail to actually store the computed
precision into the hash_map's value and so next time we'd think the enum needs
0 bits.

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

PR c++/61414
* class.c (enum_min_precision): Change prec type from int to int &.

* g++.dg/cpp0x/enum39.C: New test.

5 years agosel-sched: allow negative insn priority (PR 88879)
Alexander Monakov [Fri, 14 Feb 2020 13:51:21 +0000 (16:51 +0300)] 
sel-sched: allow negative insn priority (PR 88879)

PR rtl-optimization/88879
* sel-sched.c (sel_target_adjust_priority): Remove assert.

5 years agomiddle-end/90648 fend off builtin calls with not enough arguments from match
Richard Biener [Wed, 5 Feb 2020 13:04:29 +0000 (14:04 +0100)] 
middle-end/90648 fend off builtin calls with not enough arguments from match

This adds guards to genmatch generated code before accessing call
expression or stmt arguments that might be out of bounds when
the user provided bogus prototypes for what we consider builtins.

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

PR middle-end/90648
* genmatch.c (dt_node::gen_kids_1): Emit number of argument
checks before matching calls.

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

5 years agotree-optimization/93381 fix integer offsetting in points-to analysis
Richard Biener [Wed, 22 Jan 2020 11:38:12 +0000 (12:38 +0100)] 
tree-optimization/93381 fix integer offsetting in points-to analysis

We were incorrectly assuming a merge operation is conservative enough
for not explicitely handled operations but we also need to consider
offsetting within fields when field-sensitive analysis applies.

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

PR tree-optimization/93381
* tree-ssa-structalias.c (find_func_aliases): Assume offsetting
throughout, handle all conversions the same.

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

5 years agotree-optimization/93439 move clique bookkeeping to OMP expansion
Richard Biener [Fri, 14 Feb 2020 08:23:06 +0000 (09:23 +0100)] 
tree-optimization/93439 move clique bookkeeping to OMP expansion

Autopar was doing clique bookkeeping too early when creating destination
functions but then later introducing new cliques via versioning loops.
The following moves the bookkeeping to the actual outlining process.

2020-02-14  Richard Biener  <rguenther@suse.de>

Backport from mainline
2020-01-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/93439
* tree-parloops.c (create_loop_fn): Move clique bookkeeping...
* tree-cfg.c (move_sese_region_to_fn): ... here.
(verify_types_in_gimple_reference): Verify used cliques are
tracked.

* gfortran.dg/graphite/pr93439.f90: New testcase.