diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-13 13:03:31 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-13 13:03:31 +0000 |
commit | ab450cc6fe4fd6a88ad6675000672ac66646bae8 (patch) | |
tree | 1fbb62b9afc53835c17dfb33351b1fa61122bfce /gcc/tree-ssa-dse.c | |
parent | 77b817fadfd2e11f91563ca94e8853eaa42cd1c0 (diff) | |
download | gcc-ab450cc6fe4fd6a88ad6675000672ac66646bae8.tar.gz |
2010-10-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45970
* tree-ssa-alias.h (stmt_kills_ref_p): Declare.
* tree-ssa-alias.c (stmt_kills_ref_p_1): New function.
(stmt_kills_ref_p): Likewise.
* tree-ssa-dse.c (dse_optimize_stmt): Use it.
* gcc.dg/tree-ssa/ssa-dse-13.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r-- | gcc/tree-ssa-dse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index be440c9b657..80c2622c9dc 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -301,8 +301,9 @@ dse_optimize_stmt (struct dse_global_data *dse_gd, virtual uses from stmt and the stmt which stores to that same memory location, then we may have found redundant store. */ if (bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt)) - && operand_equal_p (gimple_assign_lhs (stmt), - gimple_assign_lhs (use_stmt), 0)) + && (operand_equal_p (gimple_assign_lhs (stmt), + gimple_assign_lhs (use_stmt), 0) + || stmt_kills_ref_p (use_stmt, gimple_assign_lhs (stmt)))) { /* If use_stmt is or might be a nop assignment, e.g. for struct { ... } S a, b, *p; ... |