https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105171

--- Comment #18 from Jason A. Donenfeld <jason at zx2c4 dot com> ---
If it truly doesn't matter whether local_tick is a valid value or an overflowed
one (to 0 or to -1 in this case), then just remove `&& (!local_tick ||
local_tick == (unsigned)-1)`. If you object to removing that line, then surely
you intend for local_tick to play some role in this. In that case, the fact
that one condition can overflow to become another condition sounds like the
logic is occasionally suboptimal.

In other words, it strikes me that your choices are:

1) remove a conditional clause that has no meaning;
2) fix the overflow in the value of a variable checked by that conditional
clause;
3) neglect to change anything, and have that conditional clause sometimes have
meaning and sometimes not.

Maybe having buggy code -- going with choice (3) -- doesn't matter overly much,
because other things in your system still make okay overall decisions. But that
doesn't change the fact that the condition is buggy when it overflows.

Anyway, I defer to comment 14, and note that we're now on comment 18, over a
bug with a trivial fix and an available patch. I think that's an indication
that whatever is happening here is truly out of my hands, so I'll duck out now.

Reply via email to