diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-07-07 21:47:40 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2016-07-07 21:47:40 +0000 |
commit | e825e291c8d43f89418059d077d3e75a397926d0 (patch) | |
tree | f3b15aed1bb0abbfc32ab251c82fe69076454df7 | |
parent | 5fc1336607dbae141a922387db3386edbd2bd623 (diff) |
Backported from mainline
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.
* gcc.target/i386/pr69891.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@238137 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dse.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69891.c | 30 |
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5cb436212f0..77a3af91ddd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,13 @@ 2016-07-07 Jakub Jelinek <jakub@redhat.com> Backported from mainline + 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-16 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/69802 diff --git a/gcc/dse.c b/gcc/dse.c index 9392f6bccc1..2aa5af0d5ca 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -2582,6 +2582,8 @@ scan_insn (bb_info_t bb_info, rtx insn) active_local_stores = insn_info; } } + else + clear_rhs_from_active_local_stores (); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7fc70834ed6..96a3b621674 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,12 @@ 2016-07-07 Jakub Jelinek <jakub@redhat.com> Backported from mainline + 2016-02-26 Jakub Jelinek <jakub@redhat.com> + Eric Botcazou <ebotcazou@adacore.com> + + PR rtl-optimization/69891 + * gcc.target/i386/pr69891.c: New test. + 2016-02-19 Jakub Jelinek <jakub@redhat.com> PR c++/67767 diff --git a/gcc/testsuite/gcc.target/i386/pr69891.c b/gcc/testsuite/gcc.target/i386/pr69891.c new file mode 100644 index 00000000000..2c5e86372e3 --- /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; +} |