This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64130] vrp: handle non zero constant divided by range cannot be zero.
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Jun 2015 08:02:04 +0000
- Subject: [Bug tree-optimization/64130] vrp: handle non zero constant divided by range cannot be zero.
- Auto-submitted: auto-generated
- References: <bug-64130-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64130
--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
(for cmp1 (eq ne)
cmp2 (lt ge)
(simplify
(cmp1 (trunc_div @0 @1) integer_zerop)
(if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
|| VECTOR_INTEGER_TYPE_P (TREE_TYPE (@0)))
(cmp2 (abs @0) (abs @1)))))
(I assume that abs simplifies to the identity for unsigned)
But if we are going to use A/B anyway, computing two ABS may waste time, so
maybe restrict it to TYPE_UNSIGNED (TREE_TYPE (@0)) || single_use (@2) (where
@2 is the trunc_div) or something like that.