diff mbox series

[SH,committed] Fix PR 88562

Message ID d40db1a910971619279ed5ed4bcdbc0b64912e91.camel@t-online.de
State New
Headers show
Series [SH,committed] Fix PR 88562 | expand

Commit Message

Oleg Endo Oct. 1, 2019, 3:04 p.m. UTC
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.
diff mbox series

Patch

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 ();