Commit 4173ddaf by Segher Boessenkool Committed by Segher Boessenkool

arc: Fixes for RTL checking


	* config/arc/arc.c (arc_ccfsm_advance): Only take the PATTERN of
	this_insn if it is an INSN or JUMP_INSN.
	(force_offsettable): Look at base, not at addr.
	* config/arc/predicates.md (brcc_nolimm_operator): Don't call INTVAL
	on things that aren' necessarily CONST_INTs.

From-SVN: r245720
parent 4227c9ad
2017-02-24 Segher Boessenkool <segher@kernel.crashing.org>
* config/arc/arc.c (arc_ccfsm_advance): Only take the PATTERN of
this_insn if it is an INSN or JUMP_INSN.
(force_offsettable): Look at base, not at addr.
* config/arc/predicates.md (brcc_nolimm_operator): Don't call INTVAL
on things that aren't necessarily CONST_INTs.
2017-02-24 Uros Bizjak <ubizjak@gmail.com>
* doc/invoke.texi (x86 Options, -mfpmath=sse): Mention that
......
......@@ -3832,8 +3832,6 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state)
break;
}
scanbody = PATTERN (this_insn);
switch (GET_CODE (this_insn))
{
case CODE_LABEL:
......@@ -3868,6 +3866,8 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state)
break;
case JUMP_INSN:
scanbody = PATTERN (this_insn);
/* If this is an unconditional branch to the same label, succeed.
If it is to another label, do nothing. If it is conditional,
fail. */
......@@ -3902,6 +3902,8 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state)
break;
case INSN:
scanbody = PATTERN (this_insn);
/* We can only do this with insns that can use the condition
codes (and don't set them). */
if (GET_CODE (scanbody) == SET
......@@ -7401,7 +7403,7 @@ force_offsettable (rtx addr, HOST_WIDE_INT size, bool reuse)
}
if (!REG_P (base)
|| (REGNO (base) != STACK_POINTER_REGNUM
&& REGNO_PTR_FRAME_P (REGNO (addr)))
&& REGNO_PTR_FRAME_P (REGNO (base)))
|| !CONST_INT_P (offs) || !SMALL_INT (INTVAL (offs))
|| !SMALL_INT (INTVAL (offs) + size))
{
......
......@@ -458,8 +458,10 @@
(define_predicate "brcc_nolimm_operator"
(ior (match_test "REG_P (XEXP (op, 1))")
(and (match_code "eq, ne, lt, ge, ltu, geu")
(match_test "CONST_INT_P (XEXP (op, 1))")
(match_test "u6_immediate_operand (XEXP (op, 1), SImode)"))
(and (match_code "le, gt, leu, gtu")
(match_test "CONST_INT_P (XEXP (op, 1))")
(match_test "UNSIGNED_INT6 (INTVAL (XEXP (op, 1)) + 1)"))))
;; Return TRUE if this is the condition code register, if we aren't given
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment