aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-10-02 17:44:10 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-10-02 17:44:10 +0200
commitf240a230758a89d52799dc52606ec58963e248f2 (patch)
tree471e960cbada889c4272c30701c909bb5580a110 /gcc
parent804b7cc438701d94db8f958c2211c59f0357b757 (diff)
downloadgcc-f240a230758a89d52799dc52606ec58963e248f2.zip
gcc-f240a230758a89d52799dc52606ec58963e248f2.tar.gz
gcc-f240a230758a89d52799dc52606ec58963e248f2.tar.bz2
re PR tree-optimization/82387 (wrong code at -O1 and -Os on x86_64-linux-gnu in 64-bit mode)
PR tree-optimization/82387 PR tree-optimization/82388 PR tree-optimization/82389 * tree-ssa-dse.c (dse_classify_store): Test byte_tracking_enabled instead of live_bytes non-NULL. * gcc.c-torture/compile/pr82389.c: New test. * gcc.c-torture/execute/pr82387.c: New test. * gcc.c-torture/execute/pr82388.c: New test. From-SVN: r253356
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr82389.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr82387.c27
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr82388.c17
-rw-r--r--gcc/tree-ssa-dse.c4
6 files changed, 76 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8abda0a..7ee72e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/82387
+ PR tree-optimization/82388
+ PR tree-optimization/82389
+ * tree-ssa-dse.c (dse_classify_store): Test byte_tracking_enabled
+ instead of live_bytes non-NULL.
+
2017-10-02 Georg-Johann Lay <avr@gjlay.de>
PR target/41076
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 405a4b0..2b75536 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2017-10-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/82387
+ PR tree-optimization/82388
+ PR tree-optimization/82389
+ * gcc.c-torture/compile/pr82389.c: New test.
+ * gcc.c-torture/execute/pr82387.c: New test.
+ * gcc.c-torture/execute/pr82388.c: New test.
+
2017-10-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79180
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82389.c b/gcc/testsuite/gcc.c-torture/compile/pr82389.c
new file mode 100644
index 0000000..798bd84
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr82389.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/82389 */
+
+void bar (short);
+
+void
+foo (void)
+{
+ short a[5];
+ int b;
+ for (b = -1290603998; b < 5; b++)
+ a[b] = 0;
+ bar (a[3]);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr82387.c b/gcc/testsuite/gcc.c-torture/execute/pr82387.c
new file mode 100644
index 0000000..ead1a2a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr82387.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/82387 */
+
+struct A { int b; };
+int f = 1;
+
+struct A
+foo (void)
+{
+ struct A h[] = {
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1},
+ };
+ return h[24];
+}
+
+int
+main ()
+{
+ struct A i = foo (), j = i;
+ j.b && (f = 0);
+ return f;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr82388.c b/gcc/testsuite/gcc.c-torture/execute/pr82388.c
new file mode 100644
index 0000000..51e30f8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr82388.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/82388 */
+
+struct A { int b; int c; int d; } e;
+
+struct A
+foo (void)
+{
+ struct A h[30] = {{0,0,0}};
+ return h[29];
+}
+
+int
+main ()
+{
+ e = foo ();
+ return e.b;
+}
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 1eca740..6f58fff 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -577,10 +577,10 @@ dse_classify_store (ao_ref *ref, gimple *stmt, gimple **use_stmt,
/* If the statement is a use the store is not dead. */
else if (ref_maybe_used_by_stmt_p (use_stmt, ref))
{
- /* Handle common cases where we can easily build a ao_ref
+ /* Handle common cases where we can easily build an ao_ref
structure for USE_STMT and in doing so we find that the
references hit non-live bytes and thus can be ignored. */
- if (live_bytes && (!gimple_vdef (use_stmt) || !temp))
+ if (byte_tracking_enabled && (!gimple_vdef (use_stmt) || !temp))
{
if (is_gimple_assign (use_stmt))
{