+ /* In simple cases we can look through PHI nodes, but we
+ have to be careful with loops and with memory references
+ containing operands that are also operands of PHI nodes.
+ See gcc.c-torture/execute/20051110-*.c. */
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
+ {
+ if (temp
+ /* We can look through PHIs to post-dominated regions
+ without worrying if the use not also dominates prev
+ (in which case it would be a loop PHI with the use
+ in a latch block). */
+ || gimple_bb (prev) == gimple_bb (use_stmt)
+ || !dominated_by_p (CDI_POST_DOMINATORS,
+ gimple_bb (prev), gimple_bb (use_stmt))
+ || dominated_by_p (CDI_DOMINATORS,
+ gimple_bb (prev), gimple_bb (use_stmt)))
+ {
+ fail = true;
+ BREAK_FROM_IMM_USE_STMT (ui);
+ }
+ temp = use_stmt;
+ }
+ /* If the statement is a use the store is not dead. */
+ else if (ref_maybe_used_by_stmt_p (use_stmt,
+ gimple_assign_lhs (stmt)))
+ {
+ fail = true;
+ BREAK_FROM_IMM_USE_STMT (ui);
+ }
+ /* If this is a store, remember it or bail out if we have
+ multiple ones (the will be in different CFG parts then). */
+ else if (gimple_vdef (use_stmt))
+ {
+ if (temp)
+ {
+ fail = true;
+ BREAK_FROM_IMM_USE_STMT (ui);
+ }
+ temp = use_stmt;
+ }
+ }
+
+ if (fail)
+ return false;