summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-24 22:42:49 +0000
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-24 22:42:49 +0000
commit2bf19f4fb8a046668e552b5598972d93092ca3e7 (patch)
treeebf775ff7f9b69d1c96846f97fb645197aa7afea
parent18eff162682406ac7ab85367e35755f2ee3f05eb (diff)
downloadgcc-2bf19f4fb8a046668e552b5598972d93092ca3e7.tar.gz
sh: Fixes for RTL checking
* config/sh/sh.md (tstsi_t): If operands[0] is a SUBREG instead of a REG, look at the REG it is a SUBREG of. (splitter for cmpeqsi_t): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245727 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.md12
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35b1609da1f..cf24e79f263 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-02-24 Segher Boessenkool <segher@kernel.crashing.org>
+ * config/sh/sh.md (tstsi_t): If operands[0] is a SUBREG instead of
+ a REG, look at the REG it is a SUBREG of.
+ (splitter for cmpeqsi_t): Ditto.
+
+2017-02-24 Segher Boessenkool <segher@kernel.crashing.org>
+
* config/pa/pa.c (pa_combine_instructions): Do not share RTL. Make
the special USEs with the pattern of the insn, not the insn itself.
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 2645fca4738..e19e977087d 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -561,8 +561,12 @@
gcc_assert (CONST_INT_P (operands[1]));
HOST_WIDE_INT op1val = INTVAL (operands[1]);
+ rtx reg = operands[0];
+ if (SUBREG_P (reg))
+ reg = SUBREG_REG (reg);
+ gcc_assert (REG_P (reg));
bool op0_dead_after_this =
- sh_reg_dead_or_unused_after_insn (curr_insn, REGNO (operands[0]));
+ sh_reg_dead_or_unused_after_insn (curr_insn, REGNO (reg));
if (optimize)
{
@@ -834,7 +838,11 @@
/* If the tested reg is not dead after this insn, it's probably used by
something else after the comparison. It's probably better to leave
it as it is. */
- if (find_regno_note (curr_insn, REG_DEAD, REGNO (operands[0])) == NULL_RTX)
+ rtx reg = operands[0];
+ if (SUBREG_P (reg))
+ reg = SUBREG_REG (reg);
+ gcc_assert (REG_P (reg));
+ if (find_regno_note (curr_insn, REG_DEAD, REGNO (reg)) != NULL_RTX)
FAIL;
/* FIXME: Maybe also search the predecessor basic blocks to catch