https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101240
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldyh at redhat dot com
--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
in VRP2 we see:
<bb 2> [local count: 1073741824]:
_1 = (*a_6(D))[0];
_2 = (*a_6(D))[1];
pretmp_8 = (*a_6(D))[2];
if (_1 < _2)
goto <bb 3>; [50.00%]
else
goto <bb 5>; [50.00%]
<bb 3> [local count: 536870913]:
if (_2 < pretmp_8)
goto <bb 4>; [0.00%]
else
goto <bb 5>; [100.00%]
<bb 4> [count: 0]:
__builtin_unreachable ();
<bb 5> [local count: 1073741824]:
_7 = _1 < pretmp_8;
return _7;
There isnt much VRP can do about this because if we take the path 2->5, we have
no way of resolving _1 < pretmp_8 because the comparison has not been made yet.
interestingly, if this were to be threaded,
2->3 would register _1 < _2
3->5 would register _2 >= ptrtmp_8
then in bb5' _1 < pretmp_8 should be answered by the path oracle as TRUE and
then be folded to return true. at least it should :-)
I guess the next question would be... why doesn't the threader think this is
worth threading?