OSDN Git Service

* config/alpha/alpha.md (umk_mismatch_args): Don't put a mode on set.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-dse.c
index 858cd5e..80c2622 100644 (file)
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
@@ -302,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; ...