10.0.1-0.10

This commit is contained in:
Jakub Jelinek 2020-03-25 11:27:42 +01:00
parent fec5ba4393
commit 5ae836ea9d
6 changed files with 89 additions and 507 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/gcc-10.0.1-20200130.tar.xz
/gcc-10.0.1-20200216.tar.xz
/gcc-10.0.1-20200311.tar.xz
/gcc-10.0.1-20200325.tar.xz

View File

@ -1,10 +1,10 @@
%global DATE 20200311
%global gitrev 61bcda69ca5dc9e9d5e25de7b914dd3a86089244
%global DATE 20200325
%global gitrev 17146084e899406b7b39093e945561c737dfe02c
%global gcc_version 10.0.1
%global gcc_major 10
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 0.9
%global gcc_release 0.10
%global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e
%global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0
%global _unpackaged_files_terminate_build 0
@ -264,8 +264,7 @@ Patch8: gcc10-foffload-default.patch
Patch9: gcc10-Wno-format-security.patch
Patch10: gcc10-rh1574936.patch
Patch11: gcc10-d-shared-libphobos.patch
Patch12: gcc10-pr94015.patch
Patch13: gcc10-pr94130.patch
Patch12: gcc10-pr94308.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@ -777,8 +776,7 @@ to NVidia PTX capable devices if available.
%patch10 -p0 -b .rh1574936~
%endif
%patch11 -p0 -b .d-shared-libphobos~
%patch12 -p0 -b .pr94015~
%patch13 -p0 -b .pr94130~
%patch12 -p0 -b .pr94308~
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
@ -3007,6 +3005,36 @@ end
%endif
%changelog
* Wed Mar 25 2020 Jakub Jelinek <jakub@redhat.com> 10.0.1-0.10
- update from trunk
- PRs analyzer/94047, analyzer/94099, analyzer/94105, c++/67960, c++/69694,
c++/90995, c++/91759, c++/91993, c++/92068, c++/92909, c++/93248,
c++/93596, c++/93805, c++/93931, c++/94044, c++/94066, c++/94147,
c++/94175, c++/94186, c++/94190, c++/94197, c++/94223, c/94040,
c/94172, c/94179, c/94239, d/92216, d/92309, d/92792, d/93038,
d/94240, debug/93751, debug/94167, debug/94277, debug/94280,
debug/94283, debug/94285, fortran/93365, fortran/93484, fortran/93600,
gcov-profile/94029, ipa/92372, ipa/92799, ipa/93347, ipa/94202,
ipa/94217, ipa/94232, ipa/94245, ipa/94250, libgomp/81689,
libgomp/94251, libstdc++/93245, libstdc++/94033, libstdc++/94199,
libstdc++/94203, libstdc++/94242, lto/91027, lto/94157, lto/94249,
middle-end/92071, middle-end/93566, middle-end/94072,
middle-end/94120, middle-end/94188, middle-end/94189,
middle-end/94206, middle-end/94216, middle-end/94233,
middle-end/94303, rtl-optimization/90275, rtl-optimization/92303,
rtl-optimization/94042, rtl-optimization/94052,
rtl-optimization/94119, rtl-optimization/94148, target/92379,
target/93694, target/94052, target/94144, target/94154, target/94176,
target/94185, target/94201, target/94238, target/94286,
testsuite/93935, tree-optimization/93435, tree-optimization/94103,
tree-optimization/94125, tree-optimization/94163,
tree-optimization/94166, tree-optimization/94187,
tree-optimization/94211, tree-optimization/94224,
tree-optimization/94261, tree-optimization/94266,
tree-optimization/94300
- fix ICE in final_scan_insn_1 on i686 with vzeroupper (#1816760,
PR target/94308)
* Wed Mar 11 2020 Jakub Jelinek <jakub@redhat.com> 10.0.1-0.9
- update from trunk
- PRs ada/91100, analyzer/93032, analyzer/93388, analyzer/93692,

View File

@ -1,414 +0,0 @@
2020-03-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94015
* tree-ssa-strlen.c (count_nonzero_bytes): Split portions of the
function where EXP is address of the bytes being stored rather than
the bytes themselves into count_nonzero_bytes_addr. Punt on zero
sized MEM_REF. Use VAR_P macro and handle CONST_DECL like VAR_DECLs.
Use ctor_for_folding instead of looking at DECL_INITIAL. Punt before
calling native_encode_expr if host or target doesn't have 8-bit
chars. Formatting fixes.
(count_nonzero_bytes_addr): New function.
* gcc.dg/pr94015.c: New test.
--- gcc/tree-ssa-strlen.c.jj 2020-03-03 07:57:22.324124042 +0100
+++ gcc/tree-ssa-strlen.c 2020-03-03 18:37:29.382722923 +0100
@@ -4585,6 +4585,11 @@ int ssa_name_limit_t::next_ssa_name (tre
return 0;
}
+static bool
+count_nonzero_bytes_addr (tree, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT,
+ unsigned [3], bool *, bool *, bool *,
+ const vr_values *, ssa_name_limit_t &);
+
/* Determines the minimum and maximum number of leading non-zero bytes
in the representation of EXP and set LENRANGE[0] and LENRANGE[1]
to each.
@@ -4607,102 +4612,6 @@ count_nonzero_bytes (tree exp, unsigned
bool *allnul, bool *allnonnul, const vr_values *rvals,
ssa_name_limit_t &snlim)
{
- int idx = get_stridx (exp);
- if (idx > 0)
- {
- strinfo *si = get_strinfo (idx);
- if (!si)
- return false;
-
- /* Handle both constant lengths as well non-constant lengths
- in some range. */
- unsigned HOST_WIDE_INT minlen, maxlen;
- if (tree_fits_shwi_p (si->nonzero_chars))
- minlen = maxlen = tree_to_shwi (si->nonzero_chars);
- else if (nbytes
- && si->nonzero_chars
- && TREE_CODE (si->nonzero_chars) == SSA_NAME)
- {
- const value_range_equiv *vr
- = CONST_CAST (class vr_values *, rvals)
- ->get_value_range (si->nonzero_chars);
- if (vr->kind () != VR_RANGE
- || !range_int_cst_p (vr))
- return false;
-
- minlen = tree_to_uhwi (vr->min ());
- maxlen = tree_to_uhwi (vr->max ());
- }
- else
- return false;
-
- if (maxlen < offset)
- return false;
-
- minlen = minlen < offset ? 0 : minlen - offset;
- maxlen -= offset;
- if (maxlen + 1 < nbytes)
- return false;
-
- if (!nbytes
- && TREE_CODE (si->ptr) == SSA_NAME
- && !POINTER_TYPE_P (TREE_TYPE (si->ptr)))
- {
- /* SI->PTR is an SSA_NAME with a DEF_STMT like
- _1 = MEM <unsigned int> [(char * {ref-all})s_4(D)]; */
- gimple *stmt = SSA_NAME_DEF_STMT (exp);
- if (gimple_assign_single_p (stmt)
- && gimple_assign_rhs_code (stmt) == MEM_REF)
- {
- tree rhs = gimple_assign_rhs1 (stmt);
- if (tree refsize = TYPE_SIZE_UNIT (TREE_TYPE (rhs)))
- if (tree_fits_uhwi_p (refsize))
- {
- nbytes = tree_to_uhwi (refsize);
- maxlen = nbytes;
- }
- }
-
- if (!nbytes)
- return false;
- }
-
- if (nbytes <= minlen)
- *nulterm = false;
-
- if (nbytes < minlen)
- {
- minlen = nbytes;
- if (nbytes < maxlen)
- maxlen = nbytes;
- }
-
- if (minlen < lenrange[0])
- lenrange[0] = minlen;
- if (lenrange[1] < maxlen)
- lenrange[1] = maxlen;
-
- if (lenrange[2] < nbytes)
- lenrange[2] = nbytes;
-
- /* Since only the length of the string are known and not its contents,
- clear ALLNUL and ALLNONNUL purely on the basis of the length. */
- *allnul = false;
- if (minlen < nbytes)
- *allnonnul = false;
-
- return true;
- }
-
- if (TREE_CODE (exp) == ADDR_EXPR)
- {
- /* If the size of the access hasn't been determined yet it's that
- of a pointer. */
- if (!nbytes)
- nbytes = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (exp)));
- exp = TREE_OPERAND (exp, 0);
- }
-
if (TREE_CODE (exp) == SSA_NAME)
{
/* Handle non-zero single-character stores specially. */
@@ -4758,8 +4667,7 @@ count_nonzero_bytes (tree exp, unsigned
tree arg = TREE_OPERAND (exp, 0);
tree off = TREE_OPERAND (exp, 1);
- if (TREE_CODE (off) != INTEGER_CST
- || !tree_fits_uhwi_p (off))
+ if (TREE_CODE (off) != INTEGER_CST || !tree_fits_uhwi_p (off))
return false;
unsigned HOST_WIDE_INT wioff = tree_to_uhwi (off);
@@ -4776,15 +4684,17 @@ count_nonzero_bytes (tree exp, unsigned
if (!typesize || !tree_fits_uhwi_p (typesize))
return false;
nbytes = tree_to_uhwi (typesize);
+ if (!nbytes)
+ return false;
/* Handle MEM_REF = SSA_NAME types of assignments. */
- return count_nonzero_bytes (arg, offset, nbytes, lenrange, nulterm,
- allnul, allnonnul, rvals, snlim);
+ return count_nonzero_bytes_addr (arg, offset, nbytes, lenrange, nulterm,
+ allnul, allnonnul, rvals, snlim);
}
- if (TREE_CODE (exp) == VAR_DECL && TREE_READONLY (exp))
+ if (VAR_P (exp) || TREE_CODE (exp) == CONST_DECL)
{
- exp = DECL_INITIAL (exp);
+ exp = ctor_for_folding (exp);
if (!exp)
return false;
}
@@ -4809,6 +4719,8 @@ count_nonzero_bytes (tree exp, unsigned
unsigned char buf[256];
if (!prep)
{
+ if (CHAR_BIT != 8 || BITS_PER_UNIT != 8)
+ return false;
/* If the pointer to representation hasn't been set above
for STRING_CST point it at the buffer. */
prep = reinterpret_cast <char *>(buf);
@@ -4852,8 +4764,8 @@ count_nonzero_bytes (tree exp, unsigned
if (n)
{
/* When the initial number of non-zero bytes N is non-zero, reset
- *ALLNUL; if N is less than that the size of the representation
- also clear *ALLNONNUL. */
+ *ALLNUL; if N is less than that the size of the representation
+ also clear *ALLNONNUL. */
*allnul = false;
if (n < nbytes)
*allnonnul = false;
@@ -4879,6 +4791,120 @@ count_nonzero_bytes (tree exp, unsigned
return true;
}
+/* Like count_nonzero_bytes, but instead of counting bytes in EXP, count
+ bytes that are pointed to by EXP, which should be a pointer. */
+
+static bool
+count_nonzero_bytes_addr (tree exp, unsigned HOST_WIDE_INT offset,
+ unsigned HOST_WIDE_INT nbytes,
+ unsigned lenrange[3], bool *nulterm,
+ bool *allnul, bool *allnonnul,
+ const vr_values *rvals, ssa_name_limit_t &snlim)
+{
+ int idx = get_stridx (exp);
+ if (idx > 0)
+ {
+ strinfo *si = get_strinfo (idx);
+ if (!si)
+ return false;
+
+ /* Handle both constant lengths as well non-constant lengths
+ in some range. */
+ unsigned HOST_WIDE_INT minlen, maxlen;
+ if (tree_fits_shwi_p (si->nonzero_chars))
+ minlen = maxlen = tree_to_shwi (si->nonzero_chars);
+ else if (si->nonzero_chars
+ && TREE_CODE (si->nonzero_chars) == SSA_NAME)
+ {
+ vr_values *v = CONST_CAST (vr_values *, rvals);
+ const value_range_equiv *vr = v->get_value_range (si->nonzero_chars);
+ if (vr->kind () != VR_RANGE || !range_int_cst_p (vr))
+ return false;
+
+ minlen = tree_to_uhwi (vr->min ());
+ maxlen = tree_to_uhwi (vr->max ());
+ }
+ else
+ return false;
+
+ if (maxlen < offset)
+ return false;
+
+ minlen = minlen < offset ? 0 : minlen - offset;
+ maxlen -= offset;
+ if (maxlen + 1 < nbytes)
+ return false;
+
+ if (nbytes <= minlen)
+ *nulterm = false;
+
+ if (nbytes < minlen)
+ {
+ minlen = nbytes;
+ if (nbytes < maxlen)
+ maxlen = nbytes;
+ }
+
+ if (minlen < lenrange[0])
+ lenrange[0] = minlen;
+ if (lenrange[1] < maxlen)
+ lenrange[1] = maxlen;
+
+ if (lenrange[2] < nbytes)
+ lenrange[2] = nbytes;
+
+ /* Since only the length of the string are known and not its contents,
+ clear ALLNUL and ALLNONNUL purely on the basis of the length. */
+ *allnul = false;
+ if (minlen < nbytes)
+ *allnonnul = false;
+
+ return true;
+ }
+
+ if (TREE_CODE (exp) == ADDR_EXPR)
+ return count_nonzero_bytes (TREE_OPERAND (exp, 0), offset, nbytes,
+ lenrange, nulterm, allnul, allnonnul, rvals,
+ snlim);
+
+ if (TREE_CODE (exp) == SSA_NAME)
+ {
+ gimple *stmt = SSA_NAME_DEF_STMT (exp);
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ {
+ /* Avoid processing an SSA_NAME that has already been visited
+ or if an SSA_NAME limit has been reached. Indicate success
+ if the former and failure if the latter. */
+ if (int res = snlim.next_ssa_name (exp))
+ return res > 0;
+
+ /* Determine the minimum and maximum from the PHI arguments. */
+ unsigned int n = gimple_phi_num_args (stmt);
+ for (unsigned i = 0; i != n; i++)
+ {
+ tree def = gimple_phi_arg_def (stmt, i);
+ if (!count_nonzero_bytes_addr (def, offset, nbytes, lenrange,
+ nulterm, allnul, allnonnul, rvals,
+ snlim))
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ /* Otherwise we don't know anything. */
+ lenrange[0] = 0;
+ if (lenrange[1] < nbytes)
+ lenrange[1] = nbytes;
+ if (lenrange[2] < nbytes)
+ lenrange[2] = nbytes;
+ *nulterm = false;
+ *allnul = false;
+ *allnonnul = false;
+ return true;
+}
+
/* Same as above except with an implicit SSA_NAME limit. RVALS is used
to determine ranges of dynamically computed string lengths (the results
of strlen). */
--- gcc/testsuite/gcc.dg/pr94015.c.jj 2020-03-03 18:04:47.928594261 +0100
+++ gcc/testsuite/gcc.dg/pr94015.c 2020-03-03 18:04:34.345794259 +0100
@@ -0,0 +1,107 @@
+/* PR tree-optimization/94015 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+char buf[10] = "AAAAAAAAA";
+
+__attribute__((noipa)) char *
+alloc (void)
+{
+ return buf;
+}
+
+__attribute__((noipa)) void
+f1 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "1234567";
+ s[7] = '\0';
+}
+
+__attribute__((noipa)) void
+f2 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "123456";
+ s[6] = '\0';
+}
+
+__attribute__((noipa)) void
+f3 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "12345";
+ s[5] = '\0';
+}
+
+__attribute__((noipa)) void
+f4 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "1234";
+ s[4] = '\0';
+}
+
+__attribute__((noipa)) void
+f5 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "123";
+ s[3] = '\0';
+}
+
+__attribute__((noipa)) void
+f6 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "12";
+ s[2] = '\0';
+}
+
+__attribute__((noipa)) void
+f7 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "1";
+ s[1] = '\0';
+}
+
+__attribute__((noipa)) void
+f8 (void)
+{
+ char *s = alloc ();
+ *(char **)s = "";
+ s[0] = '\0';
+}
+
+int
+main ()
+{
+ if (sizeof (char *) > 8)
+ return 0;
+ f1 ();
+ if (buf[7] != 0)
+ __builtin_abort ();
+ f2 ();
+ if (buf[6] != 0)
+ __builtin_abort ();
+ f3 ();
+ if (buf[5] != 0)
+ __builtin_abort ();
+ f4 ();
+ if (buf[4] != 0)
+ __builtin_abort ();
+ f5 ();
+ if (buf[3] != 0)
+ __builtin_abort ();
+ f6 ();
+ if (buf[2] != 0)
+ __builtin_abort ();
+ f7 ();
+ if (buf[1] != 0)
+ __builtin_abort ();
+ f8 ();
+ if (buf[0] != 0)
+ __builtin_abort ();
+ return 0;
+}

View File

@ -1,85 +0,0 @@
2020-03-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94130
* tree-ssa-dse.c: Include gimplify.h.
(increment_start_addr): If stmt has lhs, drop the lhs from call and
set it after the call to the original value of the first argument.
Formatting fixes.
(decrement_count): Formatting fix.
* gcc.c-torture/execute/pr94130.c: New test.
--- gcc/tree-ssa-dse.c.jj 2020-03-03 11:04:46.367821907 +0100
+++ gcc/tree-ssa-dse.c 2020-03-11 13:57:38.671845186 +0100
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3.
#include "tree-ssa-dse.h"
#include "builtins.h"
#include "gimple-fold.h"
+#include "gimplify.h"
/* This file implements dead store elimination.
@@ -422,29 +423,38 @@ decrement_count (gimple *stmt, int decre
gcc_assert (TREE_CODE (*countp) == INTEGER_CST);
*countp = wide_int_to_tree (TREE_TYPE (*countp), (TREE_INT_CST_LOW (*countp)
- decrement));
-
}
static void
increment_start_addr (gimple *stmt, tree *where, int increment)
{
+ if (tree lhs = gimple_call_lhs (stmt))
+ if (where == gimple_call_arg_ptr (stmt, 0))
+ {
+ gassign *newop = gimple_build_assign (lhs, unshare_expr (*where));
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ gsi_insert_after (&gsi, newop, GSI_SAME_STMT);
+ gimple_call_set_lhs (stmt, NULL_TREE);
+ update_stmt (stmt);
+ }
+
if (TREE_CODE (*where) == SSA_NAME)
{
tree tem = make_ssa_name (TREE_TYPE (*where));
gassign *newop
- = gimple_build_assign (tem, POINTER_PLUS_EXPR, *where,
+ = gimple_build_assign (tem, POINTER_PLUS_EXPR, *where,
build_int_cst (sizetype, increment));
gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
gsi_insert_before (&gsi, newop, GSI_SAME_STMT);
*where = tem;
- update_stmt (gsi_stmt (gsi));
+ update_stmt (stmt);
return;
}
*where = build_fold_addr_expr (fold_build2 (MEM_REF, char_type_node,
- *where,
- build_int_cst (ptr_type_node,
- increment)));
+ *where,
+ build_int_cst (ptr_type_node,
+ increment)));
}
/* STMT is builtin call that writes bytes in bitmap ORIG, some bytes are dead
--- gcc/testsuite/gcc.c-torture/execute/pr94130.c.jj 2020-03-11 14:01:49.431180291 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr94130.c 2020-03-11 14:01:37.654352419 +0100
@@ -0,0 +1,16 @@
+/* PR tree-optimization/94130 */
+
+int
+main ()
+{
+ int a[8];
+ char *b = __builtin_memset (a, 0, sizeof (a));
+ a[0] = 1;
+ a[1] = 2;
+ a[2] = 3;
+ if (b != (char *) a)
+ __builtin_abort ();
+ else
+ asm volatile ("" : : "g" (a) : "memory");
+ return 0;
+}

52
gcc10-pr94308.patch Normal file
View File

@ -0,0 +1,52 @@
2020-03-25 Jakub Jelinek <jakub@redhat.com>
PR target/94308
* config/i386/i386-features.c (ix86_add_reg_usage_to_vzeroupper): Set
INSN_CODE (insn) to -1 when changing the pattern.
* gcc.target/i386/pr94308.c: New test.
--- gcc/config/i386/i386-features.c.jj 2020-03-17 13:50:52.955933209 +0100
+++ gcc/config/i386/i386-features.c 2020-03-24 19:19:17.801609289 +0100
@@ -1792,6 +1792,7 @@ ix86_add_reg_usage_to_vzeroupper (rtx_in
RTVEC_ELT (vec, j) = gen_rtx_SET (reg, reg);
}
XVEC (pattern, 0) = vec;
+ INSN_CODE (insn) = -1;
df_insn_rescan (insn);
}
--- gcc/testsuite/gcc.target/i386/pr94308.c.jj 2020-03-24 19:32:51.964436310 +0100
+++ gcc/testsuite/gcc.target/i386/pr94308.c 2020-03-24 19:32:39.848617482 +0100
@@ -0,0 +1,31 @@
+/* PR target/94308 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mfpmath=sse -mavx2 -mfma" } */
+
+#include <x86intrin.h>
+
+void
+foo (float *x, const float *y, const float *z, unsigned int w)
+{
+ unsigned int a;
+ const unsigned int b = w / 8;
+ const float *c = y;
+ const float *d = z;
+ __m256 e = _mm256_setzero_ps ();
+ __m256 f, g;
+ for (a = 0; a < b; a++)
+ {
+ f = _mm256_loadu_ps (c);
+ g = _mm256_loadu_ps (d);
+ c += 8;
+ d += 8;
+ e = _mm256_fmadd_ps (f, g, e);
+ }
+ __attribute__ ((aligned (32))) float h[8];
+ _mm256_storeu_ps (h, e);
+ _mm256_zeroupper ();
+ float i = h[0] + h[1] + h[2] + h[3] + h[4] + h[5] + h[6] + h[7];
+ for (a = b * 8; a < w; a++)
+ i += (*c++) * (*d++);
+ *x = i;
+}

View File

@ -1,3 +1,3 @@
SHA512 (gcc-10.0.1-20200311.tar.xz) = b2b730beaf28b75409d4cef72fd9cae20b910442b8b8d4d91911a80bed6e2a63228f08bb31b783f58e31e714be3f3a9f6ceded1f351b4fdded1671e1468eaca7
SHA512 (gcc-10.0.1-20200325.tar.xz) = 5431edeeb9ef900ce49e4fa13869c63d84c244f846be96f1e782249b0a4ac3c6d5ce73117bd3fb1d2d786e82d394ec0a5ea5cc4615f8cc61d7f6aa43db6a8ce9
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 9ceea0b883185fe489724d54a7e909bb6ed4785fcadf80162033dc6a133e2657337175601278e4155d1f8fac275ff9c8a02572aea876166c608774c809f832e9
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7