From: jakub Date: Fri, 26 Feb 2016 15:53:43 +0000 (+0000) Subject: PR rtl-optimization/69891 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9441fa4e34f42d68ec8a5bac2411d9d3aa8ab986;p=thirdparty%2Fgcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233743 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f24b30a806e..520275a42931 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-02-26 Jakub Jelinek + Eric Botcazou + + 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 * doc/extend.texi: Mention clog10, clog10f an clog10l diff --git a/gcc/dse.c b/gcc/dse.c index 99f23cab413a..eef564454aaf 100644 --- 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 693e77d6b999..c03759ffd2c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-02-26 Jakub Jelinek + + PR rtl-optimization/69891 + * gcc.target/i386/pr69891.c: New test. + 2016-02-26 Michael Meissner Bill Schmidt diff --git a/gcc/testsuite/gcc.target/i386/pr69891.c b/gcc/testsuite/gcc.target/i386/pr69891.c new file mode 100644 index 000000000000..2c5e86372e3e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69891.c @@ -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; +}