+2018-06-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/86123
+ * match.pd ((X / Y) == 0 -> X < Y): Don't transform complex divisions.
+ Fix up comment formatting.
+
2018-06-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
* typed-splay-tree.h (typed_splay_tree::remove): New function.
(op @1 { build_zero_cst (TREE_TYPE (@1)); }))))
/* Transform:
- * (X / Y) == 0 -> X < Y if X, Y are unsigned.
- * (X / Y) != 0 -> X >= Y, if X, Y are unsigned.
- */
+ (X / Y) == 0 -> X < Y if X, Y are unsigned.
+ (X / Y) != 0 -> X >= Y, if X, Y are unsigned. */
(for cmp (eq ne)
ocmp (lt ge)
(simplify
(cmp (trunc_div @0 @1) integer_zerop)
(if (TYPE_UNSIGNED (TREE_TYPE (@0))
+ /* Complex ==/!= is allowed, but not </>=. */
+ && TREE_CODE (TREE_TYPE (@0)) != COMPLEX_TYPE
&& (VECTOR_TYPE_P (type) || !VECTOR_TYPE_P (TREE_TYPE (@0))))
(ocmp @0 @1))))
+2018-06-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/86123
+ * gcc.c-torture/compile/pr86123.c: New test.
+
2018-06-15 Tom de Vries <tdevries@suse.de>
* gcc.dg-selftests/dg-final.exp: Force sequential execution.
--- /dev/null
+/* PR middle-end/86123 */
+
+int
+foo (_Complex unsigned x, _Complex unsigned y)
+{
+ _Complex unsigned t1 = x / y;
+ int t2 = (t1 != 0);
+ return t2;
+}
+
+int
+bar (_Complex unsigned x, _Complex unsigned y)
+{
+ _Complex unsigned t1 = x / y;
+ int t2 = (t1 == 0);
+ return t2;
+}