http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59358
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|rguenth at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31350
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31350&action=edit
gcc49-pr59358.patch
Untested fix. The problem is with:
Meeting
[-INF, y_5(D) + -1] EQUIVALENCES: { z_4 } (1 elements)
and
[-INF(OVF), 30]
to
[-INF(OVF), y_5(D) + -1] EQUIVALENCES: { } (0 elements)
Found new range for z_1: [-INF(OVF), y_5(D) + -1]
Because one of the maximum is symbolic, y_5(D) + -1 and 30 are effectively
uncomparable (operand_less_p doesn't return 1 for either order of those).
Apparently union_ranges implicitly assumes certain ordering based on earlier
tests, like from
else if ((maxeq || operand_less_p (vr1max, *vr0max) == 1)
&& (mineq || operand_less_p (*vr0min, vr1min) == 1))
being false it assumes that if
else if ((operand_less_p (vr1min, *vr0max) == 1
|| operand_equal_p (vr1min, *vr0max, 0))
&& operand_less_p (*vr0min, vr1min) == 1
is true then operand_less_p (*vr0max, vr1max) == 1, but that is not guaranteed.