This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2016 12:05:23 +0000
- Subject: [Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer
- Auto-submitted: auto-generated
- References: <bug-71521-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
<bb 4>:
# RANGE [0, 2147483647] NONZERO 2147483647
_2 = 1 / 0;
# RANGE [0, 1073741823] NONZERO 1073741823
iftmp.0_5 = _2 >> 1;
if (iftmp.0_5 != 0)
so the testcase is somewhat artificial ...
/* For unsigned division when value ranges for dividend
and divisor are available. */
if (vr1.type == VR_RANGE
&& !symbolic_range_p (&vr0)
&& !symbolic_range_p (&vr1))
min = int_const_binop (code, vr0.min, vr1.max);
else
min = zero;
int_const_binop will return NULL_TREE for vr1.max == 0.
@@ -2938,7 +2944,8 @@ extract_range_from_binary_expr_1 (value_
and divisor are available. */
if (vr1.type == VR_RANGE
&& !symbolic_range_p (&vr0)
- && !symbolic_range_p (&vr1))
+ && !symbolic_range_p (&vr1)
+ && compare_values (vr1.min, zero) != 0)
min = int_const_binop (code, vr0.min, vr1.max);
else
min = zero;