* reload.c (find_reloads): Use it rather than testing for an
empty constraint string.
+ PR target/41514
+ * config/arm/arm.md (cbranchsi4_insn): Renamed from "*cbranchsi4_insn".
+ If the previous insn is a cbranchsi4_insn with the same arguments,
+ omit the compare instruction.
+
2010-04-16 Jakub Jelinek <jakub@redhat.com>
* alias.c (memrefs_conflict_p): If x and y are the same VALUE,
operands[3])); DONE;"
)
-(define_insn "*cbranchsi4_insn"
+(define_insn "cbranchsi4_insn"
[(set (pc) (if_then_else
(match_operator 0 "arm_comparison_operator"
[(match_operand:SI 1 "s_register_operand" "l,*h")
(pc)))]
"TARGET_THUMB1"
"*
- output_asm_insn (\"cmp\\t%1, %2\", operands);
+ rtx t = prev_nonnote_insn (insn);
+ if (t != NULL_RTX
+ && INSN_P (t)
+ && INSN_CODE (t) == CODE_FOR_cbranchsi4_insn)
+ {
+ t = XEXP (SET_SRC (PATTERN (t)), 0);
+ if (!rtx_equal_p (XEXP (t, 0), operands[1])
+ || !rtx_equal_p (XEXP (t, 1), operands[2]))
+ t = NULL_RTX;
+ }
+ else
+ t = NULL_RTX;
+ if (t == NULL_RTX)
+ output_asm_insn (\"cmp\\t%1, %2\", operands);
switch (get_attr_length (insn))
{
+2010-04-16 Bernd Schmidt <bernd.schmidt@codesourcery.com>
+
+ PR target/41514
+ gcc.target/arm/thumb-comparisons.c: New test.
+
2010-04-16 Christian Bruel <christian.bruel@st.com>
* g++.dg/torture/pr36191.C: Enable for SH.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+int foo(char ch)
+{
+ switch (ch) {
+ case '-':
+ case '?':
+ case '/':
+ case 99:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+/* { dg-final { scan-assembler-times "cmp\[\\t \]*r.,\[\\t \]*#63" 1 } } */