https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100418
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- LRA uses for this kind of things emit_add2_insn. This is during expansion though, and I think other spots e.g. in builtins.c use in such cases builtins.c- ret = plus_constant (GET_MODE (ret), ret, INTVAL (len_rtx)); builtins.c: ret = emit_move_insn (target, force_operand (ret, NULL_RTX)); instead, so I'd certainly try: --- gcc/builtins.c.jj 2021-05-04 21:02:23.954802278 +0200 +++ gcc/builtins.c 2021-05-05 12:35:51.990008546 +0200 @@ -6775,7 +6775,8 @@ try_store_by_multiple_pieces (rtx to, rt PTR+offset, we have to replace it. */ emit_move_insn (ptr, XEXP (to, 0)); to = replace_equiv_address (to, ptr); - 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)); } /* Iterate over power-of-two block sizes from the maximum length to @@ -6811,7 +6812,8 @@ try_store_by_multiple_pieces (rtx to, rt { emit_move_insn (ptr, XEXP (to, 0)); to = replace_equiv_address (to, ptr); - 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)); } if (label)