summaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-09-11 10:33:55 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-09-11 10:33:55 +0200
commit6d5093dad6a4927d23a914300605e76dd00c7a15 (patch)
tree2a3c8464e7a84791fc7d67aaa5319e7c48c8ca68 /gcc/match.pd
parentdc5b11916a2e318bd15d60f6cfd01d1e306ffbfb (diff)
re PR middle-end/91725 (ICE in get_nonzero_bits starting with r275587)
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. * gcc.c-torture/compile/pr91725.c: New test. From-SVN: r275633
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 05009bb7a5a..5690cf3d349 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -325,9 +325,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& (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