This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[SH][committed] Fix PR 88562
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 02 Oct 2019 00:04:48 +0900
- Subject: [SH][committed] Fix PR 88562
Hi,
The attached patch fixes PR 88562.
Tested on trunk with
make -k check RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb}"
Committed to trunk, GCC 9, GCC 8, GCC 7 as r276411, r276412, r276413, r276414.
Cheers,
Oleg
gcc/ChangeLog:
PR target/88562
* config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use
sh_check_add_incdec_notes to preserve REG_INC notes when replacing
a memory access insn.
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c (revision 276264)
+++ gcc/config/sh/sh.c (working copy)
@@ -12068,9 +12068,11 @@
rtx r = gen_reg_rtx (SImode);
rtx_insn* i0;
if (from_mode == QImode)
- i0 = emit_insn_after (gen_extendqisi2 (r, set_src), insn);
+ i0 = sh_check_add_incdec_notes (
+ emit_insn_after (gen_extendqisi2 (r, set_src), insn));
else if (from_mode == HImode)
- i0 = emit_insn_after (gen_extendhisi2 (r, set_src), insn);
+ i0 = sh_check_add_incdec_notes (
+ emit_insn_after (gen_extendhisi2 (r, set_src), insn));
else
gcc_unreachable ();