https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124649

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is what I am testing:
```
diff --git a/gcc/regcprop.cc b/gcc/regcprop.cc
index b1f00ca0435..9a9b77e0ff5 100644
--- a/gcc/regcprop.cc
+++ b/gcc/regcprop.cc
@@ -431,6 +431,13 @@ maybe_mode_change (machine_mode orig_mode, machine_mode
copy_mode,
                   machine_mode new_mode, unsigned int regno,
                   unsigned int copy_regno ATTRIBUTE_UNUSED)
 {
+  /* All three modes precision have to be ordered to each other.  */
+  if (!ordered_p (GET_MODE_PRECISION (orig_mode),
+                 GET_MODE_PRECISION (copy_mode))
+      || !ordered_p (GET_MODE_PRECISION (copy_mode),
+                    GET_MODE_PRECISION (new_mode)))
+    return NULL_RTX;
+
   if (partial_subreg_p (copy_mode, orig_mode)
       && partial_subreg_p (copy_mode, new_mode))
     return NULL_RTX;

```

Reply via email to