{
// We need to keep the phi around for its local uses.
// Turn it into a degenerate phi, if it isn't already.
- use_info *use = phi->input_use (0);
- if (use->def () != new_value)
- update_use (use);
+ use_info *single_use = nullptr;
+ for (auto *use : phi->inputs ())
+ if (!single_use)
+ single_use = use;
+ else if (use->def () == new_value)
+ {
+ remove_use (single_use);
+ single_use = use;
+ }
+ else
+ remove_use (use);
+
+ if (single_use->def () != new_value)
+ update_use (single_use);
if (phi->is_degenerate ())
return;
- phi->make_degenerate (use);
+ phi->make_degenerate (single_use);
// Redirect all phi users to NEW_VALUE.
while (use_info *phi_use = phi->last_phi_use ())
--- /dev/null
+/* { dg-additional-options "-march=rv64gv -mabi=lp64" { target { rv64 } } } */
+
+float b[2], c[2];
+void d();
+int h1();
+void e(float * __restrict h) {
+ int f;
+ for (int f = 0; f < 4; f++) {
+ if (h1())
+ d();
+ }
+ for (int g = 0; g < 4; g++) {
+ c[0] = h[0] - b[0];
+ c[1] = h[1] - b[1];
+ d();
+ h += 1;
+ }
+}