+2017-04-24 Marc Glisse <marc.glisse@inria.fr>
+
+ * match.pd (X/[ex]C CMP Y/[ex]C): New transformation.
+
2017-04-24 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/80293
&& wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1))))
(cmp @2 @0))))))
+/* X / 4 < Y / 4 iff X < Y when the division is known to be exact. */
+(for cmp (simple_comparison)
+ (simplify
+ (cmp (exact_div @0 INTEGER_CST@2) (exact_div @1 @2))
+ (if (wi::gt_p(@2, 0, TYPE_SIGN (TREE_TYPE (@2))))
+ (cmp @0 @1))))
+
/* ((X inner_op C0) outer_op C1)
With X being a tree where value_range has reasoned certain bits to always be
zero throughout its computed value range,
+2017-04-24 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/tree-ssa/cmpexactdiv-2.c: New file.
+
2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
* g++.dg/diagnostic/duplicate1.C: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized-raw" } */
+
+int f (long *a, long *b, long *c) {
+ __PTRDIFF_TYPE__ l1 = b - a;
+ __PTRDIFF_TYPE__ l2 = c - a;
+ return l1 < l2;
+}
+
+/* Eventually we also want to remove all minus_expr. */
+/* { dg-final { scan-tree-dump-not "exact_div_expr" "optimized" } } */