https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123853
--- Comment #15 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
(In reply to John Paul Adrian Glaubitz from comment #14)
> 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;
I don't think that's the right place to fix the problem. Logically,
substituting into a PARALLEL should be equivalent to substituting into each
individual operand (ASM_OPERANDs excepted), whereas this would introduce a
correctness requirement that substitutions only happen on full patterns.
But unless I missed an announcement that this had changed, the current
assumption is that we can't take LLM-generated patches, so please don't ask it
to try again :)