+2019-09-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91725
+ * match.pd ((A / (1 << B)) -> (A >> B)): Call tree_nonzero_bits instead
+ of get_nonzero_bits, only call it for integral types.
+
2019-09-11 Richard Biener <rguenther@suse.de>
Revert
&& (TYPE_UNSIGNED (TREE_TYPE (@1))
|| (element_precision (type)
== element_precision (TREE_TYPE (@1)))
- || (get_nonzero_bits (@0)
- & wi::mask (element_precision (TREE_TYPE (@1)) - 1, true,
- element_precision (type))) == 0))))
+ || (INTEGRAL_TYPE_P (type)
+ && (tree_nonzero_bits (@0)
+ & wi::mask (element_precision (TREE_TYPE (@1)) - 1,
+ true,
+ element_precision (type))) == 0)))))
(rshift @0 @2)))
/* Preserve explicit divisions by 0: the C++ front-end wants to detect
--- /dev/null
+/* PR middle-end/91725 */
+
+unsigned long long
+foo (unsigned long long x, unsigned long long y, int z)
+{
+ return (x + y) / (1 << z);
+}