!58 Fix compilation error when building vsftpd and sleef
From: @eastb233 Reviewed-by: @jdkboy Signed-off-by: @jdkboy,@jdkboy
This commit is contained in:
commit
6060cd83f7
122
Handle-POLY_INT_CST-in-copy_reference_ops_from_ref.patch
Normal file
122
Handle-POLY_INT_CST-in-copy_reference_ops_from_ref.patch
Normal file
@ -0,0 +1,122 @@
|
||||
This backport contains 1 patch from gcc main stream tree.
|
||||
The commit id of these patchs list as following in the order of time.
|
||||
|
||||
0001-Handle-POLY_INT_CST-in-copy_reference_ops_from_ref.patch
|
||||
74266b00112a85660b1e9f6e546f0a2c007dd062
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c
|
||||
new file mode 100644
|
||||
index 00000000000..08902983199
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+#include <arm_sve.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+inline void
|
||||
+copy (void *dst, svbool_t src)
|
||||
+{
|
||||
+ memcpy (dst, &src, svcntd ());
|
||||
+}
|
||||
+
|
||||
+uint64_t
|
||||
+f (int32_t *x, int32_t *y)
|
||||
+{
|
||||
+ union { uint64_t x; char c[8]; } u;
|
||||
+ svbool_t pg = svptrue_b32 ();
|
||||
+ copy (u.c, svcmpeq (pg, svld1 (pg, x), 0));
|
||||
+ copy (u.c + 4, svcmpeq (pg, svld1 (pg, y), 1));
|
||||
+ return u.x;
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilele_8.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilele_8.c
|
||||
new file mode 100644
|
||||
index 00000000000..c7b6663eff2
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilele_8.c
|
||||
@@ -0,0 +1,33 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+#include <arm_sve.h>
|
||||
+
|
||||
+/* { dg-final { scan-assembler-not {\tptrue\t} } } */
|
||||
+/* { dg-final { scan-assembler-not {\tpfalse\t} } } */
|
||||
+
|
||||
+void
|
||||
+test1 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilele_b32_s32 (-4, 0);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test2 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilele_b16_s64 (svcntb (), svcntb () + 8);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test3 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilele_b64_s32 (0, 2);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test4 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilele_b8_s64 (16, svcntb ());
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times {\twhilel[et]\t} 4 } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilelt_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilelt_4.c
|
||||
new file mode 100644
|
||||
index 00000000000..849cd45c67e
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilelt_4.c
|
||||
@@ -0,0 +1,33 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+#include <arm_sve.h>
|
||||
+
|
||||
+/* { dg-final { scan-assembler-not {\tptrue\t} } } */
|
||||
+/* { dg-final { scan-assembler-not {\tpfalse\t} } } */
|
||||
+
|
||||
+void
|
||||
+test1 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilelt_b32_s32 (-4, 1);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test2 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilelt_b16_s64 (svcntb (), svcntb () + 9);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test3 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilelt_b64_s32 (0, 3);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+test4 (svbool_t *ptr)
|
||||
+{
|
||||
+ *ptr = svwhilelt_b8_s64 (16, svcntb ());
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times {\twhilel[et]\t} 4 } } */
|
||||
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
|
||||
index 7465bedb349..f58dbe15047 100644
|
||||
--- a/gcc/tree-ssa-sccvn.c
|
||||
+++ b/gcc/tree-ssa-sccvn.c
|
||||
@@ -928,6 +928,7 @@ copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
|
||||
break;
|
||||
case STRING_CST:
|
||||
case INTEGER_CST:
|
||||
+ case POLY_INT_CST:
|
||||
case COMPLEX_CST:
|
||||
case VECTOR_CST:
|
||||
case REAL_CST:
|
||||
40
Handle-POLY_INT_CSTs-in-declare_return_value.patch
Normal file
40
Handle-POLY_INT_CSTs-in-declare_return_value.patch
Normal file
@ -0,0 +1,40 @@
|
||||
This backport contains 1 patch from gcc main stream tree.
|
||||
The commit id of these patchs list as following in the order of time.
|
||||
|
||||
0001-Handle-POLY_INT_CSTs-in-declare_return_value.patch
|
||||
be5f7eccf766a4c3a59b821f77ce320001df838f
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/inline_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/inline_1.c
|
||||
new file mode 100644
|
||||
index 00000000000..f736ac3f082
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/inline_1.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+/* { dg-options "-O2" } */
|
||||
+
|
||||
+#pragma GCC aarch64 "arm_sve.h"
|
||||
+
|
||||
+static inline svint32_t foo () { return svdup_s32 (32); }
|
||||
+svint32_t bar () { return svadd_x (svptrue_b8 (), foo (), 1); }
|
||||
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
|
||||
index 2b8b9ee58c1..9d0acd97f77 100644
|
||||
--- a/gcc/tree-inline.c
|
||||
+++ b/gcc/tree-inline.c
|
||||
@@ -3654,7 +3654,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
||||
/* ??? If we're assigning to a variable sized type, then we must
|
||||
reuse the destination variable, because we've no good way to
|
||||
create variable sized temporaries at this point. */
|
||||
- else if (TREE_CODE (TYPE_SIZE_UNIT (caller_type)) != INTEGER_CST)
|
||||
+ else if (!poly_int_tree_p (TYPE_SIZE_UNIT (caller_type)))
|
||||
use_it = true;
|
||||
|
||||
/* If the callee cannot possibly modify MODIFY_DEST, then we can
|
||||
@@ -3689,7 +3689,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
||||
}
|
||||
}
|
||||
|
||||
- gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
|
||||
+ gcc_assert (poly_int_tree_p (TYPE_SIZE_UNIT (callee_type)));
|
||||
|
||||
var = copy_result_decl_to_var (result, id);
|
||||
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
|
||||
371
fix-strncpy-inline-warning.patch
Normal file
371
fix-strncpy-inline-warning.patch
Normal file
@ -0,0 +1,371 @@
|
||||
This backport contains 3 patchs from gcc main stream tree.
|
||||
The commit id of these patchs list as following in the order of time.
|
||||
|
||||
0001-tree-ssa-dse.c-initialize_ao_ref_for_dse-Handle-_chk.patch
|
||||
4a61cf9c62212fd04f21704efc2decffe9544651
|
||||
|
||||
0002-tree-ssa-dse.c-initialize_ao_ref_for_dse-Fix-formatt.patch
|
||||
caffb6e56c2914e64e65f3c336b770c178f265a3
|
||||
|
||||
0003-tree-ssa-dse.c-initialize_ao_ref_for_dse-Handle-strn.patch
|
||||
192ece9e15d25fd9b6534b2a8bd271684bf76d38
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
|
||||
index 3560a1ff2..e9d3c9aab 100644
|
||||
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
|
||||
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
|
||||
@@ -37,7 +37,7 @@ load_lib c-torture.exp
|
||||
torture-init
|
||||
set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
|
||||
|
||||
-set additional_flags "-fno-tree-loop-distribute-patterns -fno-tracer -fno-ipa-ra -fno-inline-functions"
|
||||
+set additional_flags "-fno-tree-dse -fno-tree-loop-distribute-patterns -fno-tracer -fno-ipa-ra -fno-inline-functions"
|
||||
if [istarget "powerpc-*-darwin*"] {
|
||||
lappend additional_flags "-Wl,-multiply_defined,suppress"
|
||||
}
|
||||
diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c
|
||||
index afd07ddd0..40cfa0472 100644
|
||||
--- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c
|
||||
+++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test whether buffer overflow warnings for __*_chk builtins
|
||||
are emitted properly. */
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -Wno-format -std=gnu99 -ftrack-macro-expansion=0" } */
|
||||
+/* { dg-options "-O2 -Wno-format -std=gnu99 -ftrack-macro-expansion=0 -fno-tree-dse" } */
|
||||
// { dg-skip-if "packed attribute missing for t" { "epiphany-*-*" } }
|
||||
|
||||
extern void abort (void);
|
||||
diff --git a/gcc/testsuite/gcc.dg/memcpy-2.c b/gcc/testsuite/gcc.dg/memcpy-2.c
|
||||
index 7f839d27a..6ad887416 100644
|
||||
--- a/gcc/testsuite/gcc.dg/memcpy-2.c
|
||||
+++ b/gcc/testsuite/gcc.dg/memcpy-2.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* PR middle-end/38454 */
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2" } */
|
||||
+/* { dg-options "-O2 -fno-tree-dse" } */
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.dg/pr40340-1.c b/gcc/testsuite/gcc.dg/pr40340-1.c
|
||||
index 8fbb206a2..6307e064c 100644
|
||||
--- a/gcc/testsuite/gcc.dg/pr40340-1.c
|
||||
+++ b/gcc/testsuite/gcc.dg/pr40340-1.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* PR middle-end/40340 */
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -Wall -Wno-system-headers" } */
|
||||
+/* { dg-options "-O2 -Wall -Wno-system-headers -fno-tree-dse" } */
|
||||
|
||||
#include "pr40340.h"
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.dg/pr40340-2.c b/gcc/testsuite/gcc.dg/pr40340-2.c
|
||||
index 10083acd1..ea76e1008 100644
|
||||
--- a/gcc/testsuite/gcc.dg/pr40340-2.c
|
||||
+++ b/gcc/testsuite/gcc.dg/pr40340-2.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* PR middle-end/40340 */
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -Wall -Wno-system-headers" } */
|
||||
+/* { dg-options "-O2 -Wall -Wno-system-headers -fno-tree-dse" } */
|
||||
|
||||
#include "pr40340.h"
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.dg/pr40340-5.c b/gcc/testsuite/gcc.dg/pr40340-5.c
|
||||
index 0e48a2ca9..99e58f2ab 100644
|
||||
--- a/gcc/testsuite/gcc.dg/pr40340-5.c
|
||||
+++ b/gcc/testsuite/gcc.dg/pr40340-5.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* PR middle-end/40340 */
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -Wall -Wsystem-headers -g" } */
|
||||
+/* { dg-options "-O2 -Wall -Wsystem-headers -g -fno-tree-dse" } */
|
||||
|
||||
#define TEST3
|
||||
#include "pr40340.h"
|
||||
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-37.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-37.c
|
||||
new file mode 100644
|
||||
index 000000000..56251fc34
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-37.c
|
||||
@@ -0,0 +1,60 @@
|
||||
+/* { dg-options "-O2 -fdump-tree-dse-details -fno-tree-fre" } */
|
||||
+
|
||||
+
|
||||
+#ifndef SCOPE
|
||||
+#define SCOPE
|
||||
+#endif
|
||||
+
|
||||
+extern void frob (char *);
|
||||
+
|
||||
+void g (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_strncpy (a, s, sizeof a);
|
||||
+ __builtin_memset (a, 0, sizeof a);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+void h (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_memset (a, 0, sizeof a);
|
||||
+ __builtin_strncpy (a, s, sizeof a);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+void i (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_strncpy (a, s, sizeof a);
|
||||
+ __builtin_memset (a, 0, sizeof a - 5);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+void j (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_memset (a, 0, sizeof a);
|
||||
+ __builtin_strncpy (a, s, sizeof a - 5);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+void l (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_strncpy (a, s, sizeof a);
|
||||
+ __builtin_memset (a + 2, 0, sizeof a - 2);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+void m (char *s)
|
||||
+{
|
||||
+ SCOPE char a[8];
|
||||
+ __builtin_memset (a, 0, sizeof a);
|
||||
+ __builtin_strncpy (a + 2, s, sizeof a - 2);
|
||||
+ frob (a);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-tree-dump-times "Deleted dead call" 2 "dse1" } } */
|
||||
+/* { dg-final { scan-tree-dump-times "Trimming statement " 4 "dse1" } } */
|
||||
+
|
||||
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-38.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-38.c
|
||||
new file mode 100644
|
||||
index 000000000..7ae33bfd1
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-38.c
|
||||
@@ -0,0 +1,12 @@
|
||||
+/* { dg-options "-O2 -fdump-tree-dse-details -fno-tree-fre" } */
|
||||
+
|
||||
+
|
||||
+/* This changes the scope of the destination object and exposes
|
||||
+ missed optimizations in DSE. */
|
||||
+#define SCOPE extern
|
||||
+#include "ssa-dse-37.c"
|
||||
+
|
||||
+/* { dg-final { scan-tree-dump-times "Deleted dead call" 2 "dse1" { xfail *-*-* } } } */
|
||||
+/* { dg-final { scan-tree-dump-times "Trimming statement " 4 "dse1" { xfail *-*-* } } } */
|
||||
+
|
||||
+
|
||||
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
|
||||
index 2fb471b69..b593b0d81 100644
|
||||
--- a/gcc/tree-ssa-dse.c
|
||||
+++ b/gcc/tree-ssa-dse.c
|
||||
@@ -100,39 +100,42 @@ initialize_ao_ref_for_dse (gimple *stmt, ao_ref *write)
|
||||
{
|
||||
switch (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)))
|
||||
{
|
||||
- case BUILT_IN_MEMCPY:
|
||||
- case BUILT_IN_MEMMOVE:
|
||||
- case BUILT_IN_MEMSET:
|
||||
- {
|
||||
- tree size = NULL_TREE;
|
||||
- if (gimple_call_num_args (stmt) == 3)
|
||||
- size = gimple_call_arg (stmt, 2);
|
||||
- tree ptr = gimple_call_arg (stmt, 0);
|
||||
- ao_ref_init_from_ptr_and_size (write, ptr, size);
|
||||
- return true;
|
||||
- }
|
||||
+ case BUILT_IN_MEMCPY:
|
||||
+ case BUILT_IN_MEMMOVE:
|
||||
+ case BUILT_IN_MEMSET:
|
||||
+ case BUILT_IN_MEMCPY_CHK:
|
||||
+ case BUILT_IN_MEMMOVE_CHK:
|
||||
+ case BUILT_IN_MEMSET_CHK:
|
||||
+ case BUILT_IN_STRNCPY:
|
||||
+ case BUILT_IN_STRNCPY_CHK:
|
||||
+ {
|
||||
+ tree size = gimple_call_arg (stmt, 2);
|
||||
+ tree ptr = gimple_call_arg (stmt, 0);
|
||||
+ ao_ref_init_from_ptr_and_size (write, ptr, size);
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
- /* A calloc call can never be dead, but it can make
|
||||
- subsequent stores redundant if they store 0 into
|
||||
- the same memory locations. */
|
||||
- case BUILT_IN_CALLOC:
|
||||
- {
|
||||
- tree nelem = gimple_call_arg (stmt, 0);
|
||||
- tree selem = gimple_call_arg (stmt, 1);
|
||||
- tree lhs;
|
||||
- if (TREE_CODE (nelem) == INTEGER_CST
|
||||
- && TREE_CODE (selem) == INTEGER_CST
|
||||
- && (lhs = gimple_call_lhs (stmt)) != NULL_TREE)
|
||||
- {
|
||||
- tree size = fold_build2 (MULT_EXPR, TREE_TYPE (nelem),
|
||||
- nelem, selem);
|
||||
- ao_ref_init_from_ptr_and_size (write, lhs, size);
|
||||
- return true;
|
||||
- }
|
||||
- }
|
||||
+ /* A calloc call can never be dead, but it can make
|
||||
+ subsequent stores redundant if they store 0 into
|
||||
+ the same memory locations. */
|
||||
+ case BUILT_IN_CALLOC:
|
||||
+ {
|
||||
+ tree nelem = gimple_call_arg (stmt, 0);
|
||||
+ tree selem = gimple_call_arg (stmt, 1);
|
||||
+ tree lhs;
|
||||
+ if (TREE_CODE (nelem) == INTEGER_CST
|
||||
+ && TREE_CODE (selem) == INTEGER_CST
|
||||
+ && (lhs = gimple_call_lhs (stmt)) != NULL_TREE)
|
||||
+ {
|
||||
+ tree size = fold_build2 (MULT_EXPR, TREE_TYPE (nelem),
|
||||
+ nelem, selem);
|
||||
+ ao_ref_init_from_ptr_and_size (write, lhs, size);
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- default:
|
||||
- break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
else if (is_gimple_assign (stmt))
|
||||
@@ -459,6 +462,10 @@ maybe_trim_memstar_call (ao_ref *ref, sbitmap live, gimple *stmt)
|
||||
{
|
||||
case BUILT_IN_MEMCPY:
|
||||
case BUILT_IN_MEMMOVE:
|
||||
+ case BUILT_IN_STRNCPY:
|
||||
+ case BUILT_IN_MEMCPY_CHK:
|
||||
+ case BUILT_IN_MEMMOVE_CHK:
|
||||
+ case BUILT_IN_STRNCPY_CHK:
|
||||
{
|
||||
int head_trim, tail_trim;
|
||||
compute_trims (ref, live, &head_trim, &tail_trim, stmt);
|
||||
@@ -480,6 +487,7 @@ maybe_trim_memstar_call (ao_ref *ref, sbitmap live, gimple *stmt)
|
||||
}
|
||||
|
||||
case BUILT_IN_MEMSET:
|
||||
+ case BUILT_IN_MEMSET_CHK:
|
||||
{
|
||||
int head_trim, tail_trim;
|
||||
compute_trims (ref, live, &head_trim, &tail_trim, stmt);
|
||||
@@ -956,54 +964,60 @@ dse_dom_walker::dse_optimize_stmt (gimple_stmt_iterator *gsi)
|
||||
tree fndecl = gimple_call_fndecl (stmt);
|
||||
switch (DECL_FUNCTION_CODE (fndecl))
|
||||
{
|
||||
- case BUILT_IN_MEMCPY:
|
||||
- case BUILT_IN_MEMMOVE:
|
||||
- case BUILT_IN_MEMSET:
|
||||
- {
|
||||
- /* Occasionally calls with an explicit length of zero
|
||||
- show up in the IL. It's pointless to do analysis
|
||||
- on them, they're trivially dead. */
|
||||
- tree size = gimple_call_arg (stmt, 2);
|
||||
- if (integer_zerop (size))
|
||||
- {
|
||||
- delete_dead_or_redundant_call (gsi, "dead");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* If this is a memset call that initializes an object
|
||||
- to zero, it may be redundant with an earlier memset
|
||||
- or empty CONSTRUCTOR of a larger object. */
|
||||
- if ((DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET
|
||||
- || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET_CHK)
|
||||
- && integer_zerop (gimple_call_arg (stmt, 1)))
|
||||
- dse_optimize_redundant_stores (stmt);
|
||||
-
|
||||
- enum dse_store_status store_status;
|
||||
- m_byte_tracking_enabled
|
||||
- = setup_live_bytes_from_ref (&ref, m_live_bytes);
|
||||
- store_status = dse_classify_store (&ref, stmt,
|
||||
- m_byte_tracking_enabled,
|
||||
- m_live_bytes);
|
||||
- if (store_status == DSE_STORE_LIVE)
|
||||
- return;
|
||||
-
|
||||
- if (store_status == DSE_STORE_MAYBE_PARTIAL_DEAD)
|
||||
- {
|
||||
- maybe_trim_memstar_call (&ref, m_live_bytes, stmt);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (store_status == DSE_STORE_DEAD)
|
||||
+ case BUILT_IN_MEMCPY:
|
||||
+ case BUILT_IN_MEMMOVE:
|
||||
+ case BUILT_IN_STRNCPY:
|
||||
+ case BUILT_IN_MEMSET:
|
||||
+ case BUILT_IN_MEMCPY_CHK:
|
||||
+ case BUILT_IN_MEMMOVE_CHK:
|
||||
+ case BUILT_IN_STRNCPY_CHK:
|
||||
+ case BUILT_IN_MEMSET_CHK:
|
||||
+ {
|
||||
+ /* Occasionally calls with an explicit length of zero
|
||||
+ show up in the IL. It's pointless to do analysis
|
||||
+ on them, they're trivially dead. */
|
||||
+ tree size = gimple_call_arg (stmt, 2);
|
||||
+ if (integer_zerop (size))
|
||||
+ {
|
||||
delete_dead_or_redundant_call (gsi, "dead");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* If this is a memset call that initializes an object
|
||||
+ to zero, it may be redundant with an earlier memset
|
||||
+ or empty CONSTRUCTOR of a larger object. */
|
||||
+ if ((DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET
|
||||
+ || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET_CHK)
|
||||
+ && integer_zerop (gimple_call_arg (stmt, 1)))
|
||||
+ dse_optimize_redundant_stores (stmt);
|
||||
+
|
||||
+ enum dse_store_status store_status;
|
||||
+ m_byte_tracking_enabled
|
||||
+ = setup_live_bytes_from_ref (&ref, m_live_bytes);
|
||||
+ store_status = dse_classify_store (&ref, stmt,
|
||||
+ m_byte_tracking_enabled,
|
||||
+ m_live_bytes);
|
||||
+ if (store_status == DSE_STORE_LIVE)
|
||||
return;
|
||||
- }
|
||||
|
||||
- case BUILT_IN_CALLOC:
|
||||
- /* We already know the arguments are integer constants. */
|
||||
- dse_optimize_redundant_stores (stmt);
|
||||
+ if (store_status == DSE_STORE_MAYBE_PARTIAL_DEAD)
|
||||
+ {
|
||||
+ maybe_trim_memstar_call (&ref, m_live_bytes, stmt);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- default:
|
||||
+ if (store_status == DSE_STORE_DEAD)
|
||||
+ delete_dead_or_redundant_call (gsi, "dead");
|
||||
return;
|
||||
+ }
|
||||
+
|
||||
+ case BUILT_IN_CALLOC:
|
||||
+ /* We already know the arguments are integer constants. */
|
||||
+ dse_optimize_redundant_stores (stmt);
|
||||
+ return;
|
||||
+
|
||||
+ default:
|
||||
+ return;
|
||||
}
|
||||
}
|
||||
|
||||
15
gcc.spec
15
gcc.spec
@ -1,4 +1,4 @@
|
||||
%global DATE 20210115
|
||||
%global DATE 20210204
|
||||
|
||||
%global gcc_version 9.3.1
|
||||
%global gcc_major 9.3.1
|
||||
@ -59,7 +59,7 @@
|
||||
Summary: Various compilers (C, C++, Objective-C, ...)
|
||||
Name: gcc
|
||||
Version: %{gcc_version}
|
||||
Release: %{DATE}.15
|
||||
Release: %{DATE}.16
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||
URL: https://gcc.gnu.org
|
||||
|
||||
@ -221,6 +221,9 @@ Patch104: fix-avx512vl-vcvttpd2dq-2-fail.patch
|
||||
Patch105: fix-issue604-ldist-dependency-fixup.patch
|
||||
Patch106: Apply-maximum-nunits-for-BB-SLP.patch
|
||||
Patch107: Fix-interaction-between-aka-changes-and-DR1558.patch
|
||||
Patch108: Handle-POLY_INT_CSTs-in-declare_return_value.patch
|
||||
Patch109: Handle-POLY_INT_CST-in-copy_reference_ops_from_ref.patch
|
||||
Patch110: fix-strncpy-inline-warning.patch
|
||||
|
||||
|
||||
%global gcc_target_platform %{_arch}-linux-gnu
|
||||
@ -771,6 +774,9 @@ not stable, so plugins must be rebuilt any time GCC is updated.
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
%patch107 -p1
|
||||
%patch108 -p1
|
||||
%patch109 -p1
|
||||
%patch110 -p1
|
||||
|
||||
|
||||
%build
|
||||
@ -2702,6 +2708,11 @@ end
|
||||
%doc rpm.doc/changelogs/libcc1/ChangeLog*
|
||||
|
||||
%changelog
|
||||
* Thu Feb 04 2021 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20210204.16
|
||||
- Handle-POLY_INT_CSTs-in-declare_return_value.patch: New file
|
||||
- Handle-POLY_INT_CST-in-copy_reference_ops_from_ref.patch: New file
|
||||
- fix-strncpy-inline-warning.patch: New file
|
||||
|
||||
* Fri Jan 15 2021 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20210115.15
|
||||
- Fix-interaction-between-aka-changes-and-DR1558.patch: New file
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user