{
/* But a LABEL_REF around the REG_LABEL note, so
that we can canonicalize it. */
- rtx label_ref = gen_rtx_LABEL_REF (VOIDmode,
+ rtx label_ref = gen_rtx_LABEL_REF (Pmode,
XEXP (label_note, 0));
mark_jump_label (label_ref, insn, 0);
XEXP (comparison, 0),
XEXP (comparison, 1), insn);
}
+
+/* Return comparison with reversed code of EXP.
+ Return NULL_RTX in case we fail to do the reversal. */
+rtx
+reversed_comparison (rtx exp, enum machine_mode mode)
+{
+ enum rtx_code reversed_code = reversed_comparison_code (exp, NULL_RTX);
+ if (reversed_code == UNKNOWN)
+ return NULL_RTX;
+ else
+ return simplify_gen_relational (reversed_code, mode, VOIDmode,
+ XEXP (exp, 0), XEXP (exp, 1));
+}
+
\f
/* Given an rtx-code for a comparison, return the code for the negated
comparison. If no such code exists, return UNKNOWN.
return UNKNOWN;
default:
- abort ();
+ gcc_unreachable ();
}
}
return LTGT;
default:
- abort ();
+ gcc_unreachable ();
}
}
return UNLE;
default:
- abort ();
+ gcc_unreachable ();
}
}
return LEU;
default:
- abort ();
+ gcc_unreachable ();
}
}
return LE;
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
&& NOTE_LINE_NUMBER (label) == NOTE_INSN_DELETED_LABEL)
break;
- if (!LABEL_P (label))
- abort ();
+ gcc_assert (LABEL_P (label));
/* Ignore references to labels of containing functions. */
if (LABEL_REF_NONLOCAL_P (x))
{
rtx n;
if (nlabel)
- n = gen_rtx_LABEL_REF (VOIDmode, nlabel);
+ n = gen_rtx_LABEL_REF (Pmode, nlabel);
else
n = gen_rtx_RETURN (VOIDmode);
else if (code == RETURN && olabel == 0)
{
if (nlabel)
- x = gen_rtx_LABEL_REF (VOIDmode, nlabel);
+ x = gen_rtx_LABEL_REF (Pmode, nlabel);
else
x = gen_rtx_RETURN (VOIDmode);
if (loc == &PATTERN (insn))
{
rtx x = pc_set (jump);
int ochanges;
+ int ok;
ochanges = num_validated_changes ();
- if (!x || !invert_exp_1 (SET_SRC (x), jump))
- abort ();
+ gcc_assert (x);
+ ok = invert_exp_1 (SET_SRC (x), jump);
+ gcc_assert (ok);
+
if (num_validated_changes () == ochanges)
return 0;
- return redirect_jump_1 (jump, nlabel);
+ /* redirect_jump_1 will fail of nlabel == olabel, and the current use is
+ in Pmode, so checking this is not merely an optimization. */
+ return nlabel == JUMP_LABEL (jump) || redirect_jump_1 (jump, nlabel);
}
/* Invert the condition of the jump JUMP, and make it jump to label
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
return 1;
unsigned int
reg_or_subregno (rtx reg)
{
- if (REG_P (reg))
- return REGNO (reg);
if (GET_CODE (reg) == SUBREG)
- return REGNO (SUBREG_REG (reg));
- abort ();
+ reg = SUBREG_REG (reg);
+ gcc_assert (REG_P (reg));
+ return REGNO (reg);
}