@@ -6108,8 +6108,13 @@
(match_operand:GPR 2 "nonimmediate_operand" "")
(match_operand:GPR 3 "nonimmediate_operand" "")))]
"TARGET_Z196"
- "operands[1] = s390_emit_compare (GET_CODE (operands[1]),
- XEXP (operands[1], 0), XEXP (operands[1], 1));")
+{
+ /* Emit the comparison insn in case we do not already have a comparison result. */
+ if (!s390_comparison (operands[1], VOIDmode))
+ operands[1] = s390_emit_compare (GET_CODE (operands[1]),
+ XEXP (operands[1], 0),
+ XEXP (operands[1], 1));
+})
; locr, loc, stoc, locgr, locg, stocg
(define_insn_and_split "*mov<mode>cc"
new file mode 100644
@@ -0,0 +1,24 @@
+/* { dg-compile } */
+/* { dg-options "-O2 -march=z196" } */
+
+extern long useme (long, ...);
+
+void
+foo (void)
+{
+ long secs = useme (41);
+ long utc_secs = useme (42);
+ long h, m;
+
+ utc_secs = useme (42);
+ h = secs / 3600;
+ m = secs / 60;
+ if (utc_secs >= 86400)
+ {
+ m = 59;
+ h--;
+ if (h < 0)
+ h = 23;
+ }
+ useme (h, m);
+}