re PR tree-optimization/83518 (Missing optimization: useless instructions should...
authorRichard Biener <rguenther@suse.de>
Mon, 8 Jul 2019 07:09:24 +0000 (07:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Jul 2019 07:09:24 +0000 (07:09 +0000)
commit38988cbf9ebaa96fb1e891a46aa063f0c298a2e2
tree0f54d5e9ceddc39613106ca89f748a865a10a7f9
parent8849d5034c5ab5c2e6f3fc17209504576e7c6dd4
re PR tree-optimization/83518 (Missing optimization: useless instructions should be dropped)

2019-07-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83518
* tree-ssa-sccvn.c: Include splay-tree.h.
(struct pd_range, struct pd_data): New.
(struct vn_walk_cb_data): Add data to track partial definitions.
(vn_walk_cb_data::~vn_walk_cb_data): New.
(vn_walk_cb_data::push_partial_def): New.
(pd_tree_alloc, pd_tree_dealloc, pd_range_compare): New.
(vn_reference_lookup_2): When partial defs are registered give up.
(vn_reference_lookup_3): Track partial defs for memset and
constructor zeroing and for defs from constants.

* gcc.dg/tree-ssa/ssa-fre-73.c: New testcase.
* gcc.dg/tree-ssa/ssa-fre-74.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-75.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-76.c: Likewise.
* g++.dg/tree-ssa/pr83518.C: Likewise.

From-SVN: r273194
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr83518.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-73.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-74.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-75.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-76.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c