[gcc-7] 307/354: * Update to SVN 20170927 (r253234) from the gcc-7-branch.
Ximin Luo
infinity0 at debian.org
Thu Nov 23 15:51:27 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository gcc-7.
commit 1e36ea24da8b3d428375c351f45425f290d1b08c
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Wed Sep 27 16:15:35 2017 +0000
* Update to SVN 20170927 (r253234) from the gcc-7-branch.
git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9717 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 4 +
debian/patches/svn-updates.diff | 648 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 646 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index a4fe54f..d030dab 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
gcc-7 (7.2.0-8) UNRELEASED; urgency=medium
+ * Update to SVN 20170927 (r253234) from the gcc-7-branch.
+ - Fix PR tree-optimization/82244, PR tree-optimization/82276,
+ PR tree-optimization/82264, PR tree-optimization/82285,
+ PR tree-optimization/82291.
* Fix "privacy breeches" for NEWS.html file.
* Build lsan and tsan packages on arm64, ppc64 and ppc64el.
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index cc7f835..2bddd3a 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20170923 (r253114).
+# DP: updates from the 7 branch upto 20170927 (r253234).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Sat Sep 23 11:21:54 CEST 2017
-Sat Sep 23 09:21:54 UTC 2017 (revision 253114)
+Wed Sep 27 18:06:00 CEST 2017
+Wed Sep 27 16:06:00 UTC 2017 (revision 253234)
EOF
}
@@ -6235,6 +6235,55 @@ Index: libstdc++-v3/config/io/basic_file_stdio.cc
if (!__err)
{
_M_cfile = __file;
+Index: gcc/is-a.h
+===================================================================
+--- a/src/gcc/is-a.h (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/is-a.h (.../branches/gcc-7-branch)
+@@ -103,7 +103,12 @@
+ Note that we have converted two sets of assertions in the calls to varpool
+ into safe and efficient use of a variable.
+
++TYPE safe_dyn_cast <TYPE> (pointer)
+
++ Like dyn_cast <TYPE> (pointer), except that it accepts null pointers
++ and returns null results for them.
++
++
+ If you use these functions and get a 'inline function not defined' or a
+ 'missing symbol' error message for 'is_a_helper<....>::test', it means that
+ the connection between the types has not been made. See below.
+@@ -222,4 +227,13 @@
+ return static_cast <T> (0);
+ }
+
++/* Similar to dyn_cast, except that the pointer may be null. */
++
++template <typename T, typename U>
++inline T
++safe_dyn_cast (U *p)
++{
++ return p ? dyn_cast <T> (p) : 0;
++}
++
+ #endif /* GCC_IS_A_H */
+Index: gcc/tree-vrp.c
+===================================================================
+--- a/src/gcc/tree-vrp.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/tree-vrp.c (.../branches/gcc-7-branch)
+@@ -4897,7 +4897,12 @@
+ operand of the ASSERT_EXPR. Create it so the new name and the old one
+ are registered in the replacement table so that we can fix the SSA web
+ after adding all the ASSERT_EXPRs. */
+- create_new_def_for (v, assertion, NULL);
++ tree new_def = create_new_def_for (v, assertion, NULL);
++ /* Make sure we preserve abnormalness throughout an ASSERT_EXPR chain
++ given we have to be able to fully propagate those out to re-create
++ valid SSA when removing the asserts. */
++ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (v))
++ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_def) = 1;
+
+ return assertion;
+ }
Index: gcc/ipa-visibility.c
===================================================================
--- a/src/gcc/ipa-visibility.c (.../tags/gcc_7_2_0_release)
@@ -6558,7 +6607,7 @@ Index: gcc/DATESTAMP
+++ b/src/gcc/DATESTAMP (.../branches/gcc-7-branch)
@@ -1 +1 @@
-20170814
-+20170923
++20170927
Index: gcc/tree.c
===================================================================
--- a/src/gcc/tree.c (.../tags/gcc_7_2_0_release)
@@ -6931,11 +6980,98 @@ Index: gcc/tree-ssa-sccvn.c
op.off = at - lhs_offset + rhs_offset;
vr->operands[0] = op;
op.type = TREE_TYPE (rhs);
+@@ -2990,16 +2990,13 @@
+ return false;
+
+ /* Verify the controlling stmt is the same. */
+- gimple *last1 = last_stmt (idom1);
+- gimple *last2 = last_stmt (idom2);
+- if (gimple_code (last1) != GIMPLE_COND
+- || gimple_code (last2) != GIMPLE_COND)
++ gcond *last1 = safe_dyn_cast <gcond *> (last_stmt (idom1));
++ gcond *last2 = safe_dyn_cast <gcond *> (last_stmt (idom2));
++ if (! last1 || ! last2)
+ return false;
+ bool inverted_p;
+- if (! cond_stmts_equal_p (as_a <gcond *> (last1),
+- vp1->cclhs, vp1->ccrhs,
+- as_a <gcond *> (last2),
+- vp2->cclhs, vp2->ccrhs,
++ if (! cond_stmts_equal_p (last1, vp1->cclhs, vp1->ccrhs,
++ last2, vp2->cclhs, vp2->ccrhs,
+ &inverted_p))
+ return false;
+
+@@ -3084,7 +3081,7 @@
+ vp1.ccrhs = NULL_TREE;
+ basic_block idom1 = get_immediate_dominator (CDI_DOMINATORS, vp1.block);
+ if (EDGE_COUNT (idom1->succs) == 2)
+- if (gcond *last1 = dyn_cast <gcond *> (last_stmt (idom1)))
++ if (gcond *last1 = safe_dyn_cast <gcond *> (last_stmt (idom1)))
+ {
+ vp1.cclhs = vn_valueize (gimple_cond_lhs (last1));
+ vp1.ccrhs = vn_valueize (gimple_cond_rhs (last1));
+@@ -3130,7 +3127,7 @@
+ vp1->ccrhs = NULL_TREE;
+ basic_block idom1 = get_immediate_dominator (CDI_DOMINATORS, vp1->block);
+ if (EDGE_COUNT (idom1->succs) == 2)
+- if (gcond *last1 = dyn_cast <gcond *> (last_stmt (idom1)))
++ if (gcond *last1 = safe_dyn_cast <gcond *> (last_stmt (idom1)))
+ {
+ vp1->cclhs = vn_valueize (gimple_cond_lhs (last1));
+ vp1->ccrhs = vn_valueize (gimple_cond_rhs (last1));
Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,496 @@
+@@ -1,3 +1,543 @@
++2017-09-27 Christophe Lyon <christophe.lyon at linaro.org>
++
++ Backport from trunk r249639.
++ 2017-06-26 Christophe Lyon <christophe.lyon at linaro.org>
++
++ * doc/sourcebuild.texi (ARM-specific attributes): Document new
++ arm_neon_ok_no_float_abi effective target.
++
++2017-09-26 Richard Biener <rguenther at suse.de>
++
++ Backport from mainline
++ 2017-09-19 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82244
++ * tree-vrp.c (remove_range_assertions): Do not propagate
++ a constant to abnormals but replace the assert with a copy.
++
++ 2017-09-21 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82276
++ PR tree-optimization/82244
++ * tree-vrp.c (build_assert_expr_for): Set
++ SSA_NAME_OCCURS_IN_ABNORMAL_PHI if the variable we assert on
++ has it set.
++ (remove_range_assertions): Revert earlier change.
++
++ 2017-09-20 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82264
++ * tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
++ for GIMPLE_CONDs.
++ (vn_phi_lookup): Likewise.
++ (vn_phi_insert): Likewise.
++ * is-a.h (safe_dyn_cast): New.
++
++ 2017-09-25 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82285
++ * tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
++ enumeral types.
++
++ 2017-09-22 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82291
++ * tree-if-conv.c (predicate_mem_writes): Make sure to
++ remove writes in blocks predicated with false.
++
+2017-09-21 Alan Modra <amodra at gmail.com>
+
+ PR target/81996
@@ -8166,6 +8302,32 @@ Index: gcc/testsuite/gcc.target/powerpc/vec-setup-long.c
+ (on 32-bit systems). The default endian order is used. */
+
+#include "vec-setup.h"
+Index: gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/arm/lto/pr65837-attr_0.c (.../branches/gcc-7-branch)
+@@ -1,6 +1,7 @@
+ /* { dg-lto-do run } */
+ /* { dg-require-effective-target arm_neon_hw } */
+-/* { dg-lto-options {{-flto}} } */
++/* { dg-require-effective-target arm_neon_ok_no_float_abi } */
++/* { dg-lto-options {{-flto -mfpu=neon}} } */
+
+ #include "arm_neon.h"
+
+Index: gcc/testsuite/gcc.target/arm/lto/pr65837_0.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/arm/lto/pr65837_0.c (.../branches/gcc-7-branch)
+@@ -1,7 +1,7 @@
+ /* { dg-lto-do run } */
+ /* { dg-require-effective-target arm_neon_hw } */
++/* { dg-require-effective-target arm_neon_ok_no_float_abi } */
+ /* { dg-lto-options {{-flto -mfpu=neon}} } */
+-/* { dg-suppress-ld-options {-mfpu=neon} } */
+
+ #include "arm_neon.h"
+
Index: gcc/testsuite/gcc.target/i386/pr81921.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/pr81921.c (.../tags/gcc_7_2_0_release)
@@ -8418,6 +8580,56 @@ Index: gcc/testsuite/lib/target-supports.exp
#include "cpuid.h"
int main ()
{
+@@ -3427,8 +3428,9 @@
+ global et_arm_neon_flags
+ set et_arm_neon_flags ""
+ if { [check_effective_target_arm32] } {
+- foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a"} {
++ foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp" "-mfpu=neon -mfloat-abi=softfp -march=armv7-a" "-mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard" "-mfpu=neon -mfloat-abi=hard -march=armv7-a"} {
+ if { [check_no_compiler_messages_nocache arm_neon_ok object {
++ #include <arm_neon.h>
+ int dummy;
+ #ifndef __ARM_NEON__
+ #error not NEON
+@@ -3453,6 +3455,38 @@
+ check_effective_target_arm_neon_ok_nocache]
+ }
+
++# Return 1 if this is an ARM target supporting -mfpu=neon without any
++# -mfloat-abi= option. Useful in tests where add_options is not
++# supported (such as lto tests).
++
++proc check_effective_target_arm_neon_ok_no_float_abi_nocache { } {
++ if { [check_effective_target_arm32] } {
++ foreach flags {"-mfpu=neon"} {
++ if { [check_no_compiler_messages_nocache arm_neon_ok_no_float_abi object {
++ #include <arm_neon.h>
++ int dummy;
++ #ifndef __ARM_NEON__
++ #error not NEON
++ #endif
++ /* Avoid the case where a test adds -mfpu=neon, but the toolchain is
++ configured for -mcpu=arm926ej-s, for example. */
++ #if __ARM_ARCH < 7 || __ARM_ARCH_PROFILE == 'M'
++ #error Architecture does not support NEON.
++ #endif
++ } "$flags"] } {
++ return 1
++ }
++ }
++ }
++
++ return 0
++}
++
++proc check_effective_target_arm_neon_ok_no_float_abi { } {
++ return [check_cached_effective_target arm_neon_ok_no_float_abi \
++ check_effective_target_arm_neon_ok_no_float_abi_nocache]
++}
++
+ proc check_effective_target_arm_crc_ok_nocache { } {
+ global et_arm_crc_flags
+ set et_arm_crc_flags "-march=armv8-a+crc"
Index: gcc/testsuite/gfortran.dg/dtio_12.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/dtio_12.f90 (.../tags/gcc_7_2_0_release)
@@ -9262,6 +9474,64 @@ Index: gcc/testsuite/gcc.dg/pr81621.c
+/* { dg-options "-Og -fno-split-wide-types -freorder-blocks-and-partition" } */
+
+#include "graphite/scop-10.c"
+Index: gcc/testsuite/gcc.dg/torture/pr82276.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr82276.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr82276.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,32 @@
++/* { dg-do compile } */
++
++typedef struct a {
++ struct a *b;
++} a;
++
++extern int d(void);
++extern int g(void);
++extern int h(void);
++extern int _setjmp();
++extern int i(void);
++
++void c(void) {
++ 1 ? d() : 0;
++ a *e;
++ while (e) {
++ e = (e == (a *) c) ? 0 : e->b;
++ while (e) {
++ unsigned int f = 0;
++ g();
++ _setjmp(f);
++ if (f & 6) {
++ ;
++ } else if (f & 2) {
++ ;
++ } else {
++ h();
++ }
++ i();
++ }
++ }
++}
+Index: gcc/testsuite/gcc.dg/torture/pr82285.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr82285.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr82285.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,16 @@
++/* { dg-do run } */
++
++enum tst { first = 0, second = 1 };
++
++int
++main ()
++{
++ enum tst data[16];
++
++ for (unsigned i = 0; i < 16; i++)
++ data[i] = (i < 5 ? second : first);
++
++ if (data[2] != second)
++ __builtin_abort ();
++ return 0;
++}
Index: gcc/testsuite/gcc.dg/torture/pr81181.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/torture/pr81181.c (.../tags/gcc_7_2_0_release)
@@ -9297,6 +9567,110 @@ Index: gcc/testsuite/gcc.dg/torture/pr81181.c
+
+ goto oo;
+}
+Index: gcc/testsuite/gcc.dg/torture/pr82244.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr82244.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr82244.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,31 @@
++/* { dg-do compile } */
++
++typedef struct a {
++ struct a *b;
++} a;
++
++extern int d(void);
++extern int g(void);
++extern int h(void);
++extern int _setjmp(void *);
++
++int c(void)
++{
++ 1 ? d() : 0;
++
++ a *e;
++ while (e) {
++ e = (e == (a *) c) ? 0 : e->b;
++ while (e) {
++ int f = 0;
++ g();
++ if (_setjmp(0)) {
++ if (f & 6) {
++ ;
++ } else if (f & 2) {
++ h();
++ }
++ }
++ }
++ }
++}
+Index: gcc/testsuite/gcc.dg/torture/pr82264.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr82264.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr82264.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,21 @@
++/* { dg-do compile } */
++
++char a;
++int c;
++unsigned b ();
++unsigned
++setjmp ()
++{
++}
++static void
++d ()
++{
++ if (b ())
++ c = 3;
++}
++void
++e ()
++{
++ d ();
++ a && ({ setjmp (); });
++}
+Index: gcc/testsuite/gcc.dg/torture/pr82291.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr82291.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr82291.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,37 @@
++/* { dg-do run } */
++
++int a, c, d, *h;
++unsigned b;
++
++int *fn1 ()
++{
++ int *f[3], g = 0;
++ for (; g < 3; g++)
++ f[g] = &a;
++ if (--b > a)
++ {
++ if (a > b)
++ d++;
++ return f[0];
++ }
++}
++
++void fn2 ()
++{
++ for (; c >= 0; --c)
++ {
++ int j[] = { 0, 0, 0, 0, 0 };
++ int *k = fn1 ();
++ if (!k)
++ __builtin_abort ();
++ h = &j[4];
++ }
++}
++
++int main ()
++{
++ fn2 ();
++ if (d != 0)
++ __builtin_abort ();
++ return 0;
++}
Index: gcc/testsuite/gcc.dg/pr81650.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/pr81650.c (.../tags/gcc_7_2_0_release)
@@ -9472,7 +9846,51 @@ Index: gcc/testsuite/ChangeLog
===================================================================
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,370 @@
+@@ -1,3 +1,414 @@
++2017-09-27 Christophe Lyon <christophe.lyon at linaro.org>
++
++ Backport from trunk r249639.
++ 2017-06-26 Christophe Lyon <christophe.lyon at linaro.org>
++
++ * lib/target-supports.exp
++ (check_effective_target_arm_neon_ok_nocache): Add flags with
++ -mfloat-abi=hard. Include arm_neon.h.
++ (check_effective_target_arm_neon_ok_no_float_abi_nocache): New.
++ (check_effective_target_arm_neon_ok_no_float_abi): New.
++ * gcc.target/arm/lto/pr65837_0.c: Require
++ arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options.
++ * gcc.target/arm/lto/pr65837-attr_0.c: Require
++ arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options.
++
++2017-09-26 Richard Biener <rguenther at suse.de>
++
++ Backport from mainline
++ 2017-09-19 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82244
++ * gcc.dg/torture/pr82244.c: New testcase.
++
++ 2017-09-21 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82276
++ PR tree-optimization/82244
++ * gcc.dg/torture/pr82276.c: New testcase.
++
++ 2017-09-20 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82264
++ * gcc.dg/torture/pr82264.c: New testcase.
++
++ 2017-09-25 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82285
++ * gcc.dg/torture/pr82285.c: New testcase.
++
++ 2017-09-22 Richard Biener <rguenther at suse.de>
++
++ PR tree-optimization/82291
++ * gcc.dg/torture/pr82291.c: New testcase.
++
+2017-09-22 Jakub Jelinek <jakub at redhat.com>
+
+ PR sanitizer/81929
@@ -12464,6 +12882,211 @@ Index: gcc/fortran/trans-io.c
if (ts->type == BT_CLASS)
derived = ts->u.derived->components->ts.u.derived;
+Index: gcc/tree-if-conv.c
+===================================================================
+--- a/src/gcc/tree-if-conv.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/tree-if-conv.c (.../branches/gcc-7-branch)
+@@ -2198,7 +2198,7 @@
+ gimple *stmt;
+ int index;
+
+- if (is_true_predicate (cond) || is_false_predicate (cond))
++ if (is_true_predicate (cond))
+ continue;
+
+ swap = false;
+@@ -2211,96 +2211,106 @@
+ vect_sizes.truncate (0);
+ vect_masks.truncate (0);
+
+- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+- if (!gimple_assign_single_p (stmt = gsi_stmt (gsi)))
+- continue;
+- else if (gimple_plf (stmt, GF_PLF_2))
+- {
+- tree lhs = gimple_assign_lhs (stmt);
+- tree rhs = gimple_assign_rhs1 (stmt);
+- tree ref, addr, ptr, mask;
+- gimple *new_stmt;
+- gimple_seq stmts = NULL;
+- int bitsize = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (lhs)));
+- ref = TREE_CODE (lhs) == SSA_NAME ? rhs : lhs;
+- mark_addressable (ref);
+- addr = force_gimple_operand_gsi (&gsi, build_fold_addr_expr (ref),
+- true, NULL_TREE, true,
+- GSI_SAME_STMT);
+- if (!vect_sizes.is_empty ()
+- && (index = mask_exists (bitsize, vect_sizes)) != -1)
+- /* Use created mask. */
+- mask = vect_masks[index];
+- else
+- {
+- if (COMPARISON_CLASS_P (cond))
+- mask = gimple_build (&stmts, TREE_CODE (cond),
+- boolean_type_node,
+- TREE_OPERAND (cond, 0),
+- TREE_OPERAND (cond, 1));
+- else
+- {
+- gcc_assert (TREE_CODE (cond) == SSA_NAME);
+- mask = cond;
+- }
++ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
++ {
++ if (!gimple_assign_single_p (stmt = gsi_stmt (gsi)))
++ ;
++ else if (is_false_predicate (cond))
++ {
++ unlink_stmt_vdef (stmt);
++ gsi_remove (&gsi, true);
++ release_defs (stmt);
++ continue;
++ }
++ else if (gimple_plf (stmt, GF_PLF_2))
++ {
++ tree lhs = gimple_assign_lhs (stmt);
++ tree rhs = gimple_assign_rhs1 (stmt);
++ tree ref, addr, ptr, mask;
++ gimple *new_stmt;
++ gimple_seq stmts = NULL;
++ int bitsize = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (lhs)));
++ ref = TREE_CODE (lhs) == SSA_NAME ? rhs : lhs;
++ mark_addressable (ref);
++ addr = force_gimple_operand_gsi (&gsi, build_fold_addr_expr (ref),
++ true, NULL_TREE, true,
++ GSI_SAME_STMT);
++ if (!vect_sizes.is_empty ()
++ && (index = mask_exists (bitsize, vect_sizes)) != -1)
++ /* Use created mask. */
++ mask = vect_masks[index];
++ else
++ {
++ if (COMPARISON_CLASS_P (cond))
++ mask = gimple_build (&stmts, TREE_CODE (cond),
++ boolean_type_node,
++ TREE_OPERAND (cond, 0),
++ TREE_OPERAND (cond, 1));
++ else
++ {
++ gcc_assert (TREE_CODE (cond) == SSA_NAME);
++ mask = cond;
++ }
+
+- if (swap)
+- {
+- tree true_val
+- = constant_boolean_node (true, TREE_TYPE (mask));
+- mask = gimple_build (&stmts, BIT_XOR_EXPR,
+- TREE_TYPE (mask), mask, true_val);
+- }
+- gsi_insert_seq_before (&gsi, stmts, GSI_SAME_STMT);
++ if (swap)
++ {
++ tree true_val
++ = constant_boolean_node (true, TREE_TYPE (mask));
++ mask = gimple_build (&stmts, BIT_XOR_EXPR,
++ TREE_TYPE (mask), mask, true_val);
++ }
++ gsi_insert_seq_before (&gsi, stmts, GSI_SAME_STMT);
+
+- mask = ifc_temp_var (TREE_TYPE (mask), mask, &gsi);
+- /* Save mask and its size for further use. */
+- vect_sizes.safe_push (bitsize);
+- vect_masks.safe_push (mask);
+- }
+- ptr = build_int_cst (reference_alias_ptr_type (ref),
+- get_object_alignment (ref));
+- /* Copy points-to info if possible. */
+- if (TREE_CODE (addr) == SSA_NAME && !SSA_NAME_PTR_INFO (addr))
+- copy_ref_info (build2 (MEM_REF, TREE_TYPE (ref), addr, ptr),
+- ref);
+- if (TREE_CODE (lhs) == SSA_NAME)
+- {
+- new_stmt
+- = gimple_build_call_internal (IFN_MASK_LOAD, 3, addr,
+- ptr, mask);
+- gimple_call_set_lhs (new_stmt, lhs);
+- gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+- }
+- else
+- {
+- new_stmt
+- = gimple_build_call_internal (IFN_MASK_STORE, 4, addr, ptr,
++ mask = ifc_temp_var (TREE_TYPE (mask), mask, &gsi);
++ /* Save mask and its size for further use. */
++ vect_sizes.safe_push (bitsize);
++ vect_masks.safe_push (mask);
++ }
++ ptr = build_int_cst (reference_alias_ptr_type (ref),
++ get_object_alignment (ref));
++ /* Copy points-to info if possible. */
++ if (TREE_CODE (addr) == SSA_NAME && !SSA_NAME_PTR_INFO (addr))
++ copy_ref_info (build2 (MEM_REF, TREE_TYPE (ref), addr, ptr),
++ ref);
++ if (TREE_CODE (lhs) == SSA_NAME)
++ {
++ new_stmt
++ = gimple_build_call_internal (IFN_MASK_LOAD, 3, addr,
++ ptr, mask);
++ gimple_call_set_lhs (new_stmt, lhs);
++ gimple_set_vuse (new_stmt, gimple_vuse (stmt));
++ }
++ else
++ {
++ new_stmt
++ = gimple_build_call_internal (IFN_MASK_STORE, 4, addr, ptr,
+ mask, rhs);
+- gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+- gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+- SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
+- }
++ gimple_set_vuse (new_stmt, gimple_vuse (stmt));
++ gimple_set_vdef (new_stmt, gimple_vdef (stmt));
++ SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
++ }
+
+- gsi_replace (&gsi, new_stmt, true);
+- }
+- else if (gimple_vdef (stmt))
+- {
+- tree lhs = gimple_assign_lhs (stmt);
+- tree rhs = gimple_assign_rhs1 (stmt);
+- tree type = TREE_TYPE (lhs);
++ gsi_replace (&gsi, new_stmt, true);
++ }
++ else if (gimple_vdef (stmt))
++ {
++ tree lhs = gimple_assign_lhs (stmt);
++ tree rhs = gimple_assign_rhs1 (stmt);
++ tree type = TREE_TYPE (lhs);
+
+- lhs = ifc_temp_var (type, unshare_expr (lhs), &gsi);
+- rhs = ifc_temp_var (type, unshare_expr (rhs), &gsi);
+- if (swap)
+- std::swap (lhs, rhs);
+- cond = force_gimple_operand_gsi_1 (&gsi, unshare_expr (cond),
+- is_gimple_condexpr, NULL_TREE,
+- true, GSI_SAME_STMT);
+- rhs = fold_build_cond_expr (type, unshare_expr (cond), rhs, lhs);
+- gimple_assign_set_rhs1 (stmt, ifc_temp_var (type, rhs, &gsi));
+- update_stmt (stmt);
+- }
++ lhs = ifc_temp_var (type, unshare_expr (lhs), &gsi);
++ rhs = ifc_temp_var (type, unshare_expr (rhs), &gsi);
++ if (swap)
++ std::swap (lhs, rhs);
++ cond = force_gimple_operand_gsi_1 (&gsi, unshare_expr (cond),
++ is_gimple_condexpr, NULL_TREE,
++ true, GSI_SAME_STMT);
++ rhs = fold_build_cond_expr (type, unshare_expr (cond), rhs, lhs);
++ gimple_assign_set_rhs1 (stmt, ifc_temp_var (type, rhs, &gsi));
++ update_stmt (stmt);
++ }
++ gsi_next (&gsi);
++ }
+ }
+ }
+
Index: gcc/calls.c
===================================================================
--- a/src/gcc/calls.c (.../tags/gcc_7_2_0_release)
@@ -314657,6 +315280,19 @@ Index: gcc/po/zh_CN.po
#~ msgid "bad method signature"
#~ msgstr "错误的方法签名"
+Index: gcc/tree-vect-patterns.c
+===================================================================
+--- a/src/gcc/tree-vect-patterns.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/tree-vect-patterns.c (.../branches/gcc-7-branch)
+@@ -3641,7 +3641,7 @@
+ rhs_code = gimple_assign_rhs_code (last_stmt);
+ if (CONVERT_EXPR_CODE_P (rhs_code))
+ {
+- if (TREE_CODE (TREE_TYPE (lhs)) != INTEGER_TYPE
++ if (! INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ || TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
+ return NULL;
+ vectype = get_vectype_for_scalar_type (TREE_TYPE (lhs));
Index: gcc/tree-vect-stmts.c
===================================================================
--- a/src/gcc/tree-vect-stmts.c (.../tags/gcc_7_2_0_release)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git
More information about the Reproducible-commits
mailing list