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

--- Comment #14 from John Paul Adrian Glaubitz <glaubitz at debian dot org> ---
I let Gemini analyze this bug and it came up with the following patch which
fixes the problem for me and let me successfully build glibc with GCC 15:

diff --git a/gcc/recog.cc b/gcc/recog.cc
index 4cae276f1f7..87bab224be8 100644
--- a/gcc/recog.cc
+++ b/gcc/recog.cc
@@ -1289,6 +1289,11 @@ insn_propagation::apply_to_rvalue_1 (rtx *loc)
          failure_reason = "is subject to autoinc";
          return false;
        }
+      if (to && reg_overlap_mentioned_p (XEXP (x, 0), to))
+       {
+         failure_reason = "replacement overlaps with autoinc";
+         return false;
+       }
       recurse_p = true;
       break;

Reply via email to