[patch committed] Fix PR target/27182

Kaz Kojima kkojima@rr.iij4u.or.jp
Thu Apr 20 02:06:00 GMT 2006


I've applied the attached patch to the trunk and the 4.1 branch
under the Joern's approval in

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27182

to fix PR target/27182 which is a wrong-code problem on SH.
The PR is a 4.1/4.2 regression because the define_peephole2 causing
the problem was introduced after 4.0, though the PR is reported for
4.1.
The patch is tested with bootstrap and the top level "make -k check"
for the mainline and the 4.1 branch on sh4-unknown-linux-gnu with
no new failures.

Regards,
	kaz
--
2006-04-20  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/27182
	* config/sh/sh.md (movsicc_true+3): Tweak condition for the case
	that the last insn has the REG_INC note.

diff -uprN ORIG/trunk/gcc/config/sh/sh.md LOCAL/trunk/gcc/config/sh/sh.md
--- ORIG/trunk/gcc/config/sh/sh.md	2006-03-29 08:13:04.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.md	2006-04-18 12:30:52.000000000 +0900
@@ -1094,6 +1094,8 @@
   "(HARD_REGNO_NREGS (REGNO (operands[0]), GET_MODE (operands[2]))
     <= HARD_REGNO_NREGS (REGNO (operands[0]), GET_MODE (operands[0])))
    && peep2_reg_dead_p (3, operands[0]) && peep2_reg_dead_p (3, operands[2])
+   && ! FIND_REG_INC_NOTE (peep2_next_insn (2), operands[0])
+   && ! FIND_REG_INC_NOTE (peep2_next_insn (2), operands[2])
    && ! reg_overlap_mentioned_p (operands[0], operands[3])
    && ! reg_overlap_mentioned_p (operands[2], operands[0])
    && ! reg_overlap_mentioned_p (operands[0], operands[1])



More information about the Gcc-patches mailing list