+2013-05-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57303
+ * tree-ssa-sink.c (statement_sink_location): Improve killing
+ stmt detection and properly handle self-assignments.
+
2013-05-21 Christian Bruel <christian.bruel@st.com>
* dwarf2out.c (multiple_reg_loc_descriptor): Use dbx_reg_number for
+2013-05-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57303
+ * gcc.dg/torture/pr57303.c: New testcase.
+
2013-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57321
gimple use_stmt = USE_STMT (use_p);
/* A killing definition is not a use. */
- if (gimple_assign_single_p (use_stmt)
- && gimple_vdef (use_stmt)
- && operand_equal_p (gimple_assign_lhs (stmt),
- gimple_assign_lhs (use_stmt), 0))
- continue;
+ if ((gimple_has_lhs (use_stmt)
+ && operand_equal_p (gimple_assign_lhs (stmt),
+ gimple_get_lhs (use_stmt), 0))
+ || stmt_kills_ref_p (use_stmt, gimple_assign_lhs (stmt)))
+ {
+ /* If use_stmt is or might be a nop assignment then USE_STMT
+ acts as a use as well as definition. */
+ if (stmt != use_stmt
+ && ref_maybe_used_by_stmt_p (use_stmt,
+ gimple_assign_lhs (stmt)))
+ return false;
+ continue;
+ }
if (gimple_code (use_stmt) != GIMPLE_PHI)
return false;