https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123776
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually this is more likely the fix:
```
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 4766187e0b9..a68bb9e0be7 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -5907,6 +5907,8 @@ gimple_fold_partial_load_store (gimple_stmt_iterator
*gsi, gcall *call)
}
gassign *new_stmt = gimple_build_assign (lhs, else_value);
gimple_set_location (new_stmt, gimple_location (call));
+ if (is_gimple_reg (lhs))
+ unlink_stmt_vdef (call);
+ else
+ gimple_move_vops (new_stmt, call);
gsi_replace (gsi, new_stmt, false);
return true;
}
```
That is if the lhs is a gimple reg, unlike the vdef otherwise move the vops to
the new stmt.