https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So we start out with:
x2.0_1 = x2D.3906;
# RANGE VR_VARYING NONZERO 4294967294
_2 = x2.0_1 * 2;
# RANGE [0, 1] NONZERO 1
_3 = 1 / _2;
# VUSE <.MEM_7(D)>
x1.1_4 = x1D.3905;
x1.2_5 = (unsigned intD.10) x1.1_4;
_6 = _3 * x1.2_5;
if (_6 != 0)
So _6 will either be x1.2_5 or 0 (if _3 == 0)
So this means (_6 != 0) can be changed to (x1.2_5 !=0 || _3 == 0).
The only time _3 is nonzero 0 is _2 == 1 but we already know _2 can't be 2.
So the way to fix this is to improve VRP to get the range on _3 correct.