]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/69891 (wrong code with -mstringop-strategy=libcall @ i686)
authorJakub Jelinek <jakub@redhat.com>
Fri, 26 Feb 2016 15:53:43 +0000 (16:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 26 Feb 2016 15:53:43 +0000 (16:53 +0100)
PR rtl-optimization/69891
* dse.c (scan_insn): If we can't figure out memset arguments
or they are non-constant, call clear_rhs_from_active_local_stores.

* gcc.target/i386/pr69891.c: New test.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r233743

gcc/ChangeLog
gcc/dse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr69891.c [new file with mode: 0644]

index 4f24b30a806e9a1a26473c02cb471dc3c7f01074..520275a429318cfeeff7d2010edcc04fa5795eb8 100644 (file)
@@ -1,3 +1,10 @@
+2016-02-26  Jakub Jelinek  <jakub@redhat.com>
+           Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR rtl-optimization/69891
+       * dse.c (scan_insn): If we can't figure out memset arguments
+       or they are non-constant, call clear_rhs_from_active_local_stores.
+
 2016-02-26  Martin Liska  <mliska@suse.cz>
 
        * doc/extend.texi: Mention clog10, clog10f an clog10l
index 99f23cab413a553612d889da51f747e26e8f93a1..eef564454aaf330c2628bb9a1ae1435015d43a46 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2556,6 +2556,8 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn)
                      active_local_stores = insn_info;
                    }
                }
+             else
+               clear_rhs_from_active_local_stores ();
            }
        }
       else if (SIBLING_CALL_P (insn) && reload_completed)
index 693e77d6b99944c37e3d53381129d1aa2b6165fc..c03759ffd2c8ef7711f75b69687d8f962e4ecc86 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/69891
+       * gcc.target/i386/pr69891.c: New test.
+
 2016-02-26  Michael Meissner  <meissner@linux.vnet.ibm.com>
            Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
diff --git a/gcc/testsuite/gcc.target/i386/pr69891.c b/gcc/testsuite/gcc.target/i386/pr69891.c
new file mode 100644 (file)
index 0000000..2c5e863
--- /dev/null
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/69891 */
+/* { dg-do run } */
+/* { dg-options "-O -fno-tree-fre -mstringop-strategy=libcall -Wno-psabi" } */
+/* { dg-additional-options "-mno-sse" { target ia32 } } */
+
+typedef unsigned short A;
+typedef unsigned short B __attribute__ ((vector_size (32)));
+typedef unsigned int C;
+typedef unsigned int D __attribute__ ((vector_size (32)));
+typedef unsigned long long E;
+typedef unsigned long long F __attribute__ ((vector_size (32)));
+
+__attribute__((noinline, noclone)) unsigned
+foo(D a, B b, D c, F d)
+{
+  b /= (B) {1, -c[0]} | 1;
+  c[0] |= 7;
+  a %= c | 1;
+  c ^= c;
+  return a[0] + b[15] + c[0] + d[3];
+}
+
+int
+main ()
+{
+  unsigned x = foo ((D) {}, (B) {}, (D) {}, (F) {});
+  if (x != 0)
+    __builtin_abort ();
+  return 0;
+}