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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> -      emit_move_insn (rem, plus_constant (ptr_mode, rem, -blksize));
> +      rtx rem_minus_blksize = plus_constant (ptr_mode, rem, -blksize);
> +      emit_move_insn (rem, force_operand (rem_minus_blksize, NULL_RTX));

Contrary to Andrew but for the full example it does not work here,
at least assuming that I did not make a mistake.

Namely, I still got:
reshape_generic.c:355:1: error: unrecognizable insn:
  355 | }
      | ^
(insn 545 544 546 45 (set (reg:DI 829)
        (plus:DI (reg:DI 829)
            (const_int -32 [0xffffffffffffffe0]))) "reshape_generic.c":186:14
-1
     (nil))
during RTL pass: vregs

 * * *

I think it should rather be something like the following - i.e. if there is a
clobber, a parallel has to be added.

The following seems to work fine when bootstrapping GCC:

(Disclaimer: I don't know until when this is supposed to be called, I note that
in lra.c, there is a note that insn_invalid_p shouldn't be called that late.
Thus, it might need to be called after the late INSN changes in builtins.c but
still before recog.c's extract_insn. But as it seems to work ...?)

diff --git a/gcc/recog.c b/gcc/recog.c
index eb617f11163..4ddc5d185af 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2768,2 +2768,4 @@ extract_insn (rtx_insn *insn)
       icode = recog_memoized (insn);
+      if (icode < 0 && !insn_invalid_p (insn, false))
+       icode = INSN_CODE (insn);
       if (icode < 0)

Reply via email to