--- /dev/null
+/* { dg-do compile } */
+
+_Bool a;
+struct s { int t; } c, d;
+unsigned e, f;
+unsigned transferValues(struct s *End) {
+ unsigned RegIdx = *(a ? &e : &f);
+ *End = *(a ? &c : &d);
+ return RegIdx;
+}
there are no statements that could read from memory
aliasing the lhs in between the start of bb and use_stmt.
As we require use_stmt to have a VDEF above, loads after
- use_stmt will use a different virtual SSA_NAME. */
+ use_stmt will use a different virtual SSA_NAME. When
+ we reach an edge inserted load the constraints we place
+ on processing guarantees that program order is preserved
+ so we can avoid checking those. */
FOR_EACH_IMM_USE_FAST (vuse_p, vui, vuse)
{
vuse_stmt = USE_STMT (vuse_p);
if (vuse_stmt == use_stmt)
continue;
- if (!dominated_by_p (CDI_DOMINATORS,
- gimple_bb (vuse_stmt), bb))
+ if (!gimple_bb (vuse_stmt)
+ || !dominated_by_p (CDI_DOMINATORS,
+ gimple_bb (vuse_stmt), bb))
continue;
if (ref_maybe_used_by_stmt_p (vuse_stmt,
gimple_assign_lhs (use_stmt)))