@@ -7030,16 +7030,12 @@
(define_expand "cbranchdi4"
[(set (pc) (if_then_else
(match_operator 0 "expandable_comparison_operator"
- [(match_operand:DI 1 "cmpdi_operand" "")
+ [(match_operand:DI 1 "s_register_operand" "")
(match_operand:DI 2 "cmpdi_operand" "")])
(label_ref (match_operand 3 "" ""))
(pc)))]
"TARGET_32BIT"
"{
- /* We should not have two constants. */
- gcc_assert (GET_MODE (operands[1]) == DImode
- || GET_MODE (operands[2]) == DImode);
-
if (!arm_validize_comparison (&operands[0], &operands[1], &operands[2]))
FAIL;
emit_jump_insn (gen_cbranch_cc (operands[0], operands[1], operands[2],
@@ -7955,14 +7951,10 @@
(define_expand "cstoredi4"
[(set (match_operand:SI 0 "s_register_operand" "")
(match_operator:SI 1 "expandable_comparison_operator"
- [(match_operand:DI 2 "cmpdi_operand" "")
+ [(match_operand:DI 2 "s_register_operand" "")
(match_operand:DI 3 "cmpdi_operand" "")]))]
"TARGET_32BIT"
"{
- /* We should not have two constants. */
- gcc_assert (GET_MODE (operands[2]) == DImode
- || GET_MODE (operands[3]) == DImode);
-
if (!arm_validize_comparison (&operands[1],
&operands[2],
&operands[3]))
@@ -0,0 +1,15 @@
+/* PR target/49069 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-tree-forwprop -Wno-div-by-zero" } */
+
+int a;
+const unsigned long long b[1] = { 1ULL };
+extern void bar (int);
+
+void
+foo (void)
+{
+ for (a = 0; a == 1; a = 2)
+ ;
+ bar (b[0] == (a == 0 ? a : a / 0));
+}