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

--- Comment #7 from Dimitar Dimitrov <dimitar at gcc dot gnu.org> ---
Thank you Andrew and Richard for the detailed analysis.

I tried the following change. It gave a few ICE regressions for x86_64, which I
have not yet investigated.  The patch fixed most but not all ICE regressions
for PRU.

diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 3e2c4309dee..47effdbe17b 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -971,4 +971,4 @@ validate_subreg (machine_mode omode, machine_mode imode,
   /* Paradoxical subregs must have offset zero.  */
-  if (maybe_gt (osize, isize))
-    return known_eq (offset, 0U);
+  if (maybe_gt (osize, isize) && !known_eq (offset, 0U))
+    return false;

@@ -988,3 +988,4 @@ validate_subreg (machine_mode omode, machine_mode imode,

-      return subreg_offset_representable_p (regno, imode, offset, omode);
+      return simplify_subreg_regno (regno, imode, offset, omode) >= 0;
     }



I'll continue with analysis of validate_subreg and its callers, so that I can
understand its intended semantics.  But since it's taking time and PRU build is
still broken, I'll try to temporarily workaround the issue for PRU using
TARGET_LEGITIMATE_COMBINED_INSN.

Reply via email to