The function simplify_binary_operation_1 has code that does
/* Convert (compare (gt (flags) 0) (lt (flags) 0)) to (flags). */
but this transformation is only valid if "flags" has the same machine
mode as the outer compare. This fixes it.
PR rtl-optimization/60818
* simplify-rtx.c (simplify_binary_operation_1): Do not replace
a compare of comparisons with the thing compared if this results
in a different machine mode.
gcc/testsuite/
PR rtl-optimization/60818
* gcc.c-torture/compile/pr60818.c: New testcase.
From-SVN: r246666
+2017-04-04 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/60818
+ * simplify-rtx.c (simplify_binary_operation_1): Do not replace
+ a compare of comparisons with the thing compared if this results
+ in a different machine mode.
+
2017-04-03 Jonathan Wakely <jwakely@redhat.com>
* alias.c (base_alias_check): Fix typo in comment.
return xop00;
if (REG_P (xop00) && REG_P (xop10)
- && GET_MODE (xop00) == GET_MODE (xop10)
&& REGNO (xop00) == REGNO (xop10)
- && GET_MODE_CLASS (GET_MODE (xop00)) == MODE_CC
- && GET_MODE_CLASS (GET_MODE (xop10)) == MODE_CC)
+ && GET_MODE (xop00) == mode
+ && GET_MODE (xop10) == mode
+ && GET_MODE_CLASS (mode) == MODE_CC)
return xop00;
}
break;
+2017-04-04 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/60818
+ * gcc.c-torture/compile/pr60818.c: New testcase.
+
2017-04-03 Jonathan Wakely <jwakely@redhat.com>
* g++.old-deja/g++.benjamin/scope02.C: Fix typo in comment.
--- /dev/null
+int
+lx (int oi, int mb)
+{
+ return (oi < mb) < (mb < oi);
+}